MP-Gadget  5.0.1.dev1-76bc7d4726-dirty
power.h
Go to the documentation of this file.
1 #ifndef GENIC_POWER_H
2 #define GENIC_POWER_H
3 
4 #include <libgadget/cosmology.h>
5 #include <bigfile-mpi.h>
6 
8 {
14  double Sigma8;
18 };
19 
20 /*A note on gauge choice:
21  * We run Gadget in N-body gauge (Fidler et al 2015) arxiv:1505.04756.
22  * See also (Valkenburg & Villaescusa-Navarro 2016) arxiv:1610.08501, which includes
23  * an N-body IC code.
24  *
25  * In this gauge, as long as there is zero anisotropic stress (true if omega_r = 0)
26  * the equations of motion are the Newtonian equations and the density is the
27  * comoving synchronous gauge density. Roughly speaking one is choosing a spatial gauge
28  * comoves with the large-scale radiation perturbation, making them zero.
29  *
30  * The velocities for this gauge can be obtained by using the synchronous gauge
31  * velocity transfer functions, or by differentiating density transfer functions.
32  * Note that on super-horizon scales this is not the same as the
33  * longitudinal gauge velocity!
34  *
35  * There is a residual error from the gradient of the radiation perturbations, which peaks
36  * at k = 0.002 h/Mpc at 2% for z_ic = 100. It is larger at higher redshift.
37  */
38 
39 /*Symbolic constants for the possible types transfer function types*/
41 {
42  DELTA_BAR = 0,
43  DELTA_CDM = 1,
44  DELTA_NU = 2,
45  DELTA_CB = 3,
46  VEL_BAR = 4,
47  VEL_CDM = 5,
48  VEL_NU = 6,
49  VEL_CB = 7,
50  VEL_TOT = 8,
51  /*Always unity, so there is no memory for it*/
52  DELTA_TOT = 9,
53 };
54 
55 /* delta (square root of power spectrum) at current redshift.
56  * Type == 0 is Gas, Type == 1 is DM, Type == 2 is neutrinos, Type == 3 is CDM + baryons (as in the enum)
57  * Other types are total power. */
58 double DeltaSpec(double kmag, enum TransferType Type);
59 /* Scale-dependent derivative of the growth function,
60  * computed by differentiating the provided transfer functions. */
61 double dlogGrowth(double kmag, enum TransferType Type);
62 /* Read power spectrum and transfer function tables from disk, set up growth factors, init cosmology. */
63 int init_powerspectrum(int ThisTask, double InitTime, double UnitLength_in_cm_in, Cosmology * CPin, struct power_params * ppar);
64 
65 /*Save the transfer function tables and matter power spectrum to the IC bigfile*/
66 void save_all_transfer_tables(BigFile * bf, int ThisTask);
67 
68 #endif
double DeltaSpec(double kmag, enum TransferType Type)
Definition: power.c:52
int init_powerspectrum(int ThisTask, double InitTime, double UnitLength_in_cm_in, Cosmology *CPin, struct power_params *ppar)
Definition: power.c:394
double dlogGrowth(double kmag, enum TransferType Type)
Definition: power.c:101
void save_all_transfer_tables(BigFile *bf, int ThisTask)
Definition: power.c:150
TransferType
Definition: power.h:41
@ DELTA_CB
Definition: power.h:45
@ DELTA_BAR
Definition: power.h:42
@ DELTA_TOT
Definition: power.h:52
@ VEL_TOT
Definition: power.h:50
@ VEL_BAR
Definition: power.h:46
@ VEL_CB
Definition: power.h:49
@ DELTA_CDM
Definition: power.h:43
@ VEL_CDM
Definition: power.h:47
@ DELTA_NU
Definition: power.h:44
@ VEL_NU
Definition: power.h:48
int ScaleDepVelocity
Definition: power.h:11
char * FileWithTransferFunction
Definition: power.h:12
int DifferentTransferFunctions
Definition: power.h:10
double PrimordialIndex
Definition: power.h:16
int WhichSpectrum
Definition: power.h:9
double Sigma8
Definition: power.h:14
char * FileWithInputSpectrum
Definition: power.h:13
double InputPowerRedshift
Definition: power.h:15
double PrimordialRunning
Definition: power.h:17
int ThisTask
Definition: test_exchange.c:23