next previous
Up: Parallelized tree-code for clusters


Subsections

   
2 Description of the code

We have adopted the basic algorithm of the tree code described by Barnes & Hut ([1986], [1989]), Hernquist ([1987]), and Barnes ([1995]).

2.1 Computing accelerations

The first step in computing the acceleration of a particle in a tree code is the construction of the tree structure. Following the foregoing authors, we have adopted the octal-tree scheme. The construction itself begins identifying the largest cell (the root) of the tree with a cube containing the entire system of particles. This cell is subdivided into eight equal subcells; these subcells are in turn recursively subdivided into eight cells each, and so on until the ending cells (the leaves) contain either one or none particles.

Next, total masses, center of mass coordinates, critical radii, and quadrupole moments are calculated for each cell by recursively descending the tree. A fundamental aspect in this phase is the use of the so-called "parallel axis theorem" (Hernquist [1987]), which allows the computation of quadrupole moments in a recursive way.

The last step in computing the acceleration of a particle starts traversing the tree from root to leaves. A cell will contribute as a whole to this acceleration if it is far enough from the particle. Otherwise, the cell is discarded and the proccess is repeated with its children. The walk ends when all subdivided cells contain either one or zero particles. To decide whether or not a cell must be subdivided, a multipole acceptance criterion (MAC) is used (Salmon & Warren [1994]). The original MAC (Barnes & Hut [1986]) is based on the aperture angle $\theta$, i.e. the ratio between the size of the cell and its distance from the particle being accelerated: a cell is subdivided whenever $\theta$is greater than certain threshold. We have incorporated in our code the three MACs commonly in use: the original proposed by Barnes & Hut ([1986]), the $b_{\rm max}$ criterion (Salmon & Warren [1994]), and the modified Barnes criterion (Barnes [1994]).

2.2 Time integration

On most tree codes, the second-order symplectic leap-frog algorithm is the common choice for integrating the equations of motion. However, we have also tried other methods, namely symplectic integrators of fourth and sixth order e.g., Kinoshita et al. ([1991]), by integrating an N-body system modelling a King's sphere (King [1966]; Binney & Tremaine [1987]) with N=10000 particles and central relative potential W0=5. No better conservation of the energy nor angular momentum was achieved when using the latter integrators. Moreover, for each integration step, the acceleration had to be computed several more times than with the leap-frog. Thus, no advantage was observed in raising the order of the integrator. In addition, the leap-frog is very simple to code and does not require large amounts of memory, as other methods do.


next previous
Up: Parallelized tree-code for clusters

Copyright The European Southern Observatory (ESO)