Class RowLoop


public abstract class RowLoop extends IntegerForLoop
The RowLoop class is used to parallelize placing onto a 3D grid

1) Multipoles using B-splines or

2) Diffraction form factors.

Each "row" of the 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

  • Constructor Details

    • RowLoop

      public RowLoop(int nAtoms, int nSymm, RowRegion rowRegion)
      Constructor for RowLoop.
      Parameters:
      nAtoms - a int.
      nSymm - a int.
      rowRegion - a RowRegion object.
  • Method Details

    • checkList

      public boolean checkList(int[][][] zAtListBuild, int buff)
      Check if the list is valid for the given zAtListBuild and buff.
      Parameters:
      zAtListBuild - the list of zAtListBuild.
      buff - the buffer size.
      Returns:
      true if the list is valid, false otherwise.
    • gridDensity

      public abstract void gridDensity(int iSymm, int iAtom, int lb, int ub)
      Apply electron density "as normal" for an atom, but check that the y and z indeces are within the supplied bounds (inclusive).
      Parameters:
      iSymm - the SymOp to apply.
      iAtom - the index of the Atom to put onto the grid.
      lb - the lower bound for the y and z-axes.
      ub - the upper bound for the y and z-axes.
    • run

      public void run(int lb, int ub) throws Exception
      Execute one chunk of iterations of this parallel for loop. The run() method must perform the loop body for indexes first through last inclusive, increasing the loop index by +1 after each iteration.

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

      Specified by:
      run in class IntegerForLoop
      Parameters:
      lb - First loop index.
      ub - Last loop index.
      Throws:
      Exception - The run() method may throw any exception.
      Exception - if any.
    • saveZYValues

      public void saveZYValues(int[][][] zAtListBuild)
      saveZYValues.
      Parameters:
      zAtListBuild - the list of zAtListBuild.
    • setNsymm

      public void setNsymm(int nSymm)
      setNsymm
      Parameters:
      nSymm - a int.