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

Also add the checks that have been added to the COLIBRE version of feedback.

parent 767e4e3d
No related branches found
No related tags found
1 merge request!949Fix rounding error problem in the enrichment routines.
...@@ -728,6 +728,11 @@ void compute_stellar_evolution(const struct feedback_props* feedback_props, ...@@ -728,6 +728,11 @@ void compute_stellar_evolution(const struct feedback_props* feedback_props,
const float enrichment_weight_inv = const float enrichment_weight_inv =
sp->feedback_data.to_collect.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 /* Now we start filling the data structure for information to apply to the
* particles. Do _NOT_ read from the to_collect substructure any more. */ * 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, ...@@ -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; (enrichment_weight_inv != 0.f) ? 1.f / enrichment_weight_inv : 0.f;
sp->feedback_data.to_distribute.enrichment_weight = enrichment_weight; 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. */ /* Compute properties of the stochastic SNII feedback model. */
if (feedback_props->with_SNII_feedback) { if (feedback_props->with_SNII_feedback) {
compute_SNII_feedback(sp, age, dt, ngb_gas_mass, feedback_props); compute_SNII_feedback(sp, age, dt, ngb_gas_mass, feedback_props);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment