Configuration
, java.io.Serializable
ConfigurationLatticeFreeRadical
, ConfigurationLatticeRandom
, ConfigurationLatticeTube
, ConfigurationLatticeWithPlane
, ConfigurationZincblende
public class ConfigurationLattice extends java.lang.Object implements Configuration, java.io.Serializable
Iteration over the indexes yields integer arrays, and with each iteration the array is passed to the site method of the lattice which returns the position for placement of the next molecule. Each array index is iterated to a maximum value determined by the number of molecules to be placed, the dimensions of the box in which they are placed, and the lattice constants of the lattice. If there are not enough molecules to fill the lattice, they will be distributed as evenly as possible.
An instance of this class may be configured to place atoms such that they uniformly fill the volume of the box. It will attempt this by scaling the lattice constants of the configuration in an appropriate way. Success in getting a good spatial distribution may vary.
An instance can also be configured to remember the indices used to get lattice position for each molecule that is placed. This can be useful if it is desired to associate each molecule with a lattice site.
Modifier and Type | Class | Description |
---|---|---|
static class |
ConfigurationLattice.MyLattice |
Used to store the state of a lattice.
|
Modifier and Type | Field | Description |
---|---|---|
protected MoleculeActionTranslateTo |
atomActionTranslateTo |
|
protected double |
boundaryPadding |
|
protected IndexIteratorSizable |
indexIterator |
|
protected SpaceLattice |
lattice |
|
protected ConfigurationLattice.MyLattice |
myLat |
|
protected IMoleculePositionDefinition |
positionDefinition |
|
protected boolean |
rescalingToFitVolume |
|
protected Space |
space |
Constructor | Description |
---|---|
ConfigurationLattice(SpaceLattice lattice,
IndexIteratorSizable indexIterator,
Space space) |
Construct class that will place atoms on sites of the given lattice,
proceeding in the order resulting from iteration through the given index
iterator.
|
ConfigurationLattice(SpaceLattice lattice,
Space space) |
Constructs class using instance of IndexIteratorRectangular as the default
index iterator.
|
Modifier and Type | Method | Description |
---|---|---|
protected int[] |
calculateLatticeDimensions(int nCells,
Vector shape) |
|
double |
getBoundaryPadding() |
|
SpaceLattice |
getLatticeMemento() |
Returns a lattice with positions the same as those used in the
most recent use of initializeCoordinates.
|
void |
initializeCoordinates(Box box) |
Places the molecules in the given box on the positions of the
lattice.
|
void |
initializeCoordinates(Box box,
ISpecies species) |
|
boolean |
isRescalingToFitVolume() |
Returns the resizeLatticeToFitVolume flag.
|
void |
setBoundaryPadding(double newBoundaryPadding) |
|
void |
setRescalingToFitVolume(boolean resizeLatticeToFitVolume) |
Sets the resizeLatticeToFitVolume flag, which if true indicates that the
primitive vectors should be resized to fit the dimensions of the box.
|
protected final SpaceLattice lattice
protected final IndexIteratorSizable indexIterator
protected boolean rescalingToFitVolume
protected final MoleculeActionTranslateTo atomActionTranslateTo
protected ConfigurationLattice.MyLattice myLat
protected double boundaryPadding
protected final Space space
protected IMoleculePositionDefinition positionDefinition
public ConfigurationLattice(SpaceLattice lattice, Space space)
public ConfigurationLattice(SpaceLattice lattice, IndexIteratorSizable indexIterator, Space space)
public void setBoundaryPadding(double newBoundaryPadding)
public double getBoundaryPadding()
public void initializeCoordinates(Box box)
initializeCoordinates
in interface Configuration
protected int[] calculateLatticeDimensions(int nCells, Vector shape)
public SpaceLattice getLatticeMemento()
public boolean isRescalingToFitVolume()
public void setRescalingToFitVolume(boolean resizeLatticeToFitVolume)
resizeLatticeToFitVolume
- The resizeLatticeToFitVolume to set