I need an efficient piece of code that would do the following:
given a correlation function or a power spectrum distribute N points in a box so that their distribution corresponds to a gaussian field which is a possible realisation of the given the power spectrum.
This problem must have been solved thousands of years ago for setting up the initial conditions for N-body simulations. So, could someone tell me where to look / what to download.
a piece of code
-
- Posts: 183
- Joined: September 24 2004
- Affiliation: Brookhaven National Laboratory
- Contact:
-
- Posts: 49
- Joined: December 17 2004
- Affiliation: Perimeter Institute/ University of Waterloo
- Contact:
-
- Posts: 183
- Joined: September 24 2004
- Affiliation: Brookhaven National Laboratory
- Contact:
Re: a piece of code
Thanks. I remember seeing that paper, but completelly forgot about it... Anyway, I find the ic flowcharts (http://www.astro.princeton.edu/~esirko/ ... chart.html) quite amusing, a bit Dexter's lab like... (no offence, please, I trust code is superb.)