22 param_declare_double(ps,
"OmegaBaryon",
REQUIRED, 0.0464,
"Omega Baryon: note this may be used for transfer functions even if gas is not produced.");
30 param_declare_int(ps,
"NgridGas",
OPTIONAL, -1,
"Size of regular grid on which the undisplaced gas particles are created.");
32 param_declare_int(ps,
"Seed",
REQUIRED, 0,
"Random number generator seed used for the phases of the Gaussian random field.");
36 param_declare_int(ps,
"UnitaryAmplitude",
OPTIONAL, 1,
"If 0, each Fourier mode in the initial power spectrum is scattered. If 1 each Fourier mode is not scattered and we generate unitary gaussians for the initial phases.");
48 param_declare_int(ps,
"DifferentTransferFunctions",
OPTIONAL, 1,
"Use species specific transfer functions for baryon and CDM.");
49 param_declare_int(ps,
"ScaleDepVelocity",
OPTIONAL, -1,
"Use scale dependent velocity transfer functions instead of the scale-independent Zel'dovich approximation. Enabled by default iff DifferentTransferFunctions = 1");
50 param_declare_string(ps,
"FileWithTransferFunction",
OPTIONAL,
"",
"File containing CLASS formatted transfer functions with extra metric transfer functions=y.");
54 param_declare_int(ps,
"UsePeculiarVelocity",
OPTIONAL, 1,
"Snapshots will save peculiar velocities to the Velocity field. If 0, then v/sqrt(a) will be used in the ICs to match Gadget-2, but snapshots will save v * a.");
60 param_declare_double(ps,
"PrimordialAmp",
OPTIONAL, 2.215e-9,
"Ignored, but used by external CLASS script to set powr spectrum amplitude.");
62 param_declare_double(ps,
"InputPowerRedshift",
OPTIONAL, -1,
"Redshift at which the input power is. Power spectrum will be rescaled to the initial redshift. Negative disables rescaling.");
64 param_declare_double(ps,
"PrimordialRunning",
OPTIONAL, 0,
"Running of the spectral index, ignored for tabulated input, only used to pass parameter to tools/make_class_power.py");
70 param_declare_int(ps,
"NumPartPerFile",
OPTIONAL, 1024 * 1024 * 128,
"Number of particles per striped bigfile. Internal implementation detail.");
83 endrun(0,
"Parsing %s failed. \n", fname);
86 endrun(0,
"Validation of %s failed.\n", fname);
89 message(0,
"----------- Running with Parameters ----------\n");
91 MPI_Comm_rank(MPI_COMM_WORLD, &
ThisTask);
95 message(0,
"----------------------------------------------\n");
107 endrun(0,
"Cannot have OmegaLambda and Omega_fld (evolving dark energy) at the same time!\n");
115 if(*MaxMemSizePerNode <= 1) {
183 int64_t NumPartPerFile =
param_get_int(ps,
"NumPartPerFile");
185 int64_t Ngrid = GenicConfig->
Ngrid;
186 if(Ngrid < GenicConfig->NgridGas)
188 GenicConfig->
NumFiles = ( Ngrid*Ngrid*Ngrid + NumPartPerFile - 1) / NumPartPerFile;
192 message(0,
"WARNING: Using different transfer functions but also rescaling power to account for linear growth. NOT what you want!\n");
195 endrun(0,
"For massive neutrinos, different transfer functions, or scale dependent growth functions you must specify a transfer function file\n");
197 endrun(0,
"You want massive neutrinos but no background radiation: this will give an inconsistent cosmology.\n");
199 if(GenicConfig->
Nmesh == 0) {
200 GenicConfig->
Nmesh = 2*Ngrid;
203 GenicConfig->
TimeIC = 1 / (1 + Redshift);
void message(int where, const char *fmt,...)
void endrun(int where, const char *fmt,...)
static ParameterSet * create_parameters(void)
void read_parameterfile(char *fname, struct genic_config *GenicConfig, int *ShowBacktrace, double *MaxMemSizePerNode, Cosmology *CP)
double param_get_double(ParameterSet *ps, const char *name)
void param_get_string2(ParameterSet *ps, const char *name, char *dst, size_t len)
void param_declare_double(ParameterSet *ps, const char *name, const enum ParameterFlag required, const double defvalue, const char *help)
void param_declare_int(ParameterSet *ps, const char *name, const enum ParameterFlag required, const int defvalue, const char *help)
int param_parse_file(ParameterSet *ps, const char *filename)
int param_get_int(ParameterSet *ps, const char *name)
void param_declare_string(ParameterSet *ps, const char *name, const enum ParameterFlag required, const char *defvalue, const char *help)
void param_dump(ParameterSet *ps, FILE *stream)
char * param_get_string(ParameterSet *ps, const char *name)
int param_validate(ParameterSet *ps)
ParameterSet * parameter_set_new()
double UnitVelocity_in_cm_per_s
struct power_params PowerP
char * FileWithTransferFunction
int DifferentTransferFunctions
char * FileWithInputSpectrum
double InputPowerRedshift
double get_physmem_bytes(void)