inner nodes corresp. to clusters of particles (pseudo particle)
idea: gravity force of particle cluster approximated (sum of masses,
localised in centre of mass)
same can be done for electromagnetic force (sum charges)
Octrees and Quadtrees for Domain Decomposition
clustering of particles required, where size of clusters depends on the distance to each individual particle
solved by multi-level tree-based domain decomposition
to be done for every particles position (in practice via hierarchical domain decomposition)
Octrees and Quadtrees for Domain Decomposition
Octrees and Quadtrees for Domain Decomposition
Octrees and Quadtrees for Domain Decomposition
Octrees and Quadtrees for Domain Decomposition
Octrees and Quadtrees for Domain Decomposition
Barnes-Hut Algorithm
### Create point cloud
- Visualisation by Jeffrey Heer
- https://jheer.github.io/barnes-hut/
### Subdivide domain into quadtree
- distribute long-range region into subdomains: $$ \Omega^{\rm{far}} = \bigcup_i \Omega^{\rm{far}}_i$$
For each particle (position $x\in\Omega$):
- start in root node
- descent into subdomains and subdivide until every domain contains 0 or 1 particles
Add points
### Compute centers of mass or charge
- assign a point $y_0^i$ to each $\Omega^{\rm{far}}_i$ corresponding to the center of mass
- for each subdomain compute total mass by summing particles in that subdomain
- decomposition depending on size of subdomains:
$$ \text{diam} := \sup_{y\in\Omega^{\rm{far}}_i} \|y-y_0^i\| $$
### Force computation
For each particle (position $x\in\Omega$):
- start in root node
- descent into subdomains, until $\theta$-rule satisfied: $$ \frac{diam}{r} \leq \theta,$$
$r$ the distance of pseudo particle from $x$
- accumulate corresp. partial force to current particle
Change theta
</div>
Barnes-Hut: Computation of Forces
Implicit separation of short- and longe-range forces:
short-range: all leaf nodes that are reached (containing 1 particle)
long-range: all inner nodes, where descent is stopped (force caused by pseudo particle)
Barnes-Hut: Accuracy and Complexity
Accuracy of Barnes-Hut:
depends on choice of $\theta$
the smaller $\theta$, the more accurate the long-range forces
the smaller $\theta$, the larger the short-range (i.e., the costs)