Package ffx.potential.nonbonded
Class NeighborList
java.lang.Object
edu.rit.pj.ParallelConstruct
edu.rit.pj.ParallelRegion
ffx.potential.nonbonded.NeighborList
The NeighborList class builds Verlet lists in parallel via a spatial decomposition. 
 
- The unit cell is partitioned into 
nA * nB * nCsmaller 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 distanceRcutplus a buffer distancedelta:
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. - 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.
 - 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
 
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHold the atom index and its symmetry operator.static classHold the atoms in each cell. - 
Constructor Summary
ConstructorsConstructorDescriptionNeighborList(Crystal crystal, Atom[] atoms, double cutoff, double buffer, ParallelTeam parallelTeam) Constructor for the NeighborList class. - 
Method Summary
Modifier and TypeMethodDescriptionvoidbuildList(double[][] coordinates, int[][][] lists, boolean[] use, boolean forceRebuild, boolean print) This method can be called as necessary to build/rebuild the neighbor lists.voiddestroy()destroy.voidfinish()Perform finalization actions after parallel execution ends.doubleReturns the cutoff distance used internally by NeighborList.int[][][]Return the Verlet list.Getter for the fieldpairwiseSchedule.static voidDebugging method.voidrun()Execute parallel code.voidThe NeighborList will be re-configured, if necessary, for the supplied atom list.voidsetCrystal(Crystal crystal) The NeighborList will be re-configured, if necessary, for the supplied Crystal.voidsetDisableUpdates(boolean disableUpdate) If disableUpdates true, disable updating the neighbor list upon motion.voidsetGroupSize(int M) Set the group size for group-based Verlet lists.voidsetIntermolecular(boolean intermolecular) Setter for the fieldintermolecular.voidstart()Perform initialization actions before parallel execution begins.Methods inherited from class edu.rit.pj.ParallelRegion
barrier, barrier, critical, critical, criticalNonexclusive, criticalNonexclusive, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, executeMethods inherited from class edu.rit.pj.ParallelConstruct
getThreadCount, getThreadIndex, isExecutingInParallel, region, team 
- 
Constructor Details
- 
NeighborList
public NeighborList(Crystal crystal, Atom[] atoms, double cutoff, double buffer, ParallelTeam parallelTeam) Constructor for the NeighborList class.- Parameters:
 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
 
 - 
setGroupSize
public void setGroupSize(int M) Set the group size for group-based Verlet lists.If M is less than or equal to 1, then the NeighborList will not build group-based Verlet lists.
- Parameters:
 M- The size of the groups to build.
 - 
destroy
destroy.- Throws:
 Exception- if any.
 - 
finish
public void finish()Perform finalization actions after parallel execution ends. Only one thread calls thefinish()method.The
finish()method may be overridden in a subclass. If not overridden, thefinish()method does nothing.This is method should not be called; it is invoked by Parallel Java.
- Overrides:
 finishin classParallelRegion- 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
Getter for the fieldpairwiseSchedule.- Returns:
 - a 
PairwiseScheduleobject. 
 - 
run
public void run()Execute parallel code. All threads of the parallel team call therun()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:
 runin classParallelRegion- Since:
 - 1.0
 
 - 
setAtoms
The NeighborList will be re-configured, if necessary, for the supplied atom list.- Parameters:
 atoms- A new list of atoms to operate on.
 - 
setCrystal
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 fieldintermolecular.- 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 thestart()method.The
start()method may be overridden in a subclass. If not overridden, thestart()method does nothing.This is method should not be called; it is invoked by Parallel Java.
- Overrides:
 startin classParallelRegion- Since:
 - 1.0
 
 - 
main
Debugging method.- Parameters:
 args- Command line arguments.
 
 -