From c8f8a9b184a6b313ac6571628ddb36845080b9c1 Mon Sep 17 00:00:00 2001 From: Robert Izzard <r.izzard@surrey.ac.uk> Date: Sun, 1 Aug 2021 18:09:13 +0100 Subject: [PATCH] add nonstellar timestep function which can be called from outside stellar_timestep --- src/timestep/nonstellar_timestep.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/timestep/nonstellar_timestep.c diff --git a/src/timestep/nonstellar_timestep.c b/src/timestep/nonstellar_timestep.c new file mode 100644 index 000000000..b7a895c97 --- /dev/null +++ b/src/timestep/nonstellar_timestep.c @@ -0,0 +1,30 @@ +#include "../binary_c.h" +No_empty_translation_unit_warning; + +#include "timestep.h" + +void nonstellar_timestep(struct stardata_t * const stardata, + double * const dtm) +{ + Foreach_star(star) + { + timestep_fixed_timesteps(stardata, + star, + dtm); + } + + /* + * Hard wired minimum : do not apply + * if the timestep is limited by a fixed timestep + */ + Foreach_star(star) + { + if(stardata->model.fixed_timestep_triggered == FALSE && + star->dtlimiter != DT_LIMIT_FIXED_TIMESTEP) + { + *dtm = Max(*dtm, + MINIMUM_STELLAR_TIMESTEP); + } + } + +} -- GitLab