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

Added more checks that the quantities used in the feedback make sense.

parent d2743390
No related branches found
No related tags found
1 merge request!793Make sure the EAGLE feedback conserves energy and momentum.
......@@ -690,6 +690,10 @@ void compute_stellar_evolution(const struct feedback_props* feedback_props,
TIMER_TIC;
#ifdef SWIFT_DEBUG_CHECKS
if (age < 0.f) error("Negative age for a star.");
#endif
/* Allocate temporary array for calculating imf weights */
float stellar_yields[eagle_feedback_N_imf_bins];
......
......@@ -114,6 +114,11 @@ runner_iact_nonsym_feedback_apply(const float r2, const float *dx,
Omega_frac = 0.f;
}
#ifdef SWIFT_DEBUG_CHECKS
if (Omega_frac < 0. || Omega_frac > 1.)
error("Invalid fraction of material to dsitribute.");
#endif
/* Update particle mass */
const double current_mass = hydro_get_mass(pj);
const double delta_mass = si->feedback_data.to_distribute.mass * Omega_frac;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment