Table of Contents


mkcosmo - create a cosmology cube of equal mass particles


mkcosmo [parameter=value]


From an input cube with given (relative) densities on a regular grid, initial conditions that correspond to the density variations at a given redshift z (use z=0 for non-comoving coordinates) are set based on 3 sweeps of cumulative mass computations along X, Y and Z.

Note that this routine will only work well in the linear regime when the fluctuations are very small, resulting in small perturbations from the central location in a cell. The code will warn when a particle falls outside the cell boundary, but otherwise happily allow that.

It is also possible to generate unequal mass particles, by assigning a single mass in each cell based on the local density, by using densit=t. This could be useful if subsequent forces are used to initialize the velocities in a cosmological setting.

This program is currently under development, features change on an almost daily basis and the manual page can easily be out of sync with the program itself


The following parameters are recognized in any order if the keyword is also given:
Input density (fluctuation) cube. No default
Output file name. No default.
Redshift (for density correction). Only used if given, and if given the growth function is hardcoded as 1/(1+z). z=0 means no change made to densities. Default: not used.
Growth function, by which the densities will be multiplied to get the density. Only used if given. Default: not used.
Additional rhob scaling?
Is map absolute density or relative d(rho)/rho? [t]
Also perturb distances by (gaussian) sigma. This option is normally not used for cosmology. Default: 0
Initial seed [0]
Use density map to make an exact lattice grid (under TEST). Typically one would then compute the forces, followed by setting the initial velocities based on the accellerations (see snap*vel(1NEMO) ). Default: f
Use rejection technique to seed the ’grid’. This will generally result in a very noisy distribution, unsuitable for cosmological initial conditions.
Use this number instead of NX*NY*NZ if rejection is used.
Random verbiage added to output snapshot.


Here’s an example creating 1000 particles from a truely random gaussian field:
ccdmath "" - ’fie=rang(1,0.01)’ size=10,10,10 | mkcosmo - snap1
  ### nemo Debug info: Generating a map from scratch
  ### nemo Debug info: MinMax = 0.969161 1.03211
Note this cube is not centered on 0,0,0 but instead one of the corners coincides with it.

Here is an example of using density based masses:

   mkcosmo ccd0 snap0 density=t ....
   gyrfalcON snap0 snap1 give=mxva hmin=6 tstop=0
   snapvel snap1 snap2 alpha=0.001432 ...


The code assumes in a few places that the cube is really a cube with equal sizes in all 3 dimensions. This is not always checked!

See Also

mkcube(1NEMO) , ccdmath(1NEMO) , snapvel(1NEMO) , image(5NEMO) , snapshot(5NEMO)

grafics and cosmics (Ed Bertschinger’s programs)


src/nbody/init/mkcosmo.c    -- source


Peter Teuben, Ed Shaya, Alan Peel

Update History

1-Nov-06    V0.1 Created    Peter Teuben/Ed Shaya
9-nov-06    V0.5 added rhob=, a=, rejection=, nbody=    PJT
16-nov-06    V0.6 merged PJT and AP version            PJT
17-nov-06    V0.6 added density= to play with        PJT

Table of Contents