18#error NGENIC requires PERIODIC
23#ifdef DOUBLEPRECISION_FFTW
24typedef double fft_real;
25typedef fftw_complex fft_complex;
27typedef float fft_real;
28typedef fftwf_complex fft_complex;
31#include "../data/simparticles.h"
32#include "../pm/pm_mpi_fft.h"
43 void ngenic_displace_particles(
void);
45 void create_grid(
void);
48 double ngenic_power_spec(
double k);
49 double ngenic_f1_omega(
double a);
50 double ngenic_f2_omega(
double a);
51 double ngenic_growth_factor(
double astart,
double aend);
52 void ngenic_initialize_powerspectrum(
void);
53 void free_power_table(
void);
57 unsigned int *seedtable;
66 partbuf *partin, *partout;
68 size_t nimport, nexport;
70 size_t *Sndpm_count, *Sndpm_offset;
71 size_t *Rcvpm_count, *Rcvpm_offset;
73 gsl_rng *rnd_generator;
74 gsl_rng *rnd_generator_conjugate;
83 void ngenic_distribute_particles();
84 void ngenic_setup_modes_in_kspace(fft_complex *fft_of_grid);
85 void ngenic_readout_disp(fft_real *grid,
int axis,
double pfac,
double vfac);
86 void ngenic_initialize_ffts(
void);
87 void ngenic_get_derivate_from_fourier_field(
int axes1,
int axes2, fft_complex *fft_of_grid);
88 void ngenic_compute_transform_of_source_potential(fft_real *pot);
89 void print_spec(
void);
102 bool operator<(
const pow_table &other)
const {
return logk < other.logk; }
104 pow_table *PowerTable;
106 double ngenic_powerspec_tabulated(
double k);
107 double ngenic_powerspec_efstathiou(
double k);
108 double ngenic_powerspec_eh(
double k);
109 double ngenic_tophat_sigma2(
double R);
110 double ngenic_tk_eh(
double k);
111 double ngenic_growth(
double a);
112 void read_power_table(
void);
114 static double ngenic_growth_int(
double a,
void *param)
119 double fnl(
double x,
double A,
double B,
double alpha,
double beta,
double V,
double gf)
121 return x *
pow((1 + B * beta * x +
pow(A * x, alpha * beta)) / (1 +
pow(
pow(A * x, alpha) * gf * gf * gf / (V *
sqrt(x)), beta)),
131 static double sigma2_int(
double lnk,
void *param)
133 myparams *par = (myparams *)param;
134 double r_tophat = par->R;
137 double kr = r_tophat * k;
138 double kr2 = kr * kr;
139 double kr3 = kr2 * kr;
144 double w = 3 * (
sin(kr) / kr3 -
cos(kr) / kr2);
145 double x = 4 *
M_PI * k * k * w * w * par->obj->ngenic_power_spec(k);
global_data_all_processes All
bool operator<(const location &left, const location &right)
expr pow(half base, half exp)