Class SliceLoop


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

1) Multipoles using B-splines or

2) Diffraction form factors.

Each "slice" of the grid (i.e. a fixed value of the z-coordinate) is operated on by only a single thread to logically enforce atomic updates of grid magnitudes.

Author:
Armin Avdic
  • Field Details

  • Constructor Details

    • SliceLoop

      public SliceLoop(int nAtoms, int nSymm, SliceRegion sliceRegion)
      Constructor for SliceLoop.
      Parameters:
      nAtoms - a int.
      nSymm - a int.
      sliceRegion - a SliceRegion object.
  • Method Details

    • checkList

      public boolean checkList(int[][] zAtListBuild, int buff)
      checkList.
      Parameters:
      zAtListBuild - an array of
      invalid reference
      int
      objects.
      buff - a int.
      Returns:
      a boolean.
    • 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 z index is 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 along the z-axis.
      ub - the upper bound along the z-axis.
    • 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.
    • saveZValues

      public void saveZValues(int[][] zAtListBuild)
      saveZValues.
      Parameters:
      zAtListBuild - an array of
      invalid reference
      int
      objects.
    • setNsymm

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