Class NeighborList


public class NeighborList extends ParallelRegion
The NeighborList class builds Verlet lists in parallel via a spatial decomposition.
  1. The unit cell is partitioned into nA * nB * nC smaller axis-aligned cells, where {nA, nB, nC} are chosen as large as possible subject to the criteria that the length of each side of a sub-volume (rCellA, rCellB, rCellC) multiplied by nEdge must be greater than the cutoff distance Rcut plus a buffer distance delta:
    rCellA * nEdge .GE. (Rcut + delta)
    rCellB * nEdge .GE. (Rcut + delta)
    rCellC * nEdge .GE. (Rcut + delta)
    All neighbors of an atom are in a block of (2*nEdge+1)^3 neighborCells.
  2. Interactions between an atom and neighbors in the asymmetric unit require only half the neighboring cells to be searched to avoid double counting. However, enumeration of interactions between an atom in the asymmetric unit and its neighbors in a symmetry mate require all cells to be searched.
  3. Verlet lists from the search are stored, which reduces the number of neighbors whose distances must be calculated by a factor of approximately:
    (4/3*Pi*Rcut^3)/(neighborCells*Vcell) About 1/3 as many interactions are contained in the Verlet lists compared to the total amount in the neighboring cells.
Since:
1.0
Author:
Michael J. Schnieders
  • Constructor Details

    • NeighborList

      public NeighborList(MaskingInterface maskingRules, Crystal crystal, Atom[] atoms, double cutoff, double buffer, ParallelTeam parallelTeam)
      Constructor for the NeighborList class.
      Parameters:
      maskingRules - This parameter may be null.
      crystal - Definition of the unit cell and space group.
      atoms - The atoms to generate Verlet lists for.
      cutoff - The cutoff distance.
      buffer - The buffer distance.
      parallelTeam - Specifies the parallel environment.
      Since:
      1.0
  • Method Details

    • buildList

      public void buildList(double[][] coordinates, int[][][] lists, boolean[] use, boolean forceRebuild, boolean print)
      This method can be called as necessary to build/rebuild the neighbor lists.
      Parameters:
      coordinates - The coordinates of each atom [nSymm][nAtoms*3].
      lists - The neighbor lists [nSymm][nAtoms][nPairs].
      use - an array of boolean.
      forceRebuild - If true, the list is rebuilt even if no atom has moved half the buffer size.
      print - a boolean.
      Since:
      1.0
    • destroy

      public void destroy() throws Exception
      destroy.
      Throws:
      Exception - if any.
    • finish

      public void finish()
      Perform finalization actions after parallel execution ends. Only one thread calls the finish() method.

      The finish() method may be overridden in a subclass. If not overridden, the finish() method does nothing.

      This is method should not be called; it is invoked by Parallel Java.

      Overrides:
      finish in class ParallelRegion
      Since:
      1.0
    • getCutoff

      public double getCutoff()
      Returns the cutoff distance used internally by NeighborList.
      Returns:
      Cutoff distance in Angstroms.
    • setDisableUpdates

      public void setDisableUpdates(boolean disableUpdate)
      If disableUpdates true, disable updating the neighbor list upon motion. Use with caution; best recommendation is to only use if all atoms have a coordinate restraint.
      Parameters:
      disableUpdate - Disable updating the neighbor list
    • getNeighborList

      public int[][][] getNeighborList()
      Return the Verlet list.
      Returns:
      The Verlet list of size [nSymm][nAtoms][nNeighbors].
    • getPairwiseSchedule

      public PairwiseSchedule getPairwiseSchedule()
      Getter for the field pairwiseSchedule.
      Returns:
      a PairwiseSchedule object.
    • run

      public void run()
      Execute parallel code. All threads of the parallel team call the run() method concurrently.

      The run() method must be implemented in a subclass.

      This is method should not be called; it is invoked by Parallel Java.

      Specified by:
      run in class ParallelRegion
      Since:
      1.0
    • setAtoms

      public void setAtoms(Atom[] atoms)
      The NeighborList will be re-configured, if necessary, for the supplied atom list.
      Parameters:
      atoms - A new list of atoms to operate on.
    • setCrystal

      public void setCrystal(Crystal crystal)
      The NeighborList will be re-configured, if necessary, for the supplied Crystal. Changes to both unit cell parameters and number of symmetry operators are also acceptable.
      Parameters:
      crystal - A crystal defining boundary conditions and symmetry.
    • setIntermolecular

      public void setIntermolecular(boolean intermolecular)
      Setter for the field intermolecular.
      Parameters:
      intermolecular - If true, the NeighborList will include intermolecular interactions.
    • start

      public void start()
      Perform initialization actions before parallel execution begins. Only one thread calls the start() method.

      The start() method may be overridden in a subclass. If not overridden, the start() method does nothing.

      This is method should not be called; it is invoked by Parallel Java.

      Overrides:
      start in class ParallelRegion
      Since:
      1.0