1#ifndef THERMODYNAMICS_MODULE_H
2#define THERMODYNAMICS_MODULE_H
6#include "base_module.h"
9class ThermodynamicsModule :
public BaseModule {
11 ThermodynamicsModule(InputModulePtr input_module, BackgroundModulePtr background_module);
12 ~ThermodynamicsModule();
13 void thermodynamics_output_titles(std::string& titles)
const;
14 void thermodynamics_output_data(
int number_of_titles,
double* data)
const;
15 void thermodynamics_at_z(
16 double z,
short inter_mode,
int* last_index,
double* pvecback,
double* pvecthermo)
const;
18 const thermo* GetThermodynamics()
const {
45 tau_idr_free_streaming_;
49 double tau_reionization_;
50 double z_reionization_;
86 int index_th_ddkappa_;
87 int index_th_dddkappa_;
88 int index_th_exp_m_kappa_;
92 int index_th_dmu_idm_dr_;
93 int index_th_ddmu_idm_dr_;
94 int index_th_dddmu_idm_dr_;
95 int index_th_dmu_idr_;
96 int index_th_tau_idm_dr_;
97 int index_th_tau_idr_;
98 int index_th_g_idm_dr_;
99 int index_th_cidm_dr2_;
100 int index_th_Tidm_dr_;
111 void thermodynamics_init();
113 void thermodynamics_helium_from_bbn();
114 void thermodynamics_onthespot_energy_injection(
recombination* preco,
116 double* energy_rate);
117 void thermodynamics_energy_injection(
recombination* preco,
double z,
double* energy_rate);
118 void thermodynamics_reionization_function(
double z,
reionization* preio,
double* xe);
120 void thermodynamics_reionization_sample(
recombination* preco,
123 void thermodynamics_get_xe_before_reionization(
recombination* preco,
double z,
double* xe);
124 void thermodynamics_recombination(
recombination* preco,
double* pvecback);
125 void thermodynamics_recombination_with_hyrec(
recombination* prec,
double* pvecback);
126 void thermodynamics_recombination_with_recfast(
recombination* prec,
double* pvecback);
127 double thermodynamics_recfast_hydrogen_saha_xH(
const recombination* preco,
double z)
const;
128 double thermodynamics_recfast_helium_first_saha_xe(
const recombination* preco,
double z)
const;
129 double thermodynamics_recfast_helium_second_saha_xe(
const recombination* preco,
double z)
const;
130 void thermodynamics_recfast_store_row(
131 recombination* preco,
int sample_index,
double z,
double xe,
double Tb,
double dTbdz)
const;
132 double thermodynamics_recfast_xe_after_helium_ode(
const recombination* preco,
134 const double* y)
const;
135 double thermodynamics_recfast_xe_after_full_ode(
const recombination* preco,
137 const double* y)
const;
138 void thermodynamics_derivs_with_recfast_member(
double z,
141 void* fixed_parameters);
142 static void thermodynamics_derivs_with_recfast(
double z,
145 void* fixed_parameters);
146 static void thermodynamics_recfast_derivs(
double minus_z,
149 void* fixed_parameters);
150 static void thermodynamics_recfast_output(
151 double minus_z,
double y[],
double dy[],
int index_x,
void* parameters_and_workspace);
152 static void thermodynamics_recfast_output_none(
153 double minus_z,
double y[],
double dy[],
int index_x,
void* parameters_and_workspace);
154 static void thermodynamics_recfast_timescale(
double minus_z,
155 void* parameters_and_workspace,
158 void thermodynamics_tanh(
159 double x,
double center,
double before,
double after,
double width,
double* result);
161 BackgroundModulePtr background_module_;
169 thermodynamics_table_;
171 d2thermodynamics_dz2_table_;
175enum class RecfastPhase { analytic, helium, full };
183 ThermodynamicsModule*
const thermodynamics_module;
189 int recfast_output_index_offset = 0;
190 RecfastPhase recfast_phase = RecfastPhase::full;
Definition thermodynamics_module.h:181
Definition thermodynamics.h:181
Definition thermodynamics.h:276
Definition thermodynamics.h:59