Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
params.cpp
Go to the documentation of this file.
1 
6 #include <omp.h>
7 #include "config.h"
8 #include "params.hpp"
9 #include "core_cmd.h"
10 #include "core_out.h"
11 #include "core_mesh.h"
12 #include "core_power.h"
13 #include <ccl_error.h>
14 #include <json.hpp>
15 #include <iomanip>
16 
18 
19 /*****************************/
22 namespace{
23 
24 // convert to pyccl transfer_function_types keys
25 const std::map<std::string, transfer_function_t> transfer_function_method = {
26  {"emulator", ccl_emulator},
27  {"eisenstein_hu", ccl_eisenstein_hu},
28  {"bbks", ccl_bbks},
29  {"boltzmann_class", ccl_boltzmann_class},
30  {"boltzmann_camb", ccl_boltzmann_camb}
31 };
32 // convert to pyccl matter_power_spectrum_types keys
33 const std::map<std::string, matter_power_spectrum_t> matter_power_spectrum_method = {
34  {"linear", ccl_linear},
35  {"halofit", ccl_halofit},
36  {"halo_model", ccl_halo_model},
37  {"emu", ccl_emu}
38 };
39 // convert to pyccl mass_function_types keys
40 const std::map<std::string, mass_function_t> mass_function_method = {
41  {"tinker", ccl_tinker},
42  {"tinker10", ccl_tinker10},
43  {"watson", ccl_watson},
44  {"angulo", ccl_angulo},
45  {"shethtormen", ccl_shethtormen}
46 };
47 // convert to pyccl baryons_power_spectrum keys
48 const std::map<std::string, baryons_power_spectrum_t> baryons_power_spectrum_method = {
49  {"nobaryons", ccl_nobaryons},
50  {"bcm", ccl_bcm}
51 };
52 
56 template<typename T, typename U>
57 T find_value(const std::map<T, U>& map, const U& value)
58 {
59  for(auto x : map) if (x.second == value) return x.first;
60  throw std::out_of_range("Value not found");
61 }
62 
63 size_t get_seed()
64 {
65  // random seed number
66  size_t seed = (static_cast<long>(rand()) << (sizeof(int) * 8)) | rand();
67 
68  // check for NULL pointer
69  if (char * job_id_str = std::getenv("SBATCH_JOBID"))
70  {
71  // check for succesfull conversion
72  if (long job_id = atol(job_id_str))
73  {
74  seed *= job_id;
75  }
76  }
77  else
78  {
79  BOOST_LOG_TRIVIAL(debug) << "Enviromental variable 'SBATCH_JOBID' was not found.";
80  }
81  return seed;
82 }
83 
84 }
85 
86 /****************************/
90 // interaction with json files
91 void to_json(json& j, const Cosmo_Param& cosmo)
92 {
93  j = json{
94  {"index", cosmo.ns},
95  {"sigma8", cosmo.sigma8},
96  {"smoothing_k", cosmo.k2_G},
97  {"Omega_c", cosmo.Omega_c()},
98  {"Omega_b", cosmo.Omega_b},
99  {"Omega_m", cosmo.Omega_m},
100  {"h", cosmo.h}
101  };
102 
103  j["transfer_function_method"] = find_value(transfer_function_method, cosmo.config.transfer_function_method);
104  j["matter_power_spectrum_method"] = find_value(matter_power_spectrum_method, cosmo.config.matter_power_spectrum_method);
105  j["mass_function_method"] = find_value(mass_function_method, cosmo.config.mass_function_method);
106  j["baryons_power_spectrum_method"] = find_value(baryons_power_spectrum_method, cosmo.config.baryons_power_spectrum_method);
107 }
108 
109 void from_json(const json& j, Cosmo_Param& cosmo)
110 {
111  cosmo.ns = j.at("index").get<FTYPE_t>();
112  cosmo.sigma8 = j.at("sigma8").get<FTYPE_t>();
113  cosmo.k2_G = j.at("smoothing_k").get<FTYPE_t>();
114  cosmo.Omega_b = j.at("Omega_b").get<FTYPE_t>();
115  cosmo.Omega_m = j.at("Omega_m").get<FTYPE_t>();
116  cosmo.h = j.at("h").get<FTYPE_t>();
117  cosmo.H0 = cosmo.h * 100;
118 
119  std::string tmp;
120  try{
121  tmp = j.at("transfer_function_method").get<std::string>();
123  }catch(const json::out_of_range& oor){
125  }
126  try{
127  tmp = j.at("matter_power_spectrum_method").get<std::string>();
129  }catch(const json::out_of_range& oor){
131  }
132  try{
133  tmp = j.at("mass_function_method").get<std::string>();
135  }catch(const json::out_of_range& oor){
137  }
138  try{
139  tmp = j.at("baryons_power_spectrum_method").get<std::string>();
141  }catch(const json::out_of_range& oor){
143  }
144  cosmo.init();
145 }
146 
147 void to_json(json& j, const Box_Opt& box_opt)
148 {
149  j = json{
150  {"mesh_num", box_opt.mesh_num},
151  {"mesh_num_pwr", box_opt.mesh_num_pwr},
152  {"Ng", box_opt.Ng},
153  {"par_num", box_opt.par_num_1d},
154  {"box_size", box_opt.box_size},
155  {"mass_p_log", box_opt.mass_p_log}
156  };
157 }
158 
159 void from_json(const json& j, Box_Opt& box_opt)
160 {
161  box_opt.mesh_num = j.at("mesh_num").get<size_t>();
162  box_opt.mesh_num_pwr = j.at("mesh_num_pwr").get<size_t>();
163  box_opt.par_num_1d = j.at("par_num").get<size_t>();
164  box_opt.box_size = j.at("box_size").get<FTYPE_t>();
165 }
166 
167 void to_json(json& j, const Integ_Opt& integ_opt)
168 {
169  j = json{
170  {"redshift", integ_opt.z_in},
171  {"redshift_0", integ_opt.z_out},
172  {"time_step", integ_opt.db}
173  };
174 }
175 
176 void from_json(const json& j, Integ_Opt& integ_opt)
177 {
178  integ_opt.z_in = j.at("redshift").get<FTYPE_t>();
179  integ_opt.z_out = j.at("redshift_0").get<FTYPE_t>();
180  integ_opt.db = j.at("time_step").get<FTYPE_t>();
181 
182  integ_opt.init();
183 }
184 
185 void to_json(json& j, const App_Opt& app_opt)
186 {
187  j = json{
188  {"viscosity", app_opt.nu_dim},
189  {"cut_radius", app_opt.rs}
190  };
191 }
192 
193 void from_json(const json& j, App_Opt& app_op)
194 {
195  app_op.nu_dim = j.at("viscosity").get<FTYPE_t>();
196  app_op.nu = app_op.nu_dim;
197  app_op.rs = j.at("cut_radius").get<FTYPE_t>();
198 }
199 
200 void to_json(json& j, const Run_Opt& run_opt)
201 {
202  j = json{
203  {"num_thread", run_opt.nt},
204  {"seed", run_opt.seed},
205  {"phase", run_opt.phase},
206  {"version", PROJECT_VERSION}
207  };
208 }
209 
210 void from_json(const json& j, Run_Opt& run_opt)
211 {
212  run_opt.nt = j.at("num_thread").get<size_t>();
213  run_opt.seed = j.at("seed").get<size_t>();
214  run_opt.phase = j.at("phase").get<bool>();
215  run_opt.init();
216 }
217 
218 void to_json(json& j, const Out_Opt& out_opt)
219 {
220  j = json{
221  {"bins_per_decade", out_opt.bins_per_decade},
222  {"points_per_10_Mpc", out_opt.points_per_10_Mpc},
223  {"out_dir", out_opt.out_dir}
224  };
225 }
226 
227 void from_json(const json& j, Out_Opt& out_opt)
228 {
229  out_opt.bins_per_decade = j.at("bins_per_decade").get<size_t>();
230  out_opt.points_per_10_Mpc = j.at("points_per_10_Mpc").get<size_t>();
231  out_opt.out_dir = j.at("out_dir").get<std::string>();
232 }
233 
234 void to_json(json& j, const Chi_Opt& chi_opt)
235 {
236  j = json{
237  {"beta", chi_opt.beta},
238  {"n", chi_opt.n},
239  {"phi", chi_opt.phi},
240  {"linear", chi_opt.linear},
241  };
242 }
243 
244 void from_json(const json& j, Chi_Opt& chi_opt)
245 {
246  chi_opt.beta = j.at("beta").get<FTYPE_t>();
247  chi_opt.n = j.at("n").get<FTYPE_t>();
248  chi_opt.phi = j.at("phi").get<FTYPE_t>();
249 
250  // optional parameters (old runs do not have everything)
251  try {chi_opt.linear = j.at("linear").get<bool>();}
252  catch (const json::out_of_range& oor){chi_opt.linear = false;}
253 }
254 
255 void to_json(json& j, const Test_Opt& test_opt)
256 {
257  j = json{
258  {"R_sphere", test_opt.R_sphere},
259  {"rho_sphere", test_opt.rho_sphere},
260  {"N_grid", test_opt.N_grid},
261  {"N_min", test_opt.N_min},
262  {"rho_b", test_opt.rho_b}
263  };
264 }
265 
266 void from_json(const json& j, Test_Opt& test_opt)
267 {
268  test_opt.R_sphere = j.at("R_sphere").get<FTYPE_t>();
269  test_opt.rho_sphere = j.at("rho_sphere").get<FTYPE_t>();
270  test_opt.N_grid = j.at("N_grid").get<size_t>();
271  test_opt.N_min = j.at("N_min").get<size_t>();
272  test_opt.rho_b = j.at("rho_b").get<FTYPE_t>();
273 }
274 
281  double Omega_c, double Omega_b, double h, double norm_pk, double n_s,
282  ccl_configuration config, int *status)
283 {
284  double Omega_k = 0.0;
285  double Neff = 3.04;
286  double w0 = -1.0;
287  double wa = 0.0;
288  double *mnu;
289  double mnuval = 0.; // a pointer to the variable is not kept past the lifetime of this function
290  mnu = &mnuval;
291  ccl_mnu_convention mnu_type = ccl_mnu_sum;
292 
293  ccl_parameters params = ccl_parameters_create(Omega_c, Omega_b, Omega_k, Neff,
294  mnu, mnu_type, w0, wa, h, norm_pk, n_s, -1, -1, -1, -1, NULL, NULL, status);
295 
296  ccl_cosmology * cosmo = ccl_cosmology_create(params, config);
297  return cosmo;
298 }
299 
301  // cosmo == NULL as indicator of uninitialization
302  // config first initialize to default (in case new configuration options are added)
303  config(default_config), cosmo(NULL) {}
304 
306 {
307  // in case we call iniit once again, free cosmo first
308  if(cosmo)
309  {
311  cosmo = NULL;
312  }
314  h = H0/100;
315 
317  int status = 0;
321  if (status) throw std::runtime_error(cosmo->status_message);
322 
324  D_norm = norm_growth_factor(*this);
325 
327  norm_pwr(*this);
328 }
329 
331 {
332  if(cosmo){
334  cosmo = NULL;
335  }
336 }
337 
338 Cosmo_Param::operator void*() const
339 // GSL accepts only non-const pointers, case when passed const Cosmo_Param&
340 {
341  return const_cast<Cosmo_Param*>(this);
342 }
343 
345 {
346  if(nt == 0) nt = omp_get_max_threads();
347  else omp_set_num_threads(nt);
348  if(nt_fftw == 0) nt_fftw = nt;
349  if (seed == 0){
350  srand(time(NULL));
351  seed = get_seed();
352  } else mlt_runs = 1;
353 }
354 
356 {
357  mlt_runs = 0;
358 }
359 
361 {
362  return (mlt_runs != 0);
363 }
364 
366 {
367  if (!pair || !phase)
368  {
369  mlt_runs--;
370  seed = get_seed();
371  }
372  if (pair) phase = !phase;
373  return mlt_runs;
374 }
375 
377 {
378  Ng = mesh_num / par_num_1d;
379  Ng_pwr = mesh_num_pwr/par_num_1d;
380  par_num = par_num_1d*par_num_1d*par_num_1d;
381  mass_p_log = std::log10(2.78E11*pow(box_size/par_num_1d, 3)*cosmo.Omega_m/cosmo.h);
382 }
383 
385 {
386  a_in = 1/(z_in + 1);
387  a_out = 1/(z_out + 1);
388 }
389 
391 {
392  get_pk_extrap = print_corr|| print_extrap_pwr;
393  get_pwr = get_pk_extrap || print_pwr;
394  get_rho = get_pwr || print_dens;
395 }
396 
398 {
399  ZA = TZA = FF = FP = AA = FP_pp = chi = chi_ff = false;
400 }
401 
403 {
404  return (ZA | TZA | FF | FP | PM | AA | FP_pp | chi | chi_ff);
405 }
406 
407 void App_Opt::init(const Box_Opt& box_opt)
408 {
409  a = rs / FTYPE_t(0.735);
410  M = (int)(box_opt.mesh_num / rs);
411  Hc = FTYPE_t(box_opt.mesh_num) / M;
412  nu_dim = nu;
413  nu /= pow2(box_opt.box_size/box_opt.mesh_num); // converting to dimensionless units
414 }
415 
416 void Other_par::init(const Box_Opt& box_opt)
417 {
418  FTYPE_t tmp = PI/box_opt.box_size;
419 
420  nyquist["analysis"] = tmp*box_opt.mesh_num_pwr;
421  nyquist["potential"] = tmp*box_opt.mesh_num;
422  nyquist["particle"] = tmp*box_opt.par_num_1d;
423  k_print.lower = 2*tmp;
424  k_print.upper = 2*tmp*box_opt.mesh_num_pwr;
425  x_corr.lower = 0.1;
426  x_corr.upper = 200;
427 }
428 
434 Sim_Param::Sim_Param(int ac, const char* const av[])
435 {
436  handle_cmd_line(ac, av, *this);//< throw if anything happend
437  if (this->is_ready())
438  {
439  run_opt.init();
440  cosmo.init();
441  box_opt.init(cosmo);
442  integ_opt.init();
443  out_opt.init();
444  app_opt.init(box_opt);
445  other_par.init(box_opt);
446  }
447 }
448 
449 Sim_Param::Sim_Param(std::string file_name)
450 {
451  try{
452  Ifstream i(file_name);
453  json j;
454  i >> j;
455  try{ run_opt = j.at("run_opt"); } // sim_param.json has run_opt
456  catch(const json::out_of_range& oor){ // stack_info.json does not have run_opt
457  run_opt.nt = 0; // max
458  run_opt.seed = 0; // random
459  run_opt.init();
460  }
461 
462  from_json(j.at("cosmo"), cosmo); //< call explicitly, SWIG has some issues with json.hpp
463  if ("TZA" == j.at("app"))
464  {
465  cosmo.truncated_pk = true;
466  }
467 
468  box_opt = j.at("box_opt");
469  box_opt.init(cosmo);
470 
471  integ_opt = j.at("integ_opt");
472  try{ out_opt = j.at("out_opt"); } // new format of json files
473  catch(const json::out_of_range& oor){ // old format does not store Out_Opt
474  try {out_opt.out_dir = j.at("out_dir"); } // stack_info.json doesn`t store out_dir
475  catch(const json::out_of_range& oor){out_opt.out_dir = "~/home/FASTSIM/output/"; } // do not need it, set to some default
476  out_opt.bins_per_decade = 20;
477  out_opt.points_per_10_Mpc = 10;
478  }
479  app_opt = j.at("app_opt");
480 
481  app_opt.init(box_opt);
482  other_par.init(box_opt);
483 
484  try{
485  chi_opt = j.at("chi_opt");
486  comp_app.chi = (("CHI" == j.at("app")));
487  comp_app.chi_ff = (("CHI_FF" == j.at("app")));
488  } catch(const json::out_of_range& oor){ comp_app.chi = comp_app.chi_ff = false; }
489 
490  }
491  catch(const json::out_of_range& oor){
492  std::string err = std::string(oor.what()) + " in file '" + file_name + "'";
493  throw std::out_of_range(err);
494  }
495 }
496 
497 void Sim_Param::print_info(std::string out, std::string app) const
498 {
499  if (out == "")
500  {
501  BOOST_LOG_TRIVIAL(info) << "\n"
502  "*********************\n"
503  "SIMULATION PARAMETERS\n"
504  "*********************\n"
505  "Ng:\t\t" << box_opt.Ng << "\n"
506  "Num_par:\t" << box_opt.par_num_1d << "^3\n"
507  "Num_mesh:\t" << box_opt.mesh_num << "^3\n"
508  "Num_mesh_pwr:\t" << box_opt.mesh_num_pwr << "^3\n"
509  "Box size:\t" << box_opt.box_size << " Mpc/h\n"
510  "Redshift:\t" << integ_opt.z_in << " ---> " << integ_opt.z_out << "\n"
511  "Pk:\t\t[sigma_8 = " << cosmo.sigma8 << ", ns = " << cosmo.ns << ", k_smooth = " << sqrt(cosmo.k2_G) << "]\n" <<
512  "\t\t[transfer_function_method = " << find_value(transfer_function_method, cosmo.config.transfer_function_method) << "]\n" <<
513  "\t\t[matter_power_spectrum_method = " << find_value(matter_power_spectrum_method, cosmo.config.matter_power_spectrum_method) << "]\n" <<
514  "\t\t[mass_function_method = " << find_value(mass_function_method, cosmo.config.mass_function_method) << "]\n" <<
515  "\t\t[baryons_power_spectrum_method = " << find_value(baryons_power_spectrum_method, cosmo.config.baryons_power_spectrum_method) << "]\n" <<
516  "AA:\t\t[nu = " << app_opt.nu_dim << " (Mpc/h)^2]\n" <<
517  "LL:\t\t[rs = " << app_opt.rs << ", a = " << app_opt.a << ", M = " << app_opt.M << ", Hc = " << app_opt.Hc << "]\n" <<
518  "CHI:\t\t[beta = " << chi_opt.beta << ", n = " << chi_opt.n << ", phi = " << chi_opt.phi << "\n" <<
519  "num_thread:\t << " << run_opt.nt << "\n" <<
520  "Output:\t\t'" << out_opt.out_dir << "'\n";
521  }
522  else
523  {
524  std::string file_name = out + "sim_param.json";
525  std::ofstream o(file_name);
526 
527  json j = {
528  {"box_opt", box_opt},
529  {"integ_opt", integ_opt},
530  {"cosmo", cosmo},
531  {"app_opt", app_opt},
532  {"run_opt", run_opt},
533  {"out_opt", out_opt},
534  {"k_nyquist", other_par.nyquist},
535  {"app", app}
536  };
537  if (comp_app.chi | comp_app.chi_ff) j["chi_opt"] = chi_opt;
538  if (app == "test") j["test_opt"] = test_opt;
539 
540  o << std::setw(2) << j << std::endl;
541  o.close();
542  }
543 }
544 
546 {
547  Sim_Param::print_info("", "");
548 }
549 
551 {
552  run_opt.reset();
553  comp_app.reset();
554 }
555 
557 {
558  bool is_ready = true;
559  is_ready &= run_opt.is_ready();
560  is_ready &= comp_app.is_ready();
561  return is_ready;
562 }
Sim_Param()
Definition: params.hpp:197
double box_size
Definition: params.hpp:59
ccl_cosmology * cosmo
Definition: params.hpp:32
static int rs
Definition: ccl_emu17.c:25
testing options
Definition: params.hpp:146
void print_info() const
Definition: params.cpp:545
functions handling output of the program
void ccl_set_debug_policy(CCLDebugModePolicy debug_policy)
Definition: ccl_error.c:29
void norm_pwr(Cosmo_Param &cosmo)
< end of anonymous namespace (private definitions)
Definition: core_power.cpp:400
static ccl_cosmology * ccl_cosmology_create_flat_lcdm(double Omega_c, double Omega_b, double h, double norm_pk, double n_s, ccl_configuration config, int *status)
Definition: params.cpp:280
#define PROJECT_VERSION
Definition: config.h:4
double h
Definition: params.hpp:36
handle cosmological functions like power spectrum, growth, etc.
chameleon options
Definition: params.hpp:183
a class to store JSON values
Definition: json.hpp:86
bool phase
Definition: params.hpp:138
double D_norm
Definition: params.hpp:44
double nu
Definition: params.hpp:116
matter_power_spectrum_t matter_power_spectrum_method
Definition: ccl_config.h:112
const std::map< std::string, transfer_function_t > transfer_function_method
Definition: params.cpp:25
void to_json(json &j, const Cosmo_Param &cosmo)
< end of anonymous namespace (private definitions)
Definition: params.cpp:91
void init()
Definition: params.cpp:390
size_t mesh_num_pwr
Definition: params.hpp:58
ccl_configuration config
Definition: params.hpp:31
size_t points_per_10_Mpc
Definition: params.hpp:85
double z_in
Definition: params.hpp:72
bool is_ready()
Definition: params.cpp:556
T find_value(const std::map< T, U > &map, const U &value)
Definition: params.cpp:57
T pow2(T base)
Definition: precision.hpp:52
exception indicating access out of the defined range
Definition: json.hpp:1067
double R_sphere
Definition: params.hpp:148
bool linear
Definition: params.hpp:186
reference at(size_type idx)
access specified array element with bounds checking
Definition: json.hpp:15167
run options
Definition: params.hpp:128
double Omega_b
Definition: params.hpp:36
size_t Ng
Definition: params.hpp:61
void reset()
Definition: params.cpp:397
double n
Definition: params.hpp:185
transfer_function_t transfer_function_method
Definition: ccl_config.h:111
const char * what() const noexceptoverride
returns the explanatory string
Definition: json.hpp:817
void reset()
Definition: params.cpp:550
double nu_dim
Definition: params.hpp:118
size_t par_num_1d
Definition: params.hpp:58
double mass_p_log
logarithm of particle mass in
Definition: params.hpp:62
void init(const Box_Opt &)
Definition: params.cpp:407
double rho_sphere
Definition: params.hpp:148
cosmological & CCL parameters
Definition: params.hpp:22
void reset()
Definition: params.cpp:355
basic_json get() const
get special-case overload
Definition: json.hpp:14762
const std::map< std::string, matter_power_spectrum_t > matter_power_spectrum_method
Definition: params.cpp:33
double H0
Definition: params.hpp:36
bool is_ready()
Definition: params.cpp:360
Grid< NDIM, T > sqrt(Grid< NDIM, T > lhs)
Definition: grid.h:231
ccl_cosmology * ccl_cosmology_create(ccl_parameters params, ccl_configuration config)
Definition: ccl_core.c:173
void init()
lazy constructor
Definition: params.cpp:305
void init()
Definition: params.cpp:344
static CCL_BEGIN_DECLS double x[111][8]
ccl_mnu_convention
Definition: ccl_core.h:142
various simulation parameters
const std::map< std::string, baryons_power_spectrum_t > baryons_power_spectrum_method
Definition: params.cpp:48
void ccl_cosmology_free(ccl_cosmology *cosmo)
Definition: ccl_core.c:829
dictionary params
Definition: halomod_bm.py:27
double Omega_c() const
Definition: params.hpp:37
size_t nt
Definition: params.hpp:134
void init()
Definition: params.cpp:384
double z_out
Definition: params.hpp:72
double db
cmd args
Definition: params.hpp:72
constexpr double PI
Definition: precision.hpp:37
baryons_power_spectrum_t baryons_power_spectrum_method
Definition: ccl_config.h:113
double k2_G
Definition: params.hpp:35
approximations options
Definition: params.hpp:113
command line arguments manipulation
void ccl_set_error_policy(CCLErrorPolicy error_policy)
Definition: ccl_error.c:23
integration options
Definition: params.hpp:70
size_t seed
Definition: params.hpp:135
double ns
Definition: params.hpp:35
basic functions to work with mesh
size_t N_grid
Definition: params.hpp:150
size_t bins_per_decade
Definition: params.hpp:85
void from_json(const json &j, Cosmo_Param &cosmo)
Definition: params.cpp:109
mass_function_t mass_function_method
Definition: ccl_config.h:114
const ccl_configuration default_config
Definition: ccl_core.c:21
bool is_ready()
Definition: params.cpp:402
double Omega_m
Definition: params.hpp:36
float pow(float base, unsigned long int exp)
Definition: precision.hpp:39
~Cosmo_Param()
Definition: params.cpp:330
void init(const Box_Opt &)
Definition: params.cpp:416
double phi
Definition: params.hpp:185
double rho_b
Definition: params.hpp:154
size_t mesh_num
Definition: params.hpp:58
std::string out_dir
Definition: params.hpp:86
basic_json<> json
default JSON class
Definition: json.hpp:110
ccl_configuration config
Definition: ccl_core.h:125
auto value(T const &val) -> Generator< T >
Definition: catch.hpp:3177
output options
Definition: params.hpp:82
const std::map< std::string, mass_function_t > mass_function_method
Definition: params.cpp:40
size_t N_min
Definition: params.hpp:150
void init(const Cosmo_Param &cosmo)
Definition: params.cpp:376
bool simulate()
Definition: params.cpp:365
simulation box options
Definition: params.hpp:55
ccl_parameters ccl_parameters_create(double Omega_c, double Omega_b, double Omega_k, double Neff, double *mnu, ccl_mnu_convention mnu_type, double w0, double wa, double h, double norm_pk, double n_s, double bcm_log10Mc, double bcm_etab, double bcm_ks, int nz_mgrowth, double *zarr_mgrowth, double *dfarr_mgrowth, int *status)
Definition: ccl_core.c:294
double beta
Definition: params.hpp:185
double sigma8
Definition: params.hpp:35
void handle_cmd_line(int ac, const char *const av[], Sim_Param &sim)
parse command line arguments
Definition: core_cmd.cpp:24
char status_message[500]
Definition: ccl_core.h:136
double norm_growth_factor(const Cosmo_Param &cosmo)
when computing growth factor outside CCL range we need to normalize the growth factor; ...
Definition: core_power.cpp:408
double rs
Definition: params.hpp:116