7 #ifndef COSMO_BSSN_GAUGE_FNS 8 #define COSMO_BSSN_GAUGE_FNS 10 #include "bssn_data.h" 13 #include "../../utils/ConfigParser.h" 29 std::map<std::string, bssn_gauge_func_t> lapse_gauge_map;
30 std::map<std::string, std::map<std::string, bssn_gauge_func_t>> shift_gauge_map;
49 real_t exp_sync_gauge_c;
54 real_t GeneralizedNewton(
BSSNData *bd);
85 real_t k_driver_coeff;
89 real_t AijDriverShift2(
BSSNData *bd);
90 real_t AijDriverShift3(
BSSNData *bd);
99 #if USE_GENERALIZED_NEWTON 101 lapse_gauge_map[
"GeneralizedNewton"] = &BSSNGaugeHandler::GeneralizedNewton;
133 shift_gauge_map[
"AijDriverShift"][
"2"] = &BSSNGaugeHandler::AijDriverShift2;
134 shift_gauge_map[
"AijDriverShift"][
"3"] = &BSSNGaugeHandler::AijDriverShift3;
139 gauge_wave_dir = std::stoi((*config)(
"gauge_wave_dir",
"1"));
140 dw_mu_l = std::stod((*config)(
"dw_mu_l",
"0.0"));
141 dw_mu_s = std::stod((*config)(
"dw_mu_s",
"0.0"));
142 dw_p = std::stod((*config)(
"dw_p",
"0.0"));
143 gd_c = std::stod((*config)(
"gd_c",
"1.0"));
145 exp_sync_gauge_c = std::stod((*config)(
"exp_sync_gauge_c",
"1.0"));
147 k_driver_coeff = std::stod((*config)(
"k_driver_coeff",
"0.04"));
149 GN_eta = std::stod((*config)(
"GN_eta",
"0.001"));
161 _initDefaultParameters(&emptyConfig);
174 _initDefaultParameters(config);
185 if ( lapse_gauge_map.find(name) == lapse_gauge_map.end() )
187 std::cout <<
"Error: Lapse gauge not found: `" << name <<
"`!\n";
191 std::cout <<
"Using lapse: `" << name <<
"`.\n";
192 lapse_fn = lapse_gauge_map[name];
203 if(name !=
"Static" && !USE_BSSN_SHIFT)
205 std::cerr <<
"Code must be compiled with shift enabled to use non-Static shift!";
210 if(name ==
"gammadriver" && !USE_GAMMA_DRIVER)
212 std::cerr <<
"Code must be compiled with gamma driver enabled to use the gamma driver gauge.";
217 if ( shift_gauge_map.find(name) == shift_gauge_map.end() )
219 std::cout <<
"Error: Shift gauge not found: `" << name <<
"`!\n";
223 shift_fn1 = shift_gauge_map[name][
"1"];
224 shift_fn2 = shift_gauge_map[name][
"2"];
225 shift_fn3 = shift_gauge_map[name][
"3"];
233 return (*this.*lapse_fn)(bd);
241 return (*this.*shift_fn1)(bd);
249 return (*this.*shift_fn2)(bd);
257 return (*this.*shift_fn3)(bd);
real_t gauge_wave_dir
wave direction of prop. ( {1,2,3})
Definition: BSSNGaugeHandler.h:75
bssn_gauge_func_t shift_fn3
Shift evolution function.
Definition: BSSNGaugeHandler.h:36
real_t GammaDriverShift1(BSSNData *bd)
Gamma driver shift in x-dir.
Definition: BSSNGaugeHandler.cc:117
Definition: BSSNGaugeHandler.h:20
real_t AwAShiftedWaveShift2(BSSNData *bd)
AwA shifted gauge wave test shift in y-dir.
Definition: BSSNGaugeHandler.cc:238
real_t ev_lapse(BSSNData *bd)
Lapse evolution function for BSSN class to call.
Definition: BSSNGaugeHandler.h:231
real_t ev_shift2(BSSNData *bd)
Shift in y-dir evolution function for BSSN class to call.
Definition: BSSNGaugeHandler.h:247
real_t dw_mu_l
damped wave "mu_l" parameter
Definition: BSSNGaugeHandler.h:66
real_t OnePlusLogLapse(BSSNData *bd)
1 + log slicing
Definition: BSSNGaugeHandler.cc:64
real_t AwAShiftedWaveShift3(BSSNData *bd)
AwA shifted gauge wave test shift in z-dir.
Definition: BSSNGaugeHandler.cc:249
real_t HarmonicLapse(BSSNData *bd)
Hamonic gauge lapse.
Definition: BSSNGaugeHandler.cc:32
real_t GammaDriverShift3(BSSNData *bd)
Gamma driver shift in z-dir.
Definition: BSSNGaugeHandler.cc:139
real_t(BSSNGaugeHandler::* bssn_gauge_func_t)(BSSNData *bd)
internal function pointer type
Definition: BSSNGaugeHandler.h:23
real_t GammaDriverShift2(BSSNData *bd)
Gamma driver shift in y-dir.
Definition: BSSNGaugeHandler.cc:128
real_t Static(BSSNData *bd)
Don't evolve anything.
Definition: BSSNGaugeHandler.cc:16
BSSNGaugeHandler()
Initialize with static, non-evolving gauge.
Definition: BSSNGaugeHandler.h:157
real_t DampedWaveShift2(BSSNData *bd)
Damped wave gauge shift in y-dir.
Definition: BSSNGaugeHandler.cc:176
bssn_gauge_func_t shift_fn2
Shift evolution function.
Definition: BSSNGaugeHandler.h:35
void setShiftFn(std::string name)
Set the shift function.
Definition: BSSNGaugeHandler.h:200
real_t AwAGaugeWaveLapse(BSSNData *bd)
AwA gauge wave test lapse.
Definition: BSSNGaugeHandler.cc:211
BSSNGaugeHandler(ConfigParser *config, BSSN *bssnSim)
Initialize with gauge determined by config file (default to a "static", non-evolving gauge) ...
Definition: BSSNGaugeHandler.h:169
real_t ConformalFLRWLapse(BSSNData *bd)
Locally conformal FLRW-type lapse.
Definition: BSSNGaugeHandler.cc:24
real_t TestAijDriverLapse(BSSNData *bd)
Trial Lapse function in cosmology.
Definition: BSSNGaugeHandler.cc:107
real_t AnharmonicLapse(BSSNData *bd)
Generalized Newton, see notes.
Definition: BSSNGaugeHandler.cc:51
BSSN Class: evolves BSSN metric fields, computes derived quantities.
Definition: bssn.h:24
real_t AwAShiftedWaveLapse(BSSNData *bd)
AwA shifted gauge wave test lapse.
Definition: BSSNGaugeHandler.cc:219
Structure containing BSSN metric variables and various derived quantities, such as derivatives of BSS...
Definition: bssn_data.h:18
Definition: ConfigParser.h:10
real_t gd_c
Tunable gauge parameter.
Definition: BSSNGaugeHandler.h:48
real_t TestKDriverLapse(BSSNData *bd)
Trial Lapse function in cosmology Assumes reference metric is not used / minkowski.
Definition: BSSNGaugeHandler.cc:93
bssn_gauge_func_t lapse_fn
Lapse evolution function.
Definition: BSSNGaugeHandler.h:33
real_t AijDriverShift1(BSSNData *bd)
Aij driver test gauge.
Definition: BSSNGaugeHandler.cc:262
real_t DampedWaveLapse(BSSNData *bd)
Damped wave gauge lapse.
Definition: BSSNGaugeHandler.cc:150
real_t dw_mu_s
damped wave "mu_s" parameter
Definition: BSSNGaugeHandler.h:67
void setLapseFn(std::string name)
Set the lapse function.
Definition: BSSNGaugeHandler.h:183
real_t ev_shift3(BSSNData *bd)
Shift in z-dir evolution function for BSSN class to call.
Definition: BSSNGaugeHandler.h:255
real_t ConformalSyncLapse(BSSNData *bd)
Untested/experimental gauge choice; conformal synchronous gauge Relies on having reference metric for...
Definition: BSSNGaugeHandler.cc:83
bssn_gauge_func_t shift_fn1
Shift evolution function.
Definition: BSSNGaugeHandler.h:34
real_t dw_p
damped wave "p" parameter
Definition: BSSNGaugeHandler.h:68
real_t DampedWaveShift1(BSSNData *bd)
Damped wave gauge shift in x-dir.
Definition: BSSNGaugeHandler.cc:159
real_t ev_shift1(BSSNData *bd)
Shift in x-dir evolution function for BSSN class to call.
Definition: BSSNGaugeHandler.h:239
real_t AwAShiftedWaveShift1(BSSNData *bd)
AwA shifted gauge wave test shift in x-dir.
Definition: BSSNGaugeHandler.cc:227
real_t DampedWaveShift3(BSSNData *bd)
Damped wave gauge shift in z-dir.
Definition: BSSNGaugeHandler.cc:193