MP-Gadget  5.0.1.dev1-76bc7d4726-dirty
cosmology.h
Go to the documentation of this file.
1 #ifndef COSMOLOGY_H
2 #define COSMOLOGY_H
3 
4 #include <stddef.h>
5 #include "omega_nu_single.h"
6 #include "utils/unitsystem.h"
7 
8 typedef struct {
9  double CMBTemperature;
10  double Omega0; /* matter density in units of the critical density (at z=0) */
11  double OmegaCDM; /* CDM density, derived from Omega0 and OmegaBaryon */
12  double OmegaG; /* Photon density, derived from T_CMB0 */
13  double OmegaK; /* Curvature density, derived from Omega0 and OmegaLambda */
14  double OmegaLambda; /* vacuum energy density relative to crictical density (at z=0) */
15  double Omega_fld; /*Energy density of dark energy fluid at z=0*/
16  double w0_fld; /*Dark energy equation of state parameter*/
17  double wa_fld; /*Dark energy equation of state evolution parameter*/
18  double Omega_ur; /*Extra radiation density: either a sterile neutrino or other dark radiation*/
19  double OmegaBaryon; /* baryon density in units of the critical density (at z=0) */
20  double HubbleParam; /* little `h', i.e. Hubble constant in units of 100 km/s/Mpc. */
21  double Hubble; /* 100 km/s/Mpc in internal units*/
22  double UnitTime_in_s; /* Internal unit time in seconds*/
23  int RadiationOn; /* flags whether to include the radiation density in the background */
24  _omega_nu ONu; /*Structure for storing massive neutrino densities*/
25  double MNu[3]; /*Neutrino masses in eV*/
26  int MassiveNuLinRespOn; /* Flags that massive neutrinos using the linear
27  response code of Ali-Haimoud & Bird 2013.*/
28  int HybridNeutrinosOn; /* Flags that hybrid neutrinos are enabled */
29  double HybridVcrit; /* Critical velocity switching between particle
30  and analytic solvers when hybrid neutrinos are on*/
32  double GravInternal;
33 } Cosmology;
34 
35 typedef struct {
36  size_t bytesize;
37  double normfactor;
38  size_t size;
39  struct {
40  double k;
41  double Pk;
42  } table[];
43 } FunctionOfK;
44 
45 void function_of_k_normalize_sigma(FunctionOfK * fk, double R, double sigma);
46 
47 double function_of_k_eval(FunctionOfK * fk, double k);
48 double function_of_k_tophat_sigma(FunctionOfK * fk, double R);
49 
50 /*Hubble function at scale factor a, in dimensions of CP.Hubble*/
51 double hubble_function(const Cosmology * CP, double a);
52 /* Linear theory growth factor between astart and aend. */
53 double GrowthFactor(Cosmology * CP, double astart, double aend);
54 /*Note this is only used in GenIC*/
55 double F_Omega(Cosmology * CP, double a);
56 /* Returns 1 if the neutrino particles are 'tracers', not actively gravitating,
57  * and 0 if they are actively gravitating particles.*/
58 int hybrid_nu_tracer(const Cosmology * CP, double atime);
59 
60 /*Initialise the derived parts of the cosmology*/
61 void init_cosmology(Cosmology *CP, double TimeBegin, const struct UnitSystem units);
62 
63 /* Check and print properties of the derived cosmology */
64 void check_units(const Cosmology * CP, const struct UnitSystem units);
65 
66 #endif
double function_of_k_eval(FunctionOfK *fk, double k)
Definition: cosmology.c:191
void check_units(const Cosmology *CP, const struct UnitSystem units)
Definition: cosmology.c:260
void function_of_k_normalize_sigma(FunctionOfK *fk, double R, double sigma)
Definition: cosmology.c:249
double GrowthFactor(Cosmology *CP, double astart, double aend)
Definition: cosmology.c:82
void init_cosmology(Cosmology *CP, double TimeBegin, const struct UnitSystem units)
Definition: cosmology.c:15
int hybrid_nu_tracer(const Cosmology *CP, double atime)
Definition: cosmology.c:53
double hubble_function(const Cosmology *CP, double a)
Definition: cosmology.c:58
double function_of_k_tophat_sigma(FunctionOfK *fk, double R)
Definition: cosmology.c:233
double F_Omega(Cosmology *CP, double a)
Definition: cosmology.c:148
double sigma[3]
Definition: densitykernel.c:97
static Cosmology * CP
Definition: power.c:27
double GravInternal
Definition: cosmology.h:32
double wa_fld
Definition: cosmology.h:17
double Omega_ur
Definition: cosmology.h:18
int HybridNeutrinosOn
Definition: cosmology.h:28
double Omega_fld
Definition: cosmology.h:15
double Omega0
Definition: cosmology.h:10
int RadiationOn
Definition: cosmology.h:23
double HubbleParam
Definition: cosmology.h:20
double HybridVcrit
Definition: cosmology.h:29
double CMBTemperature
Definition: cosmology.h:9
double OmegaK
Definition: cosmology.h:13
double OmegaCDM
Definition: cosmology.h:11
double UnitTime_in_s
Definition: cosmology.h:22
double OmegaLambda
Definition: cosmology.h:14
double OmegaBaryon
Definition: cosmology.h:19
double HybridNuPartTime
Definition: cosmology.h:31
int MassiveNuLinRespOn
Definition: cosmology.h:26
double OmegaG
Definition: cosmology.h:12
_omega_nu ONu
Definition: cosmology.h:24
double Hubble
Definition: cosmology.h:21
double w0_fld
Definition: cosmology.h:16
size_t size
Definition: cosmology.h:38
double normfactor
Definition: cosmology.h:37
double k
Definition: cosmology.h:40
double Pk
Definition: cosmology.h:41
size_t bytesize
Definition: cosmology.h:36
Definition: power.c:35