etomica.lattice.crystal
Class Primitive

java.lang.Object
  extended by etomica.lattice.crystal.Primitive
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
PrimitiveBcc, PrimitiveCubic, PrimitiveFcc, PrimitiveGeneral, PrimitiveHexagonal, PrimitiveHexagonal2D, PrimitiveMonoclinic, PrimitiveOrthorhombic, PrimitiveOrthorhombicHexagonal, PrimitiveTetragonal, PrimitiveTriclinic, PrimitiveTrigonal

public abstract class Primitive
extends Object
implements Serializable

Collection of primitive elements that specify or are determined by the structure of a Bravais lattice.

See Also:
Serialized Form

Field Summary
protected  double[] angle
           
protected  int D
           
protected  int[] idx
           
protected  IVectorMutable[] latticeVectors
           
protected static double rightAngle
           
protected  double[] size
           
protected  ISpace space
           
 
Constructor Summary
Primitive(ISpace space)
          This constructor is called directly when a Primitive is constructing its reciprocal primitive.
 
Method Summary
abstract  Primitive copy()
          Returns a new, identical instance of this primitive.
 double[] getSize()
          Returns a new array with values equal to the lengths of the primitive vectors.
 ISpace getSpace()
           
abstract  int[] latticeIndex(IVector r)
          Returns the index which would give the unit cell containing the given point if the index were passed to a the site method of a sufficiently large lattice that uses this primitive.
abstract  int[] latticeIndex(IVector r, int[] dimensions)
          Same as latticeIndex(Space.Vector), but gives index for periodic system with number of unit cells in each direction as given by the dimensions array.
abstract  Primitive makeReciprocal()
          Method defining and constructing reciprocal primitive;
abstract  void scaleSize(double scale)
          Scales (multiplies) the size of each primitive vector by the given value.
protected  void setAngles(double[] newAngle)
          Sets the angles between the primitive vector to the corresponding values in the given array.
protected  void setSize(double[] newSize)
          Sets the length of each primitive vector to the corresponding value in the given array.
 Polytope unitCell()
          Returns a the unit cell specified by this primitive.
protected abstract  void update()
           
 IVector[] vectors()
          Returns the primitive vectors.
abstract  Polytope wignerSeitzCell()
          Returns the Wigner-Seitz cell specified by this primitive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

latticeVectors

protected final IVectorMutable[] latticeVectors

idx

protected final int[] idx

D

protected final int D

size

protected final double[] size

angle

protected final double[] angle

space

protected final ISpace space

rightAngle

protected static final double rightAngle
See Also:
Constant Field Values
Constructor Detail

Primitive

public Primitive(ISpace space)
This constructor is called directly when a Primitive is constructing its reciprocal primitive. For construction of the direct-lattice primitive, this constructor is called via the Primitive(Simulation) constructor.

Method Detail

makeReciprocal

public abstract Primitive makeReciprocal()
Method defining and constructing reciprocal primitive;


getSpace

public final ISpace getSpace()
Returns:
the space

getSize

public double[] getSize()
Returns a new array with values equal to the lengths of the primitive vectors.


setSize

protected final void setSize(double[] newSize)
Sets the length of each primitive vector to the corresponding value in the given array.


setAngles

protected final void setAngles(double[] newAngle)
Sets the angles between the primitive vector to the corresponding values in the given array.


update

protected abstract void update()

scaleSize

public abstract void scaleSize(double scale)
Scales (multiplies) the size of each primitive vector by the given value.


vectors

public IVector[] vectors()
Returns the primitive vectors. Does not return the original vectors used by the class, but instead returns copies. Thus changing the vectors returned by this method does not modify the primitive vectors used by this class. Subclasses should provide mutator methods that permit changes to the vectors while adhering to a particular structure (e.g., cubic, fcc, etc.).


copy

public abstract Primitive copy()
Returns a new, identical instance of this primitive.


latticeIndex

public abstract int[] latticeIndex(IVector r)
Returns the index which would give the unit cell containing the given point if the index were passed to a the site method of a sufficiently large lattice that uses this primitive.


latticeIndex

public abstract int[] latticeIndex(IVector r,
                                   int[] dimensions)
Same as latticeIndex(Space.Vector), but gives index for periodic system with number of unit cells in each direction as given by the dimensions array. If lattice index corresponds to a cell outside the range of dimensions, index of image in central cells is returned.


wignerSeitzCell

public abstract Polytope wignerSeitzCell()
Returns the Wigner-Seitz cell specified by this primitive. The returned cell does not remain tied to the primitive, and will not be updated with changes to the primitive.


unitCell

public Polytope unitCell()
Returns a the unit cell specified by this primitive. The returned cell does not remain tied to the primitive, and will not be updated with changes to the primitive.