Class RowRegion

Direct Known Subclasses:
BulkSolventRowRegion

public class RowRegion extends ParallelRegion
The RowRegion class is used to parallelize placing onto a 3D grid

1) Multipoles using B-splines or

2) Diffraction form factors.

Each "row" of 3D grid (i.e. fixed values of the z and y-coordinates) is operated on by only a single thread to logically enforce atomic updates of grid magnitudes.

Author:
Armin Avdic
  • Field Details

    • buff

      public int buff
    • select

      public boolean[][] select
    • rowLoop

      protected RowLoop[] rowLoop
    • coordinates

      protected double[][][] coordinates
  • Constructor Details

    • RowRegion

      public RowRegion(int gX, int gY, int gZ, double[] grid, int nSymm, int threadCount, Atom[] atoms, double[][][] coordinates)
      Constructor for RowRegion.
      Parameters:
      gX - a int.
      gY - a int.
      gZ - a int.
      grid - an array of
      invalid reference
      double
      objects.
      nSymm - a int.
      threadCount - a int.
      atoms - an array of Atom objects.
      coordinates - an array of
      invalid reference
      double
      objects.
  • Method Details

    • 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.

      Overrides:
      finish in class ParallelRegion
    • getGrid

      public double[] getGrid()
      Getter for the field grid.
      Returns:
      an array of
      invalid reference
      double
      objects.
    • getNatoms

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

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

      public int rowIndexForYZ(int giy, int giz)
      rowIndexForYZ.
      Parameters:
      giy - a int.
      giz - a int.
      Returns:
      a int.
    • run

      public void run() throws Exception
      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
      Throws:
      Exception - The run() method may throw any exception.
      Exception - if any.
    • selectAtoms

      public void selectAtoms()
      Select atoms that should be included. 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)
      Setter for the field atoms.
      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(RowLoop[] loops)
      setDensityLoop.
      Parameters:
      loops - an array of RowLoop objects.
    • setInitValue

      public void setInitValue(double initValue)
      Setter for the field initValue.
      Parameters:
      initValue - a double.
    • 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.

      Overrides:
      start in class ParallelRegion
    • yFromRowIndex

      public int yFromRowIndex(int i)
      yFromRowIndex.
      Parameters:
      i - a int.
      Returns:
      a int.
    • zFromRowIndex

      public int zFromRowIndex(int i)
      zFromRowIndex.
      Parameters:
      i - a int.
      Returns:
      a int.