Class Octree

java.lang.Object
ffx.potential.nonbonded.octree.Octree

public class Octree extends Object
Octree method presented in the Fast Multipole Method (FMM) tutorial from the Barba Group: https://github.com/barbagroup/FMM_tutorial
  • Constructor Details

    • Octree

      public Octree(ArrayList<OctreeParticle> particles)
      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

      public Octree(int nCritical, ArrayList<OctreeParticle> particles)
      Constructor allowing the specification of nCritical, default theta value
      Parameters:
      nCritical - Critical number of particles; cells must split when they reach nCritical
      particles - ArrayList of type OctreeParticles of all particles to be used in tree
    • Octree

      public Octree(int nCritical, ArrayList<OctreeParticle> particles, double theta)
      Constructor allowing the specification of nCritical and theta
      Parameters:
      nCritical - Critical number of particles; cells must split when they reach nCritical
      particles - ArrayList of type OctreeParticles of all particles to be used in tree
      theta - 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

      public void buildTree(OctreeCell root)
      Build the tree.
      Parameters:
      root - The Octree root cell.
    • directSum

      public void directSum()
      Direct summation.
    • distance

      public double distance(double[] array, OctreePoint point)
      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.