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
......@@ -140,9 +140,13 @@ INLINE static void compute_SNII_feedback(
/* Time after birth considered for SNII feedback (internal units) */
const double SNII_wind_delay = feedback_props->SNII_wind_delay;
/* Are we doing feedback this step? */
if (star_age <= SNII_wind_delay && (star_age + dt) > SNII_wind_delay) {
/* Are we doing feedback this step?
* 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) {
#ifdef SWIFT_DEBUG_CHECKS
message("Star has already done feedback! sp->id=%lld age=%e d=%e", sp->id,
......
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