Skip to content
Snippets Groups Projects
Commit 117013d5 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Zero the hydro, EoS and gravity properties if they are not used by the calculation.

parent 3af1a04a
No related branches found
No related tags found
No related merge requests found
...@@ -634,7 +634,7 @@ int main(int argc, char *argv[]) { ...@@ -634,7 +634,7 @@ int main(int argc, char *argv[]) {
/* Initialize unit system and constants */ /* Initialize unit system and constants */
units_init_from_params(&us, params, "InternalUnitSystem"); units_init_from_params(&us, params, "InternalUnitSystem");
phys_const_init(&us, params, &prog_const); phys_const_init(&us, params, &prog_const);
if (myrank == 0 && verbose > 0) { if (myrank == 0) {
message("Internal unit system: U_M = %e g.", us.UnitMass_in_cgs); message("Internal unit system: U_M = %e g.", us.UnitMass_in_cgs);
message("Internal unit system: U_L = %e cm.", us.UnitLength_in_cgs); message("Internal unit system: U_L = %e cm.", us.UnitLength_in_cgs);
message("Internal unit system: U_t = %e s.", us.UnitTime_in_cgs); message("Internal unit system: U_t = %e s.", us.UnitTime_in_cgs);
...@@ -653,11 +653,20 @@ int main(int argc, char *argv[]) { ...@@ -653,11 +653,20 @@ int main(int argc, char *argv[]) {
/* Initialise the hydro properties */ /* Initialise the hydro properties */
if (with_hydro) if (with_hydro)
hydro_props_init(&hydro_properties, &prog_const, &us, params); hydro_props_init(&hydro_properties, &prog_const, &us, params);
if (with_hydro) eos_init(&eos, &prog_const, &us, params); else
bzero(&hydro_properties, sizeof(struct hydro_props));
/* Initialise the equation of state */
if (with_hydro)
eos_init(&eos, &prog_const, &us, params);
else
bzero(&eos, sizeof(struct eos_parameters));
/* Initialise the gravity properties */ /* Initialise the gravity properties */
if (with_self_gravity) if (with_self_gravity)
gravity_props_init(&gravity_properties, params, &cosmo, with_cosmology); gravity_props_init(&gravity_properties, params, &cosmo, with_cosmology);
else
bzero(&gravity_properties, sizeof(struct gravity_props));
/* Read particles and space information from (GADGET) ICs */ /* Read particles and space information from (GADGET) ICs */
char ICfileName[200] = ""; char ICfileName[200] = "";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment