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

Avoid rounding error in the calculation of the ages for feedback in the EAGLE model.

parent 94d54f62
No related branches found
No related tags found
No related merge requests found
...@@ -140,9 +140,13 @@ INLINE static void compute_SNII_feedback( ...@@ -140,9 +140,13 @@ INLINE static void compute_SNII_feedback(
/* Time after birth considered for SNII feedback (internal units) */ /* Time after birth considered for SNII feedback (internal units) */
const double SNII_wind_delay = feedback_props->SNII_wind_delay; const double SNII_wind_delay = feedback_props->SNII_wind_delay;
/* Are we doing feedback this step? */ /* Are we doing feedback this step?
if (star_age <= SNII_wind_delay && (star_age + dt) > SNII_wind_delay) { * Note that since the ages are calculated using an interpolation table we
* must allow some tolerance here*/
if (star_age <= SNII_wind_delay &&
(star_age + 1.0001 * dt) > SNII_wind_delay) {
/* Make sure a star does not do feedback twice! */
if (sp->f_E != -1.f) { if (sp->f_E != -1.f) {
#ifdef SWIFT_DEBUG_CHECKS #ifdef SWIFT_DEBUG_CHECKS
message("Star has already done feedback! sp->id=%lld age=%e d=%e", sp->id, message("Star has already done feedback! sp->id=%lld age=%e d=%e", sp->id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment