CLASSpp Manual
Cosmology reference and developer manual
Loading...
Searching...
No Matches
background_module.h
1#ifndef BACKGROUND_MODULE_H
2#define BACKGROUND_MODULE_H
3
4#include "base_module.h"
5#include "input_module.h"
6
7class BackgroundModule : public BaseModule {
8 public:
13 double GetOmega0Species(const std::string& key) const;
14 BackgroundModule(InputModulePtr input_module);
15 ~BackgroundModule();
16 void background_output_titles(std::string& titles) const;
17 void background_output_data(int number_of_titles, double* data) const;
18 void background_at_tau(
19 double tau, short return_format, short inter_mode, int* last_index, double* pvecback) const;
20 void background_tau_of_z(double z, double* tau) const;
21 void background_w_fld(double a,
22 double* w_fld,
23 double* dw_over_da_fld,
24 double* integral_fld) const;
25 void background_idm_drmd(
26 double a, double rho_idm_over_rho_idr, double* Rint, double* csp2, double* Gint) const;
27
30 double GetOmega0NcdmTot() const;
31
34 int GetNDecayDr() const;
35
40 double GetSpeciesParam(const std::string& key, const std::string& param) const;
41
45
46 int index_bg_a_;
47 int index_bg_H_;
48 int index_bg_H_prime_;
50 /* end of vector in short format, now quantities in normal format */
51
52 int index_bg_rho_tot_;
53 int index_bg_p_tot_;
54 int index_bg_p_tot_prime_;
56 int index_bg_Omega_r_;
58 /* end of vector in normal format, now quantities in long format */
59
60 int index_bg_rho_crit_;
61 int index_bg_Omega_m_;
62 int index_bg_conf_distance_;
63 int index_bg_ang_distance_;
64 int index_bg_lum_distance_;
65 int index_bg_time_;
66 int index_bg_rs_;
68 int index_bg_D_;
69 int index_bg_f_;
71 int bg_size_short_;
72 int bg_size_normal_;
73 int bg_size_;
76 int bt_size_;
77 std::vector<double>
78 tau_table_;
79 std::vector<double>
80 background_table_;
82 double conformal_age_;
83 double
84 Neff_;
85 double a_eq_;
86 double H_eq_;
87 double Omega0_m_;
88 double
89 Omega0_de_;
91 double age_;
92 double Omega0_r_;
93 double z_eq_;
94 double tau_eq_;
95 double Omega0_dcdm_;
96 double Omega0_dr_;
98 double Omega0_idr_drmd_;
99 double Omega0_idm_drmd_;
100 double Omega0_idm_;
101
102 // DRMD diagnostics exposed to the Python wrapper. The data now lives on
103 // IDM_DRMD_IDR_DRMD_Species (#319); these delegate to it (neutral values if
104 // no DRMD species is present).
105 double f_idr_drmd() const;
106 double z_dec_drmd() const;
107
108 private:
109 void background_functions(double* pvecback_B, short return_format, double* pvecback);
110 void background_init();
111 void background_indices();
112 void background_solve_evolver();
113 void background_initial_conditions(double* pvecback, double* pvecback_integration);
114 void background_find_equality();
115 void background_derivs_member(double z, double* y, double* dy, void* parameters_and_workspace);
116 void background_derivs_loga_member(double loga,
117 double* y,
118 double* dy,
119 void* parameters_and_workspace);
120 static void background_derivs_loga(double loga,
121 double* y,
122 double* dy,
123 void* parameters_and_workspace);
124 static void background_timescale(double loga, void* parameters_and_workspace, double* timescale);
125 void background_add_line_to_bg_table_member(
126 double loga, double* y, double* dy, int index_loga, void* parameters_and_workspace);
127 static void background_add_line_to_bg_table(
128 double loga, double* y, double* dy, int index_loga, void* parameters_and_workspace);
129 void background_output_budget();
130 static void background_print_variables(double loga,
131 double* y,
132 double* dy,
133 void* parameters_and_workspace);
134
147
148 int index_bi_a_;
150 int index_bi_time_;
151 int index_bi_rs_;
152 int index_bi_tau_;
153 int index_bi_D_;
154 int index_bi_D_prime_;
156 int bi_B_size_;
157 int bi_size_;
160
164
165 std::vector<double>
166 z_table_;
169
173
174 std::vector<double>
175 d2tau_dz2_table_;
176 std::vector<double>
177 d2background_dtau2_table_;
180};
181
187 background_parameters_and_workspace(BackgroundModule* b_m) : background_module(b_m) {}
188 BackgroundModule* const background_module;
189 double* pvecback;
190};
191
192#endif //BACKGROUND_MODULE_H
Definition background_module.h:186