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 * 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 distanceRcut
plus 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
Modifier and TypeClassDescriptionstatic class
Hold the atom index and its symmetry operator.static class
Hold the atoms in each cell. -
Constructor Summary
ConstructorDescriptionNeighborList
(MaskingInterface maskingRules, Crystal crystal, Atom[] atoms, double cutoff, double buffer, ParallelTeam parallelTeam) Constructor for the NeighborList class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
buildList
(double[][] coordinates, int[][][] lists, boolean[] use, boolean forceRebuild, boolean print) This method can be called as necessary to build/rebuild the neighbor lists.void
buildMxNList
(int M, int N, double[][] coordinates, int[][][] lists, boolean[] use, boolean forceRebuild, boolean print) void
destroy()
destroy.void
finish()
Perform finalization actions after parallel execution ends.double
Returns the cutoff distance used internally by NeighborList.int[][][]
Return the Verlet list.Getter for the fieldpairwiseSchedule
.static void
Debugging method.void
run()
Execute parallel code.void
The NeighborList will be re-configured, if necessary, for the supplied atom list.void
setCrystal
(Crystal crystal) The NeighborList will be re-configured, if necessary, for the supplied Crystal.void
setDisableUpdates
(boolean disableUpdate) If disableUpdates true, disable updating the neighbor list upon motion.void
setIntermolecular
(boolean intermolecular) Setter for the fieldintermolecular
.void
start()
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, execute
Methods inherited from class edu.rit.pj.ParallelConstruct
getThreadCount, getThreadIndex, isExecutingInParallel, region, team
-
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
-
buildMxNList
public void buildMxNList(int M, int N, double[][] coordinates, int[][][] lists, boolean[] use, boolean forceRebuild, boolean print) -
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:
finish
in 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
PairwiseSchedule
object.
-
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:
run
in 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:
start
in classParallelRegion
- Since:
- 1.0
-
main
Debugging method.- Parameters:
args
-
-