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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSliceRegion(int gX, int gY, int gZ, double[] grid, int nSymm, int threadCount, Atom[] atoms, double[][][] coordinates) Constructor for SliceRegion. -
Method Summary
Modifier and TypeMethodDescriptionvoidfinish()Perform finalization actions after parallel execution ends.double[]getGrid()Getter for the fieldgrid.intgetNatoms.intgetNsymm()getNsymm.voidrun()Execute parallel code.voidSelect atoms that should be included.voidSetter for the fieldatoms.final voidsetCrystal(Crystal crystal, int gX, int gY, int gZ) Setter for the fieldcrystal.voidsetDensityLoop(SliceLoop[] loops) setDensityLoop.voidsetInitValue(double initValue) Setter for the fieldinitValue.voidstart()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, executeMethods 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- the grid array.nSymm- a int.threadCount- a int.atoms- an array ofAtomobjects.coordinates- the atomic coordinate array.
-
-
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:
finishin classParallelRegion
-
getGrid
public double[] getGrid()Getter for the fieldgrid.- Returns:
- return the grid array.
-
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:
runin 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 ofAtomobjects.
-
setCrystal
Setter for the fieldcrystal.- Parameters:
crystal- aCrystalobject.gX- a int.gY- a int.gZ- a int.
-
setDensityLoop
setDensityLoop.- Parameters:
loops- an array ofSliceLoopobjects.
-
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:
startin classParallelRegion
-