Fast multipole method - ProkopHapala/SimpleSimulationEngine GitHub Wiki

https://en.wikipedia.org/wiki/Fast_multipole_method https://en.wikipedia.org/wiki/Multipole_expansion

Due to Gauss law field generated by any density distribution (e.g. point charges) inside a bounding sphere can be expressed as multipole expansion arround the sphere center. Challange is to make the expansion series decay fast to be able to neglect higher multipoles (higher than dipole or quadrupole). This can be done if (1) we are far from bounding sphere (2) if the density distribution is close to spherically symmetric.

scheme

  • we split space to cubic boxes (e.g. regular grid, or more sophisticated Octree) and list points which fall in each box
  • we evaluate center of mass for these points (weighted by charge). (Even though multipole expansion can be done also around the center of the box it is better do it around COG since than the distribution is closer to spherical and multipole series decay faster (dipole is zero?) )
  • we draw a bounding sphere around the points ( if we use cog, or around box if we use box center). The points within the sphere interact with each other directly. The points outside the sphere interact with the multipole expansion. The sphere can be a bit larger than necessary since than the power series decay faster.

problem

  • we can cut higher multipole terms if we go further away, if we are far away we may also group several boxes. But each of this introduce a discontinuity into the interaction. It would be good to find some smooth transition which damp the term before we cut it of.

question

  • how general is multipole expansion? For sure it can be applied on electrostatic potential, and it's derivative (electric field). Does it mean that it works for any spherically symmetric potential or any power of 1/r^n (e.g. LJ) since they can be assumed also as higher derivatives of 1/r. What about vector field like magnetic field ? (http://web.hep.uiuc.edu/home/serrede/P435/Lecture_Notes/P435_Lect_17.pdf)

dev plan

  1. Calculate just interaction of one one point-charge with some cluster of point-charges. Compare with brute-force solution. Try to gradually cut out the expansion terms and see how the interaction energy/force is changing. Try different strategies to smooth out the jumps by smoothly damping the terms before they are cut off.
  2. try to do multi-resolutuon multipole expansion by splitting the cluster in smaller boxes, which are merged only in further distance.
  3. try multipole-multipole interaction