Package ffx.potential.nonbonded.octree
Class Octree
java.lang.Object
ffx.potential.nonbonded.octree.Octree
Octree method presented in the Fast Multipole Method (FMM) tutorial from the Barba Group:
https://github.com/barbagroup/FMM_tutorial
-
Constructor Summary
ConstructorsConstructorDescriptionOctree(int nCritical, ArrayList<OctreeParticle> particles) Constructor allowing the specification of nCritical, default theta valueOctree(int nCritical, ArrayList<OctreeParticle> particles, double theta) Constructor allowing the specification of nCritical and thetaOctree(ArrayList<OctreeParticle> particles) Default constructor: only need to pass in a list of particles nCritical and theta set to defaults -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(int octant, int p) Add a child.voidbuildTree(OctreeCell root) Build the tree.voidDirect summation.doubledistance(double[] array, OctreePoint point) Compute a distance between a position and the OctreePoint.voidEvaluate potential at all target pointsvoidl2Error(double[] phiDirect, double[] phiTree) Compute the L2 error.voidUpdate sweep.
-
Constructor Details
-
Octree
Default constructor: only need to pass in a list of particles nCritical and theta set to defaults- Parameters:
particles- ArrayList of type OctreeParticles of all particles to be used in tree
-
Octree
Constructor allowing the specification of nCritical, default theta value- Parameters:
nCritical- Critical number of particles; cells must split when they reach nCriticalparticles- ArrayList of type OctreeParticles of all particles to be used in tree
-
Octree
Constructor allowing the specification of nCritical and theta- Parameters:
nCritical- Critical number of particles; cells must split when they reach nCriticalparticles- ArrayList of type OctreeParticles of all particles to be used in treetheta- Specifies near field vs far field
-
-
Method Details
-
addChild
public void addChild(int octant, int p) Add a child.- Parameters:
octant- The octant.p- Cell index p.
-
buildTree
Build the tree.- Parameters:
root- The Octree root cell.
-
directSum
public void directSum()Direct summation. -
distance
Compute a distance between a position and the OctreePoint.- Parameters:
array- Position.point- OctreePoint.- Returns:
- Returns the distance.
-
evalPotnetial
public void evalPotnetial()Evaluate potential at all target points -
l2Error
public void l2Error(double[] phiDirect, double[] phiTree) Compute the L2 error.- Parameters:
phiDirect- Potential from direct summation.phiTree- Potential from the tree.
-
upwardSweep
public void upwardSweep()Update sweep.
-