Commit f6c33e0a authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Do not read the comoving softening from the yaml file if not running with cosmology switched on.

parent 2987a26b
......@@ -633,7 +633,7 @@ int main(int argc, char *argv[]) {
/* Initialise the gravity properties */
if (with_self_gravity)
gravity_props_init(&gravity_properties, params, &cosmo);
gravity_props_init(&gravity_properties, params, &cosmo, with_cosmology);
/* Read particles and space information from (GADGET) ICs */
char ICfileName[200] = "";
......
......@@ -39,7 +39,7 @@
#define gravity_props_default_rebuild_frequency 0.01f
void gravity_props_init(struct gravity_props *p, struct swift_params *params,
const struct cosmology *cosmo) {
const struct cosmology *cosmo, int with_cosmology) {
/* Tree updates */
p->rebuild_frequency =
......@@ -74,10 +74,16 @@ void gravity_props_init(struct gravity_props *p, struct swift_params *params,
p->theta_crit_inv = 1. / p->theta_crit;
/* Softening parameters */
if (with_cosmology) {
p->epsilon_comoving =
parser_get_param_double(params, "Gravity:comoving_softening");
p->epsilon_max_physical =
parser_get_param_double(params, "Gravity:max_physical_softening");
} else {
p->epsilon_max_physical =
parser_get_param_double(params, "Gravity:max_physical_softening");
p->epsilon_comoving = p->epsilon_max_physical;
}
/* Set the softening to the current time */
gravity_update(p, cosmo);
......
......@@ -88,7 +88,7 @@ struct gravity_props {
void gravity_props_print(const struct gravity_props *p);
void gravity_props_init(struct gravity_props *p, struct swift_params *params,
const struct cosmology *cosmo);
const struct cosmology *cosmo, int with_cosmology);
void gravity_update(struct gravity_props *p, const struct cosmology *cosmo);
#if defined(HAVE_HDF5)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment