A new N-body code which uses the BH tree or FMM as its Poisson solver.
•
A conventional KDK integrator and a Hamiltonian splitting integrator, which, together with FMM, forms a momentum-conserving scheme.
•
Various numerical optimazations in tree construction and horizontal pass in FMM.
Abstract
We present an N-body code called Taichi for galactic dynamics and controlled numerical experiments. The code includes two high-order hierarchical multipole expansion methods: the Barnes-Hut (BH) tree and the fast multipole method (FMM). For the time integration, the code can use either a conventional adaptive KDK or a Hamiltonian splitting integrator. The combination of FMM and the Hamiltonian splitting integrator leads to a momentum-conserving N-body scheme with individual time steps. We find Taichi performs well in the typical applications in galactic dynamics. In the isolated and interacting galaxies tests, the momentum conserving scheme produces the same result as a conventional BH tree code. But for similar force accuracies, FMM significantly speeds up the simulations compared to the monopole BH tree. In the cold collapse test, we find the inner structure after relaxation can be sensitive to the force accuracies. Taichi is ready to incorporate special treatment of close encounters thanks to the Hamiltonian splitting integrator, suitable for studying dynamics around central massive bodies.