diff --git a/README b/README index 5b0b5f3ebf8b322e121e0398ca01062e226be649..272188b3f7926b562ba993da3d24ae547c6a0397 100644 --- a/README +++ b/README @@ -21,21 +21,24 @@ Parameters: -h, --help show this help message and exit Simulation options: - -b, --feedback Run with stars feedback + + -b, --feedback Run with stars feedback. -c, --cosmology Run with cosmological time integration. - -C, --cooling Run with cooling + --temperature Run with temperature calculation. + -C, --cooling Run with cooling (also switches on --with-temperature). -D, --drift-all Always drift all particles even the ones far from active particles. This emulates Gadget-[23] and GIZMO's default behaviours. - -F, --star-formation Run with star formation + -F, --star-formation Run with star formation. -g, --external-gravity Run with an external gravitational potential. -G, --self-gravity Run with self-gravity. -M, --multipole-reconstruction Reconstruct the multipoles every time-step. -s, --hydro Run with hydrodynamics. - -S, --stars Run with stars - -x, --velociraptor Run with structure finding + -S, --stars Run with stars. + -x, --velociraptor Run with structure finding. Control options: + -a, --pin Pin runners using processor affinity. -d, --dry-run Dry run. Read the parameter file, allocates memory but does not read the particles diff --git a/README.md b/README.md index 92925017d9a8f44521a542e1df3760cc58ba73cb..7a3c1287c79922a751595840295063a8ca347ef7 100644 --- a/README.md +++ b/README.md @@ -69,21 +69,24 @@ Parameters: -h, --help show this help message and exit Simulation options: - -b, --feedback Run with stars feedback + + -b, --feedback Run with stars feedback. -c, --cosmology Run with cosmological time integration. - -C, --cooling Run with cooling + --temperature Run with temperature calculation. + -C, --cooling Run with cooling (also switches on --with-temperature). -D, --drift-all Always drift all particles even the ones far from active particles. This emulates Gadget-[23] and GIZMO's default behaviours. - -F, --star-formation Run with star formation + -F, --star-formation Run with star formation. -g, --external-gravity Run with an external gravitational potential. -G, --self-gravity Run with self-gravity. -M, --multipole-reconstruction Reconstruct the multipoles every time-step. -s, --hydro Run with hydrodynamics. - -S, --stars Run with stars - -x, --velociraptor Run with structure finding + -S, --stars Run with stars. + -x, --velociraptor Run with structure finding. Control options: + -a, --pin Pin runners using processor affinity. -d, --dry-run Dry run. Read the parameter file, allocates memory but does not read the particles diff --git a/doc/RTD/source/CommandLineOptions/index.rst b/doc/RTD/source/CommandLineOptions/index.rst index de969730bebc6c20950086cb1ba9a20b94e01af6..bd58f031e622272d0245599621fc635891588a8f 100644 --- a/doc/RTD/source/CommandLineOptions/index.rst +++ b/doc/RTD/source/CommandLineOptions/index.rst @@ -16,21 +16,24 @@ can be found by typing ``./swift -h``:: -h, --help show this help message and exit Simulation options: - -b, --feedback Run with stars feedback + + -b, --feedback Run with stars feedback. -c, --cosmology Run with cosmological time integration. - -C, --cooling Run with cooling + --temperature Run with temperature calculation. + -C, --cooling Run with cooling (also switches on --with-temperature). -D, --drift-all Always drift all particles even the ones far from active particles. This emulates Gadget-[23] and GIZMO's default behaviours. - -F, --star-formation Run with star formation + -F, --star-formation Run with star formation. -g, --external-gravity Run with an external gravitational potential. -G, --self-gravity Run with self-gravity. -M, --multipole-reconstruction Reconstruct the multipoles every time-step. -s, --hydro Run with hydrodynamics. - -S, --stars Run with stars - -x, --velociraptor Run with structure finding + -S, --stars Run with stars. + -x, --velociraptor Run with structure finding. Control options: + -a, --pin Pin runners using processor affinity. -d, --dry-run Dry run. Read the parameter file, allocates memory but does not read the particles diff --git a/examples/main.c b/examples/main.c index e3dd46a6ea972ccbd78bb95d6ac13f60af9e69d2..db8d8f0d4137d67273233956f1d9c53988100148 100644 --- a/examples/main.c +++ b/examples/main.c @@ -146,6 +146,7 @@ int main(int argc, char *argv[]) { int restart = 0; int with_cosmology = 0; int with_external_gravity = 0; + int with_temperature = 0; int with_cooling = 0; int with_self_gravity = 0; int with_hydro = 0; @@ -173,20 +174,23 @@ int main(int argc, char *argv[]) { struct argparse_option options[] = { OPT_HELP(), - OPT_GROUP(" Simulation options:"), - OPT_BOOLEAN('b', "feedback", &with_feedback, "Run with stars feedback", + OPT_GROUP(" Simulation options:\n"), + OPT_BOOLEAN('b', "feedback", &with_feedback, "Run with stars feedback.", NULL, 0, 0), OPT_BOOLEAN('c', "cosmology", &with_cosmology, "Run with cosmological time integration.", NULL, 0, 0), - OPT_BOOLEAN('C', "cooling", &with_cooling, "Run with cooling", NULL, 0, - 0), + OPT_BOOLEAN(0, "temperature", &with_temperature, + "Run with temperature calculation.", NULL, 0, 0), + OPT_BOOLEAN('C', "cooling", &with_cooling, + "Run with cooling (also switches on --with-temperature).", + NULL, 0, 0), OPT_BOOLEAN('D', "drift-all", &with_drift_all, "Always drift all particles even the ones far from active " "particles. This emulates Gadget-[23] and GIZMO's default " "behaviours.", NULL, 0, 0), OPT_BOOLEAN('F', "star-formation", &with_star_formation, - "Run with star formation", NULL, 0, 0), + "Run with star formation.", NULL, 0, 0), OPT_BOOLEAN('g', "external-gravity", &with_external_gravity, "Run with an external gravitational potential.", NULL, 0, 0), OPT_BOOLEAN('G', "self-gravity", &with_self_gravity, @@ -195,11 +199,11 @@ int main(int argc, char *argv[]) { "Reconstruct the multipoles every time-step.", NULL, 0, 0), OPT_BOOLEAN('s', "hydro", &with_hydro, "Run with hydrodynamics.", NULL, 0, 0), - OPT_BOOLEAN('S', "stars", &with_stars, "Run with stars", NULL, 0, 0), + OPT_BOOLEAN('S', "stars", &with_stars, "Run with stars.", NULL, 0, 0), OPT_BOOLEAN('x', "velociraptor", &with_structure_finding, - "Run with structure finding", NULL, 0, 0), + "Run with structure finding.", NULL, 0, 0), - OPT_GROUP(" Control options:"), + OPT_GROUP(" Control options:\n"), OPT_BOOLEAN('a', "pin", &with_aff, "Pin runners using processor affinity.", NULL, 0, 0), OPT_BOOLEAN('d', "dry-run", &dry_run, @@ -854,7 +858,8 @@ int main(int argc, char *argv[]) { /* Initialise the cooling function properties */ bzero(&cooling_func, sizeof(struct cooling_function_data)); - if (with_cooling) cooling_init(params, &us, &prog_const, &cooling_func); + if (with_cooling || with_temperature) + cooling_init(params, &us, &prog_const, &cooling_func); if (myrank == 0) cooling_print(&cooling_func); /* Initialise the chemistry */ @@ -872,6 +877,7 @@ int main(int argc, char *argv[]) { if (with_external_gravity) engine_policies |= engine_policy_external_gravity; if (with_cosmology) engine_policies |= engine_policy_cosmology; + if (with_temperature) engine_policies |= engine_policy_temperature; if (with_cooling) engine_policies |= engine_policy_cooling; if (with_stars) engine_policies |= engine_policy_stars; if (with_star_formation) engine_policies |= engine_policy_star_formation; @@ -1209,7 +1215,7 @@ int main(int argc, char *argv[]) { if (with_verbose_timers) timers_close_file(); if (with_cosmology) cosmology_clean(e.cosmology); if (with_self_gravity) pm_mesh_clean(e.mesh); - if (with_cooling) cooling_clean(&cooling_func); + if (with_cooling || with_temperature) cooling_clean(&cooling_func); engine_clean(&e); free(params); diff --git a/src/cooling/EAGLE/cooling.c b/src/cooling/EAGLE/cooling.c index 062dee011fa78e689bab33a76269ef20add761a5..b94d60ff4346d52efd37df0795b21133e76c925b 100644 --- a/src/cooling/EAGLE/cooling.c +++ b/src/cooling/EAGLE/cooling.c @@ -671,7 +671,7 @@ float cooling_get_temperature( if (cooling->Redshifts == NULL) error( "Cooling function has not been initialised. Did you forget the " - "--cooling runtime flag?"); + "--temperature runtime flag?"); #endif /* Get physical internal energy */ diff --git a/src/engine.c b/src/engine.c index 841a92638b34dba3dce54576ea22a44bb346b935..ce9153e8c856330b2d60c97a01b36f5c7af670a4 100644 --- a/src/engine.c +++ b/src/engine.c @@ -108,6 +108,7 @@ const char *engine_policy_names[] = {"none", "cosmological integration", "drift everything", "reconstruct multi-poles", + "temperature", "cooling", "stars", "structure finding", @@ -2717,7 +2718,8 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs, space_init_sparts(s, e->verbose); /* Update the cooling function */ - if (e->policy & engine_policy_cooling) + if ((e->policy & engine_policy_cooling) || + (e->policy & engine_policy_temperature)) cooling_update(e->cosmology, e->cooling_func, /*restart_flag=*/0); #ifdef WITH_LOGGER @@ -2973,7 +2975,8 @@ void engine_step(struct engine *e) { } /* Update the cooling function */ - if (e->policy & engine_policy_cooling) + if ((e->policy & engine_policy_cooling) || + (e->policy & engine_policy_temperature)) cooling_update(e->cosmology, e->cooling_func, /*restart_flag=*/0); /*****************************************************/ diff --git a/src/engine.h b/src/engine.h index d7d916c1bc25fc0d2cbac26c95de406accec5a67..fea874435cd8160a4dfd37f6e7530f36318646d7 100644 --- a/src/engine.h +++ b/src/engine.h @@ -69,13 +69,14 @@ enum engine_policy { engine_policy_cosmology = (1 << 10), engine_policy_drift_all = (1 << 11), engine_policy_reconstruct_mpoles = (1 << 12), - engine_policy_cooling = (1 << 13), - engine_policy_stars = (1 << 14), - engine_policy_structure_finding = (1 << 15), - engine_policy_star_formation = (1 << 16), - engine_policy_feedback = (1 << 17) + engine_policy_temperature = (1 << 13), + engine_policy_cooling = (1 << 14), + engine_policy_stars = (1 << 15), + engine_policy_structure_finding = (1 << 16), + engine_policy_star_formation = (1 << 17), + engine_policy_feedback = (1 << 18) }; -#define engine_maxpolicy 18 +#define engine_maxpolicy 19 extern const char *engine_policy_names[engine_maxpolicy + 1]; /**