Added logarithmic external potential
This commit is contained in:
parent
8cba5b5e1d
commit
131642aa71
5 changed files with 51 additions and 84 deletions
13
config.cpp
13
config.cpp
|
|
@ -124,14 +124,16 @@ void Config::error_checking()
|
|||
for (int i=0; i<7; i++)
|
||||
if (!((pn_usage[i] == 0) || (pn_usage[i] == 1)))
|
||||
throw std::runtime_error("PN usage array (pn_usage) must have ones and zeros only");
|
||||
if (ext_units_physical && ((norm_mass == 0) || (norm_length == 0)))
|
||||
throw std::runtime_error("Physical units for external gravity (ext_units_physical) requires ext_norm_mass and ext_norm_length to be positive numbers");
|
||||
if (ext_units_physical && ((unit_mass == 0) || (unit_length == 0)))
|
||||
throw std::runtime_error("Physical units for external gravity (ext_units_physical) requires ext_unit_mass and ext_unit_length to be positive numbers");
|
||||
if ((ext_m_bulge > 0) && (ext_b_bulge < 0))
|
||||
throw std::runtime_error("To use external bulge gravity, please specify positive ext_m_bulge and ext_b_bulge");
|
||||
if ((ext_m_halo_plummer > 0) && (ext_b_halo_plummer < 0))
|
||||
throw std::runtime_error("To use external Plummer halo gravity, please specify positive ext_m_halo_plummer and ext_b_halo_plummer");
|
||||
if ((ext_m_disk > 0) && ((ext_a_disk < 0) || (ext_b_disk < 0)))
|
||||
throw std::runtime_error("To use external disk gravity, please specify positive ext_m_disk, ext_a_disk and ext_b_disk");
|
||||
if (((ext_log_halo_r > 0) && (ext_log_halo_v <= 0)) || ((ext_log_halo_r <= 0) && (ext_log_halo_v > 0)))
|
||||
throw std::runtime_error("To use external logarithmic halo gravity, please specify positive ext_log_halo_r and ext_log_halo_v");
|
||||
}
|
||||
|
||||
Config::Config(std::string file_name)
|
||||
|
|
@ -162,8 +164,8 @@ Config::Config(std::string file_name)
|
|||
pn_c = get_parameter<double>(dictionary, "pn_c", 0);
|
||||
|
||||
ext_units_physical = get_parameter<bool>(dictionary, "ext_units_physical", false);
|
||||
norm_mass = get_parameter<double>(dictionary, "norm_mass", !ext_units_physical);
|
||||
norm_length = get_parameter<double>(dictionary, "norm_length", !ext_units_physical);
|
||||
unit_mass = get_parameter<double>(dictionary, "unit_mass", !ext_units_physical);
|
||||
unit_length = get_parameter<double>(dictionary, "unit_length", !ext_units_physical);
|
||||
ext_m_bulge = get_parameter<double>(dictionary, "ext_m_bulge", 0);
|
||||
ext_b_bulge = get_parameter<double>(dictionary, "ext_b_bulge", -1);
|
||||
ext_m_disk = get_parameter<double>(dictionary, "ext_m_disk", 0);
|
||||
|
|
@ -171,6 +173,9 @@ Config::Config(std::string file_name)
|
|||
ext_b_disk = get_parameter<double>(dictionary, "ext_b_disk", -1);
|
||||
ext_m_halo_plummer = get_parameter<double>(dictionary, "ext_m_halo_plummer", 0);
|
||||
ext_b_halo_plummer = get_parameter<double>(dictionary, "ext_b_halo_plummer", -1);
|
||||
ext_log_halo_v = get_parameter<double>(dictionary, "ext_log_halo_v", 0);
|
||||
ext_log_halo_r = get_parameter<double>(dictionary, "ext_log_halo_r", 0);
|
||||
|
||||
|
||||
error_checking();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue