Package ffx.crystal

Class ReplicatesCrystal

java.lang.Object
ffx.crystal.Crystal
ffx.crystal.ReplicatesCrystal

public class ReplicatesCrystal extends Crystal
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:
  • Constructor Details

    • ReplicatesCrystal

      public ReplicatesCrystal(Crystal unitCell, int l, int m, int n, double cutOff2)
      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.
    • getM

      public int getM()
      The number of replicates along the b-axis.
    • getN

      public int getN()
      The number of replicates along the c-axis.
    • replicatesCrystalFactory

      public 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. 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.
      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 class Crystal
      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 class Crystal
      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 class Crystal
      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 class Crystal
      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

      public boolean equals(Object o)
      Two crystals are equal only if all unit cell parameters are exactly the same.
      Overrides:
      equals in class Crystal
      Parameters:
      o - the Crystal to compare to.
      Returns:
      true if all unit cell parameters are exactly the same.
    • getCheckRestrictions

      public boolean getCheckRestrictions()
      Overrides:
      getCheckRestrictions in class Crystal
    • setCheckRestrictions

      public void setCheckRestrictions(boolean checkRestrictions)
      Overrides:
      setCheckRestrictions in class Crystal
    • getDensity

      public double getDensity(double mass)
      Return the density of the ReplicatesCrystal.
      Overrides:
      getDensity in class Crystal
      Parameters:
      mass - The mass of the ReplicatesCrystal.
      Returns:
      The density.
    • getUnitCell

      public Crystal 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 class Crystal
      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 class Crystal
      Parameters:
      density - Target density.
      mass - Mass of the ReplicatesCrystal.
    • setDensity

      public void setDensity(double density, double mass)
      Update the ReplicatesCrystal dimensions to the target density.
      Overrides:
      setDensity in class Crystal
      Parameters:
      density - Target density.
      mass - Mass of the ReplicatesCrystal.
    • toString

      public String toString()

      Include information about the base unit cell and replicates cell.

      Overrides:
      toString in class Crystal
    • toShortString

      public String toShortString()
      A String containing the replicated unit cell parameters.
      Overrides:
      toShortString in class Crystal
      Returns:
      A string with the unit cell parameters.