Package ffx.potential.nonbonded
Class SliceRegion
java.lang.Object
edu.rit.pj.ParallelConstruct
edu.rit.pj.ParallelRegion
ffx.potential.nonbonded.SliceRegion
- Direct Known Subclasses:
BulkSolventSliceRegion
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 Summary
-
Constructor Summary
ConstructorDescriptionSliceRegion
(int gX, int gY, int gZ, double[] grid, int nSymm, int threadCount, Atom[] atoms, double[][][] coordinates) Constructor for SliceRegion. -
Method Summary
Modifier and TypeMethodDescriptionvoid
finish()
Perform finalization actions after parallel execution ends.double[]
getGrid()
Getter for the fieldgrid
.int
getNatoms.int
getNsymm()
getNsymm.void
run()
Execute parallel code.void
Select atoms that should be included.void
Setter for the fieldatoms
.final void
setCrystal
(Crystal crystal, int gX, int gY, int gZ) Setter for the fieldcrystal
.void
setDensityLoop
(SliceLoop[] loops) setDensityLoop.void
setInitValue
(double initValue) Setter for the fieldinitValue
.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
-
Field Details
-
buff
public int buff -
select
public boolean[][] select -
sliceLoop
-
coordinates
protected double[][][] coordinates
-
-
Constructor Details
-
SliceRegion
public SliceRegion(int gX, int gY, int gZ, double[] grid, int nSymm, int threadCount, Atom[] atoms, double[][][] coordinates) Constructor for SliceRegion.- Parameters:
gX
- a int.gY
- a int.gZ
- a int.grid
- an array ofinvalid reference
double
nSymm
- a int.threadCount
- a int.atoms
- an array ofAtom
objects.coordinates
- an array ofinvalid reference
double
-
-
Method Details
-
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.- Overrides:
finish
in classParallelRegion
-
getGrid
public double[] getGrid()Getter for the fieldgrid
.- Returns:
- an array of
invalid reference
double
-
getNatoms
public int getNatoms()getNatoms.- Returns:
- a int.
-
getNsymm
public int getNsymm()getNsymm.- Returns:
- a int.
-
run
Execute parallel code. All threads of the parallel team call therun()
method concurrently.The
run()
method must be implemented in a subclass.- Specified by:
run
in classParallelRegion
- Throws:
Exception
- Therun()
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
Setter for the fieldatoms
.- Parameters:
atoms
- an array ofAtom
objects.
-
setCrystal
Setter for the fieldcrystal
.- Parameters:
crystal
- aCrystal
object.gX
- a int.gY
- a int.gZ
- a int.
-
setDensityLoop
setDensityLoop.- Parameters:
loops
- an array ofSliceLoop
objects.
-
setInitValue
public void setInitValue(double initValue) Setter for the fieldinitValue
.- Parameters:
initValue
- a double.
-
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.- Overrides:
start
in classParallelRegion
-