Class SpatialDensityRegion

java.lang.Object
edu.rit.pj.ParallelConstruct
edu.rit.pj.ParallelRegion
ffx.potential.nonbonded.SpatialDensityRegion
Direct Known Subclasses:
BulkSolventDensityRegion

public class SpatialDensityRegion extends ParallelRegion
This class implements a spatial decomposition based on partitioning a grid into octants.
Since:
1.0
Author:
Michael J. Schnieders
  • Field Details

    • logger

      protected static final Logger logger
      Constant logger
    • nThreads

      public final int nThreads
    • nSymm

      protected final int nSymm
    • actualCount

      public int[] actualCount
    • nAtoms

      public int nAtoms
    • nA

      protected int nA
      The number of divisions along the A-axis.
    • nB

      protected int nB
      The number of divisions along the B-axis.
    • nC

      protected int nC
      The number of divisions along the C-Axis.
    • actualWork

      protected int actualWork
      Number of octant work cells with at least one atom (actualWork is less than or equal to nWork).
    • coordinates

      protected double[][][] coordinates
    • select

      protected boolean[][] select
    • crystal

      protected Crystal crystal
    • spatialDensityLoop

      protected SpatialDensityLoop[] spatialDensityLoop
  • Constructor Details

    • SpatialDensityRegion

      public SpatialDensityRegion(int gX, int gY, int gZ, double[] grid, int basisSize, int nSymm, int minWork, int threadCount, Crystal crystal, Atom[] atoms, double[][][] coordinates)
      Constructor for SpatialDensityRegion.
      Parameters:
      gX - a int.
      gY - a int.
      gZ - a int.
      grid - an array of double.
      basisSize - a int.
      nSymm - a int.
      minWork - a int.
      threadCount - a int.
      crystal - a Crystal object.
      atoms - an array of Atom objects.
      coordinates - an array of double.
  • Method Details

    • assignAtomsToCells

      public void assignAtomsToCells()
      Assign asymmetric and symmetry mate atoms to cells. This is very fast; there is little to be gained from parallelization at this point.
    • getGrid

      public double[] getGrid()
      Getter for the field grid.
      Returns:
      an array of double.
    • getNsymm

      public int getNsymm()
      getNsymm
      Returns:
      a int.
    • index

      public int index(int ia, int ib, int ic)
      index
      Parameters:
      ia - a int.
      ib - a int.
      ic - a int.
      Returns:
      a int.
    • 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.

      Specified by:
      run in class ParallelRegion
    • selectAtoms

      public void selectAtoms()
      Select atoms that should be assigned to cells. The default is to include all atoms, which is set up in the constructor. This function should be over-ridden by subclasses that want finer control.
    • setAtoms

      public void setAtoms(Atom[] atoms)
      setAtoms.
      Parameters:
      atoms - an array of Atom objects.
    • setCrystal

      public final void setCrystal(Crystal crystal, int gX, int gY, int gZ)
      Setter for the field crystal.
      Parameters:
      crystal - a Crystal object.
      gX - a int.
      gY - a int.
      gZ - a int.
    • setDensityLoop

      public void setDensityLoop(SpatialDensityLoop[] loops)
      setDensityLoop
      Parameters:
      loops - an array of SpatialDensityLoop objects.
    • setInitValue

      public void setInitValue(double initValue)
      Setter for the field initValue.
      Parameters:
      initValue - a double.