Algorithm Search⌘K

Definitioncore

Multipole acceptance criterion

Also called opening angle criterion.

The rule that lets a tree code use a cell's expansion instead of opening it, such as s/d < theta for cell size s, distance d and opening angle theta.

A multipole acceptance criterion (MAC) is the test that a tree code applies to a cell and a target point to decide whether the multipole expansion of the cell is accurate enough at that point. If the cell is accepted, its expansion gives its whole contribution to the force; if not, the cell is opened and its children are tested. The criterion sets both the accuracy and the cost of the Barnes-Hut algorithm and of related tree codes. The original form compares the angle under which the cell is seen with a fixed opening angle θ\theta.

Definition

Setting. A tree code stores the bodies in a hierarchy of cells, such as an octree. Each cell CC has a size sCs_C (the side of its cube), a geometric center cC\mathbf{c}_C, a total mass MCM_C, a center of mass zC\mathbf{z}_C and the moments of its expansion about zC\mathbf{z}_C. Let x\mathbf{x} be the target point and d=∣x−zC∣d = |\mathbf{x} - \mathbf{z}_C|.

Definition. A multipole acceptance criterion is a predicate MAC(C,x)\mathrm{MAC}(C, \mathbf{x}). The tree walk for the target x\mathbf{x} starts at the root; a cell CC with MAC(C,x)\mathrm{MAC}(C, \mathbf{x}) true contributes its truncated expansion, a leaf with the predicate false contributes its bodies by direct summation, and any other cell with the predicate false is replaced by its children.

The Barnes-Hut criterion. With an opening angle θ>0\theta > 0 (often 0.5 to 1),

MACBH(C,x)  ⟺  sCd<θ.\mathrm{MAC}_{\mathrm{BH}}(C, \mathbf{x}) \iff \frac{s_C}{d} < \theta.

With θ=0\theta = 0 no cell is accepted, and the walk reduces to direct summation.

Common refinements.

  • Offset criterion. Let δC=∣zC−cC∣\delta_C = |\mathbf{z}_C - \mathbf{c}_C| be the distance from the center of mass to the geometric center. Accept if d>sC/θ+δCd > s_C / \theta + \delta_C. This forbids the acceptance of a cell that contains the target or nearly touches it.
  • Error-bound criteria (Salmon and Warren 1994). Let bCb_C be the radius of the smallest ball about zC\mathbf{z}_C that holds all bodies of CC. A truncated expansion of degree pp has an a priori error bound that depends on MCM_C, bCb_C, dd and higher moments of CC. Accept if the bound is below a tolerance Δ\Delta. For the monopole of the potential the bound is GMCbC2d2(d−bC)\frac{G M_C b_C^2}{d^2 (d - b_C)} for d>bCd > b_C (theorem; the proof is in the Barnes-Hut proof file).
  • Relative criterion (Springel 2005). Let ∣aold∣|\mathbf{a}_{\mathrm{old}}| be the acceleration of the target at the previous step and α\alpha a tolerance. Accept if GMCd2(sCd)2≤α∣aold∣\frac{G M_C}{d^2} \left(\frac{s_C}{d}\right)^2 \le \alpha |\mathbf{a}_{\mathrm{old}}|. The quadrupole error of a cell scales as the left side, so the criterion asks for a fixed relative error of the force. GADGET-2 adds a test that opens any cell whose slightly enlarged box contains the target.

Examples and non-examples

Example. A cell of side s=1s = 1 has its center of mass at distance d=2.5d = 2.5 from the target. Then s/d=0.4s / d = 0.4, and the cell is accepted for θ=0.5\theta = 0.5 and opened for θ=0.3\theta = 0.3. If its bodies lie within b=0.6b = 0.6 of the center of mass, the relative error of the monopole potential is at most b2/(d(d−b))=0.36/4.75≈0.076b^2 / (d (d - b)) = 0.36 / 4.75 \approx 0.076 of GM/dG M / d.

Non-example: a target inside the accepted cell. Take the cell [0,1]3[0, 1]^3, with almost all of its mass near the corner (0,0,0)(0, 0, 0), and the target x=(0.95,0.95,0.95)\mathbf{x} = (0.95, 0.95, 0.95) inside the cell. Then d≈0.953≈1.645d \approx 0.95 \sqrt{3} \approx 1.645 and s/d≈0.608<0.7s / d \approx 0.608 < 0.7, so the Barnes-Hut criterion with θ=0.7\theta = 0.7 accepts the cell. If the cell also holds a small mass mm at distance η\eta from the target, its true force Gm/η2G m / \eta^2 is replaced by a part of the monopole, so the error has no bound as η→0\eta \to 0. The same holds for any θ>1/3\theta > 1/\sqrt{3}, because dd can reach 3 s\sqrt{3}\, s inside the cell (theorem). Salmon and Warren (1994) show that this failure of the criterion occurs in realistic mass distributions, not only in constructed ones. The offset criterion opens this cell: δ≈0.866\delta \approx 0.866 and s/θ+δ≈2.29>1.645s / \theta + \delta \approx 2.29 > 1.645.

Non-example: a criterion on the geometric center only. Accepting when ∣x−cC∣>sC/θ|\mathbf{x} - \mathbf{c}_C| > s_C / \theta ignores where the mass is. For θ<2/3\theta < 2/\sqrt{3} it keeps the target outside the cell, because the half diagonal of the cube is 32sC\frac{\sqrt{3}}{2} s_C. But the error bound needs bCb_C, which can be up to 3 sC\sqrt{3}\, s_C when the center of mass is at a corner, so the test does not bound the error by itself.

  • The multipole expansion and the multipole truncation error bound give the error that the criterion controls.
  • In the fast multipole method the analogue is the well-separated condition between two cells, which decides when a multipole-to-local translation is used.
  • In a hashed oct-tree the criterion decides which cells a processor must fetch from other processors.
  • The cost of the walk grows as θ\theta falls, about as θ−3\theta^{-3} for a uniform distribution in three dimensions (heuristic: the number of cells of size ss seen under angle θ\theta in each level is of order θ−3\theta^{-3}).

References

  1. Josh Barnes and Piet Hut, A hierarchical O(N log N) force-calculation algorithm, Nature 324, 1986, 446-449, the opening criterion l/D < theta
  2. John K. Salmon and Michael S. Warren, Skeletons from the treecode closet, Journal of Computational Physics 111(1), 1994, 136-155, the unbounded errors of the Barnes-Hut criterion and the criteria built on error bounds
  3. Volker Springel, The cosmological simulation code GADGET-2, Monthly Notices of the Royal Astronomical Society 364(4), 2005, 1105-1134, Section 3.1.1, Equation (18), the relative opening criterion
  4. Sverre J. Aarseth, Gravitational N-Body Simulations, Tools and Algorithms, Cambridge University Press, 2003, Chapter 6 (tree codes), Section 6.2 (basic formulation)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/CK9WZM/text.yaml