Skip to content
Projects

Reference tree

The equations of tree_d_3d.reference, declared on the code that implements them and checked by the tests.

ReferenceQuadtree

classsource

Bounded-depth quadtree with signed moments through quadrupole order.

insert
a leaf splits when an insertion would exceed Nleaf (below dmax);Q,p,S+=q, qd, q ddT on the way down\text{a leaf splits when an insertion would exceed } N_\mathrm{leaf} \text{ (below } d_\mathrm{max}\text{)}; \quad Q, \mathbf p, \mathsf S \mathrel{+}= q, \ q\mathbf d, \ q\,\mathbf d\mathbf d^{\mathsf T} \text{ on the way down}
multipole
ϕ+=Qρ+p⋅Rρ3+12(3 RTSRρ5−tr⁡Sρ3)if r∉cell and 2h<θD\phi \mathrel{+}= \frac{Q}{\rho} + \frac{\mathbf p\cdot\mathbf R}{\rho^3} + \frac12\left(\frac{3\,\mathbf R^{\mathsf T}\mathsf S\mathbf R}{\rho^5} - \frac{\operatorname{tr}\mathsf S}{\rho^3}\right) \quad \text{if } \mathbf r \notin \text{cell and } 2h < \theta D
Assumes
  • one particle at a time, recursively in Python: the same tree, moments and opening rule as FlatQuadtree and its Coulomb walk, kept for inspection and tests
  • an exclude body away from the probe point makes the sum exact (θ=0\theta = 0)