Package ffx.crystal
Class ReplicatesCrystal
java.lang.Object
ffx.crystal.Crystal
ffx.crystal.ReplicatesCrystal
The ReplicatesCrystal class extends Crystal to generate additional symmetry operators needed to
describe a "replicated" super-cell.
The replicated crystal cell edges are of length {l*a, m*b, n*c} where l, m and n are integers and
a, b and c are the original unit cell edge lengths.
The replicates integers l, m and n are chosen large enough for the ReplicatesCrystal to allow
consistent application of the minimum image convention. This is ensured by increasing l, m and/or
n until a sphere of necessary radius fits entirely inside the ReplicatedCrystal.
- Since:
- 1.0
- Author:
- Michael J. Schnieders
- See Also:
-
Field Summary
Fields inherited from class ffx.crystal.Crystal
a, A, A00, A01, A02, A10, A11, A12, A20, A21, A22, Ai, Ai00, Ai01, Ai02, Ai10, Ai11, Ai12, Ai20, Ai21, Ai22, alpha, b, beta, c, dVdA, dVdAlpha, dVdB, dVdBeta, dVdC, dVdGamma, G, gamma, interfacialRadiusA, interfacialRadiusB, interfacialRadiusC, scaleB, scaleN, spaceGroup, volume
-
Constructor Summary
ConstructorDescriptionReplicatesCrystal
(Crystal unitCell, int l, int m, int n, double cutOff2) Constructor for a ReplicatesCrystal. -
Method Summary
Modifier and TypeMethodDescriptionboolean
changeUnitCellParameters
(double a, double b, double c, double alpha, double beta, double gamma) Change the cell parameters for the base unit cell, which is followed by an update of the ReplicateCrystal parameters and possibly the number of replicated cells.boolean
changeUnitCellParametersAndVolume
(double a, double b, double c, double alpha, double beta, double gamma, double targetAUVolume) Change the cell parameters for the base unit cell, which is followed by an update of the ReplicateCrystal parameters and possibly the number of replicated cells.boolean
Two crystals are equal only if all unit cell parameters are exactly the same.boolean
Are space group restrictions being checked.double
getDensity
(double mass) Return the density of the ReplicatesCrystal.int
getL()
The number of replicates along the a-axis.int
getM()
The number of replicates along the b-axis.int
getN()
The number of replicates along the c-axis.The ReplicatesCrystal over-rides this method to return the unit cell rather than the ReplicateCell.boolean
randomParameters
(double density, double mass) Update the ReplicatesCrystal using random parameters with the target density.static Crystal
replicatesCrystalFactory
(Crystal unitCell, double cutOff2) Returns a ReplicatesCrystal large enough to satisfy the minimum image convention for the specified unit cell and cutoff criteria.static Crystal
replicatesCrystalFactory
(Crystal unitCell, double cutOff2, int[] replicatesVector) Returns a ReplicatesCrystal large enough to satisfy the minimum image convention for the specified unit cell and cutoff criteria.boolean
setCellVectors
(double[][] cellVectors) Change the cell vectors for the base unit cell, which is followed by an update of the ReplicateCrystal parameters and possibly the number of replicated cells.boolean
setCellVectorsAndVolume
(double[][] cellVectors, double targetAUVolume) Change the cell vectors and volume for the base unit cell, which is followed by an update of the ReplicateCrystal parameters and possibly the number of replicated cells.void
setCheckRestrictions
(boolean checkRestrictions) Set whether to check space group restrictions.void
setDensity
(double density, double mass) Update the ReplicatesCrystal dimensions to the target density.A String containing the replicated unit cell parameters.toString()
Methods inherited from class ffx.crystal.Crystal
aperiodic, applySymOp, applySymOp, applySymRot, applyTransSymRot, averageTensor, averageTensor, checkProperties, getCellParametersFromVectors, getNumSymOps, getRandomCartTranslation, getSpecialPositionCutoff, getSpecialPositionCutoff2, getTransformationOperator, hashCode, image, image, image, invressq, minDistOverSymOps, perturbCellVectors, res, setAperiodic, setSpecialPositionCutoff, toCartesianCoordinates, toCartesianCoordinates, toCartesianCoordinates, toCRYST1, toFractionalCoordinates, toFractionalCoordinates, toFractionalCoordinates, toPrimaryCell, updateCrystal
-
Constructor Details
-
ReplicatesCrystal
Constructor for a ReplicatesCrystal.- Parameters:
unitCell
- The base unit cell.l
- Number of replicates along the a-axis.m
- Number of replicates along the b-axis.n
- Number of replicates along the c-axis.cutOff2
- Twice the cut-off distance.- Since:
- 1.0
-
-
Method Details
-
getL
public int getL()The number of replicates along the a-axis.- Returns:
- The number of replicates along the a-axis.
-
getM
public int getM()The number of replicates along the b-axis.- Returns:
- The number of replicates along the b-axis.
-
getN
public int getN()The number of replicates along the c-axis.- Returns:
- The number of replicates along the c-axis.
-
replicatesCrystalFactory
Returns a ReplicatesCrystal large enough to satisfy the minimum image convention for the specified unit cell and cutoff criteria. If the unit cell is already sufficiently large, then it is returned.- Parameters:
unitCell
- The unit cell of the crystal.cutOff2
- Two times the cutoff distance.- Returns:
- A Crystal or ReplicatesCrystal large enough to satisfy the minimum image convention.
-
replicatesCrystalFactory
public static Crystal replicatesCrystalFactory(Crystal unitCell, double cutOff2, int[] replicatesVector) Returns a ReplicatesCrystal large enough to satisfy the minimum image convention for the specified unit cell and cutoff criteria. If the unit cell is already sufficiently large, then it is returned.- Parameters:
unitCell
- The unit cell of the crystal.cutOff2
- Two times the cutoff distance.replicatesVector
- The number of replicates along the a, b, and c axes.- Returns:
- A Crystal or ReplicatesCrystal large enough to satisfy the minimum image convention.
-
setCellVectors
public boolean setCellVectors(double[][] cellVectors) Change the cell vectors for the base unit cell, which is followed by an update of the ReplicateCrystal parameters and possibly the number of replicated cells.- Overrides:
setCellVectors
in classCrystal
- Parameters:
cellVectors
- 3x3 matrix of cell vectors.- Returns:
- True if the perturbation of cell vectors succeeds.
-
setCellVectorsAndVolume
public boolean setCellVectorsAndVolume(double[][] cellVectors, double targetAUVolume) Change the cell vectors and volume for the base unit cell, which is followed by an update of the ReplicateCrystal parameters and possibly the number of replicated cells.- Overrides:
setCellVectorsAndVolume
in classCrystal
- Parameters:
cellVectors
- 3x3 matrix of cell vectors.targetAUVolume
- the target volume for the new cell Vectors.- Returns:
- True if the perturbation of cell vectors succeeds.
-
changeUnitCellParameters
public boolean changeUnitCellParameters(double a, double b, double c, double alpha, double beta, double gamma) Change the cell parameters for the base unit cell, which is followed by an update of the ReplicateCrystal parameters and possibly the number of replicated cells.- Overrides:
changeUnitCellParameters
in classCrystal
- Parameters:
a
- The length of the a-axis for the base unit cell (in Angstroms).b
- The length of the b-axis for the base unit cell (in Angstroms).c
- The length of the c-axis for the base unit cell (in Angstroms).alpha
- The angle between the b-axis and c-axis (in Degrees).beta
- The angle between the a-axis and c-axis (in Degrees).gamma
- The angle between the a-axis and b-axis (in Degrees).- Returns:
- True is returned if the unit cell and replicates cell are updated successfully.
-
changeUnitCellParametersAndVolume
public boolean changeUnitCellParametersAndVolume(double a, double b, double c, double alpha, double beta, double gamma, double targetAUVolume) Change the cell parameters for the base unit cell, which is followed by an update of the ReplicateCrystal parameters and possibly the number of replicated cells.- Overrides:
changeUnitCellParametersAndVolume
in classCrystal
- Parameters:
a
- The length of the a-axis for the base unit cell (in Angstroms).b
- The length of the b-axis for the base unit cell (in Angstroms).c
- The length of the c-axis for the base unit cell (in Angstroms).alpha
- The angle between the b-axis and c-axis (in Degrees).beta
- The angle between the a-axis and c-axis (in Degrees).gamma
- The angle between the a-axis and b-axis (in Degrees).targetAUVolume
- the target volume for the new cell Vectors.- Returns:
- True is returned if the unit cell and replicates cell are updated successfully.
-
equals
Two crystals are equal only if all unit cell parameters are exactly the same. -
getCheckRestrictions
public boolean getCheckRestrictions()Are space group restrictions being checked.- Overrides:
getCheckRestrictions
in classCrystal
- Returns:
- true if the restrictions are being checked.
-
setCheckRestrictions
public void setCheckRestrictions(boolean checkRestrictions) Set whether to check space group restrictions.- Overrides:
setCheckRestrictions
in classCrystal
- Parameters:
checkRestrictions
- true to check restrictions.
-
getDensity
public double getDensity(double mass) Return the density of the ReplicatesCrystal.- Overrides:
getDensity
in classCrystal
- Parameters:
mass
- The mass of the ReplicatesCrystal.- Returns:
- The density.
-
getUnitCell
The ReplicatesCrystal over-rides this method to return the unit cell rather than the ReplicateCell.Returns the unit cell for this ReplicatesCrystal. This is useful for the reciprocal space portion of PME that operates on the unit cell even though the real space cutoff requires a ReplicatesCrystal.
- Overrides:
getUnitCell
in classCrystal
- Returns:
- The unit cell Crystal instance.
-
randomParameters
public boolean randomParameters(double density, double mass) Update the ReplicatesCrystal using random parameters with the target density.- Overrides:
randomParameters
in classCrystal
- Parameters:
density
- Target density.mass
- Mass of the ReplicatesCrystal.- Returns:
- True if the perturbation of cell vectors succeeds.
-
setDensity
public void setDensity(double density, double mass) Update the ReplicatesCrystal dimensions to the target density.- Overrides:
setDensity
in classCrystal
- Parameters:
density
- Target density.mass
- Mass of the ReplicatesCrystal.
-
toString
Include information about the base unit cell and replicates cell.
-
toShortString
A String containing the replicated unit cell parameters.- Overrides:
toShortString
in classCrystal
- Returns:
- A string with the unit cell parameters.
-