From 4884a894b0b0b4756e9887405acb51be16471a0b Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <schaller@strw.leidenuniv.nl> Date: Fri, 25 Oct 2019 17:24:28 +0200 Subject: [PATCH] Also add the checks that have been added to the COLIBRE version of feedback. --- src/feedback/EAGLE/feedback.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/feedback/EAGLE/feedback.c b/src/feedback/EAGLE/feedback.c index 18b7d7ceb9..efd223d1e8 100644 --- a/src/feedback/EAGLE/feedback.c +++ b/src/feedback/EAGLE/feedback.c @@ -728,6 +728,11 @@ void compute_stellar_evolution(const struct feedback_props* feedback_props, const float enrichment_weight_inv = sp->feedback_data.to_collect.enrichment_weight_inv; +#ifdef SWIFT_DEBUG_CHECKS + if (sp->feedback_data.to_collect.enrichment_weight_inv < 0.) + error("Negative inverse weight!"); +#endif + /* Now we start filling the data structure for information to apply to the * particles. Do _NOT_ read from the to_collect substructure any more. */ @@ -739,6 +744,11 @@ void compute_stellar_evolution(const struct feedback_props* feedback_props, (enrichment_weight_inv != 0.f) ? 1.f / enrichment_weight_inv : 0.f; sp->feedback_data.to_distribute.enrichment_weight = enrichment_weight; +#ifdef SWIFT_DEBUG_CHECKS + if (sp->feedback_data.to_collect.enrichment_weight < 0.) + error("Negative weight!"); +#endif + /* Compute properties of the stochastic SNII feedback model. */ if (feedback_props->with_SNII_feedback) { compute_SNII_feedback(sp, age, dt, ngb_gas_mass, feedback_props); -- GitLab