9 #include "../../cosmo_includes.h" 10 #include "../../cosmo_macros.h" 11 #include "../../cosmo_types.h" 12 #include "../../utils/Fourier.h" 15 #define NUM_BARDEEN_VIOLS 17 35 arr_t h11, h12, h13, h22, h23, h33;
36 arr_t dt_h11, dt_h12, dt_h13, dt_h22, dt_h23, dt_h33;
37 arr_t d2t_h11, d2t_h12, d2t_h13, d2t_h22, d2t_h23, d2t_h33;
39 arr_t dt_h01, dt_h02, dt_h03;
42 arr_t dt_g11, dt_g12, dt_g13,
43 dt_g22, dt_g23, dt_g33;
44 arr_t d2t_g11, d2t_g12, d2t_g13,
45 d2t_g22, d2t_g23, d2t_g33;
46 arr_t dt_beta1, dt_beta2, dt_beta3;
47 arr_t dt_phi, d2t_phi;
58 arr_t dt_C1, dt_C2, dt_C3;
62 arr_t D11, D12, D13, D22, D23, D33;
68 arr_t lin_viol, lin_viol_mag, lin_viol_der_mag, lin_viol_der;
77 use_mL_scale_factor =
false;
80 h11.init(NX, NY, NZ); h12.init(NX, NY, NZ); h13.init(NX, NY, NZ);
81 h22.init(NX, NY, NZ); h23.init(NX, NY, NZ); h33.init(NX, NY, NZ);
82 dt_h11.init(NX, NY, NZ); dt_h12.init(NX, NY, NZ); dt_h13.init(NX, NY, NZ);
83 dt_h22.init(NX, NY, NZ); dt_h23.init(NX, NY, NZ); dt_h33.init(NX, NY, NZ);
84 d2t_h11.init(NX, NY, NZ); d2t_h12.init(NX, NY, NZ); d2t_h13.init(NX, NY, NZ);
85 d2t_h22.init(NX, NY, NZ); d2t_h23.init(NX, NY, NZ); d2t_h33.init(NX, NY, NZ);
87 h01.init(NX, NY, NZ); h02.init(NX, NY, NZ); h03.init(NX, NY, NZ);
88 dt_h01.init(NX, NY, NZ); dt_h02.init(NX, NY, NZ); dt_h03.init(NX, NY, NZ);
90 dt_g11.init(NX, NY, NZ); dt_g12.init(NX, NY, NZ); dt_g13.init(NX, NY, NZ);
91 dt_g22.init(NX, NY, NZ); dt_g23.init(NX, NY, NZ); dt_g33.init(NX, NY, NZ);
92 d2t_g11.init(NX, NY, NZ); d2t_g12.init(NX, NY, NZ); d2t_g13.init(NX, NY, NZ);
93 d2t_g22.init(NX, NY, NZ); d2t_g23.init(NX, NY, NZ); d2t_g33.init(NX, NY, NZ);
94 dt_beta1.init(NX, NY, NZ); dt_beta2.init(NX, NY, NZ); dt_beta3.init(NX, NY, NZ);
95 dt_phi.init(NX, NY, NZ); d2t_phi.init(NX, NY, NZ);
97 A.init(NX, NY, NZ); dt_A.init(NX, NY, NZ); d2t_A.init(NX, NY, NZ);
98 B.init(NX, NY, NZ); dt_B.init(NX, NY, NZ); d2t_B.init(NX, NY, NZ);
99 F.init(NX, NY, NZ); dt_F.init(NX, NY, NZ);
102 G1.init(NX, NY, NZ); G2.init(NX, NY, NZ); G3.init(NX, NY, NZ);
103 C1.init(NX, NY, NZ); C2.init(NX, NY, NZ); C3.init(NX, NY, NZ);
104 dt_C1.init(NX, NY, NZ); dt_C2.init(NX, NY, NZ); dt_C3.init(NX, NY, NZ);
105 Vmag.init(NX, NY, NZ);
107 D11.init(NX, NY, NZ);
108 D12.init(NX, NY, NZ);
109 D13.init(NX, NY, NZ);
110 D22.init(NX, NY, NZ);
111 D23.init(NX, NY, NZ);
112 D33.init(NX, NY, NZ);
114 Phi.init(NX, NY, NZ); Psi.init(NX, NY, NZ);
116 lin_viol.init(NX, NY, NZ);
117 lin_viol_mag.init(NX, NY, NZ);
118 lin_viol_der_mag.init(NX, NY, NZ);
119 lin_viol_der.init(NX, NY, NZ);
121 viols =
new real_t[NUM_BARDEEN_VIOLS];
122 for(
int i=0; i<NUM_BARDEEN_VIOLS; ++i)
126 bssn->
fields[
"Bardeen_Phi"] = & Phi;
127 bssn->
fields[
"Bardeen_Psi"] = & Psi;
128 bssn->
fields[
"Bardeen_A"] = & A;
129 bssn->
fields[
"Bardeen_dt_A"] = & dt_A;
130 bssn->
fields[
"Bardeen_d2t_A"] = & d2t_A;
131 bssn->
fields[
"Bardeen_B"] = & B;
132 bssn->
fields[
"Bardeen_dt_B"] = & dt_B;
133 bssn->
fields[
"Bardeen_d2t_B"] = & d2t_B;
135 bssn->
fields[
"Bardeen_E"] = & E;
136 bssn->
fields[
"Bardeen_F"] = & F;
138 bssn->
fields[
"Bardeen_G1"] = & G1;
139 bssn->
fields[
"Bardeen_G2"] = & G2;
140 bssn->
fields[
"Bardeen_G3"] = & G3;
141 bssn->
fields[
"Bardeen_C1"] = & C1;
142 bssn->
fields[
"Bardeen_C2"] = & C2;
143 bssn->
fields[
"Bardeen_C3"] = & C3;
144 bssn->
fields[
"Bardeen_dt_C1"] = & dt_C1;
145 bssn->
fields[
"Bardeen_dt_C2"] = & dt_C2;
146 bssn->
fields[
"Bardeen_dt_C3"] = & dt_C3;
147 bssn->
fields[
"Bardeen_Vmag"] = & Vmag;
149 bssn->
fields[
"Bardeen_D11"] = & D11;
150 bssn->
fields[
"Bardeen_D12"] = & D12;
151 bssn->
fields[
"Bardeen_D13"] = & D13;
152 bssn->
fields[
"Bardeen_D22"] = & D22;
153 bssn->
fields[
"Bardeen_D23"] = & D23;
154 bssn->
fields[
"Bardeen_D33"] = & D33;
163 void useMLScaleFactor(real_t Omega_L_I_in)
165 if(Omega_L_I_in < 0 || Omega_L_I_in > 1)
167 std::cout <<
"Invalid Omega_Lambda specified." << std::endl;
171 Omega_L_I = Omega_L_I_in;
174 void setUseMLScaleFactor(
bool use)
176 use_mL_scale_factor = use;
191 real_t sqrt_Omega_L_I = std::sqrt(Omega_L_I);
193 2.0/(1.0 - sqrt_Omega_L_I) * sqrt_Omega_L_I
194 ) / (3.0*sqrt_Omega_L_I);
198 real_t getMLScaleFactor(real_t elapsed_sim_time)
203 real_t t = tI + elapsed_sim_time;
204 return std::pow(t/tI, 2.0/3.0);
209 std::cosh(3.0*std::sqrt(Omega_L_I) * elapsed_sim_time / 2.0 )
210 + (std::sinh(3.0*std::sqrt(Omega_L_I) * elapsed_sim_time / 2.0 ) / std::sqrt(Omega_L_I))
215 real_t getMLHubbleFactor(real_t elapsed_sim_time)
217 real_t a = getMLScaleFactor(elapsed_sim_time);
218 return std::sqrt( (1 - Omega_L_I)*std::pow(a, -3.0) + Omega_L_I );
221 real_t getMLd2adt2Factor(real_t elapsed_sim_time)
223 real_t a = getMLScaleFactor(elapsed_sim_time);
224 real_t H = getMLHubbleFactor(elapsed_sim_time);
225 return a*H*H - (1.0 -
Omega_L_I)*3.0/2.0/a/a;
230 void getSVTViolations(real_t * viols_copyto);
bool use_mL_scale_factor
Use FLRW matter+Lambda scale factor?
Definition: bardeen.h:30
BSSN Class: evolves BSSN metric fields, computes derived quantities.
Definition: bssn.h:24
map_t fields
Public map from names to internal arrays.
Definition: bssn.h:38
real_t Omega_L_I
Initial Omega_Lambda.
Definition: bardeen.h:31
void setPotentials(real_t elapsed_sim_time)
Compute Bardeen & vector potentials. Assumes no reference solultion is used (this should be checked i...
Definition: bardeen.cc:23
real_t getMLInitialTime()
Gets the matter+Lambda universe initial time. Assumes units H_I = 1, a_I = 1.
Definition: bardeen.h:183