Multilevel adaptive particle mesh (MLAPM): a c code for cosmological simulations
Abstract
We present a computer code written in c that is designed to simulate structure formation from collisionless matter. The code is purely gridbased and uses a recursively refined Cartesian grid to solve Poisson's equation for the potential, rather than obtaining the potential from a Green's function. Refinements can have arbitrary shapes and in practice closely follow the complex morphology of the density field that evolves. The timestep shortens by a factor of 2 with each successive refinement. Competing approaches to Nbody simulation are discussed from the point of view of the basic theory of Nbody simulation. It is argued that an appropriate choice of softening length ∊ is of great importance and that ∊ should be at all points an appropriate multiple of the local interparticle separation. Unlike tree and P^{3}M codes, multigrid codes automatically satisfy this requirement. We show that at early times and low densities in cosmological simulations, ∊ needs to be significantly smaller relative to the interparticle separation than in virialized regions. Tests of the ability of the code's Poisson solver to recover the gravitational fields of both virialized haloes and Zel'dovich waves are presented, as are tests of the code's ability to reproduce analytic solutions for planewave evolution. The times required to conduct a ΛCDM cosmological simulation for various configurations are compared with the times required to complete the same simulation with the ART, AP^{3}M and GADGET codes. The power spectra, halo mass functions and halohalo correlation functions of simulations conducted with different codes are compared. The code is available from http://wwwthphys.physics.ox.ac.uk/users/MLAPM.
 Publication:

Monthly Notices of the Royal Astronomical Society
 Pub Date:
 August 2001
 DOI:
 10.1046/j.13658711.2001.04532.x
 arXiv:
 arXiv:astroph/0103503
 Bibcode:
 2001MNRAS.325..845K
 Keywords:

 METHODS: NUMERICAL;
 GALAXIES: FORMATION;
 COSMOLOGY: THEORY;
 Astrophysics
 EPrint:
 20 pages, 20 figures, MNRAS in press, the code can be downloaded at http://wwwthphys.physics.ox.ac.uk/users/MLAPM/