sandbox/acastillo/input_fields/tests_init_fft/test_init_fft2.c
Testing
initial_conditions_dimonte_fft2.h
In this example we initialize a scalar field f
using an
annular spectrum with amplitude 1 and wavenumbers between k_{min}=25 and k_{max}=75. In this case, we use
isvof=1
. The result should look like this:

#include "view.h"
#include "acastillo/input_fields/initial_conditions_dimonte_fft2.h"
#define r2 (sq(x) + sq(y))
int main()
{
= 2*pi;
L0 = Y0 = Z0 = -L0 / 2;
X0 = 1 << 6;
N (N);
init_grid
#if TREE
refine(((r2 < sq(1.50)) && (r2 > sq(0.5))) && level < 9);
#endif
scalar f[];
{
vertex scalar phi[];
(phi, 1, kmin = 25, kmax = 75, isvof=1);
initial_condition_dimonte_fft2fractions(phi, f);
}
stats s = statsf (f);
fprintf (stderr, "# %f %.12f %g %g %g %g\n", t, s.sum, s.min, s.max, s.stddev, s.volume);
box();
squares("f", linear = false);
save("test_init_fft2.png");
}