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

Added debugging check to prevent inhibited/not-created particles in interactions.

parent e8faa2fd
No related branches found
No related tags found
2 merge requests!688Star formation (non-MPI),!684Add star particles on-the-fly
......@@ -55,6 +55,13 @@ __attribute__((always_inline)) INLINE static void runner_iact_density(
float wj, wj_dx;
float dv[3], curlvr[3];
#ifdef SWIFT_DEBUG_CHECKS
if (pi->time_bin >= time_bin_inhibited)
error("Inhibited pi in interaction function!");
if (pj->time_bin >= time_bin_inhibited)
error("Inhibited pj in interaction function!");
#endif
/* Get the masses. */
const float mi = pi->mass;
const float mj = pj->mass;
......@@ -145,6 +152,13 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_density(
float wi, wi_dx;
float dv[3], curlvr[3];
#ifdef SWIFT_DEBUG_CHECKS
if (pi->time_bin >= time_bin_inhibited)
error("Inhibited pi in interaction function!");
if (pj->time_bin >= time_bin_inhibited)
error("Inhibited pj in interaction function!");
#endif
/* Get the masses. */
const float mj = pj->mass;
......@@ -436,6 +450,13 @@ __attribute__((always_inline)) INLINE static void runner_iact_force(
float wi, wj, wi_dx, wj_dx;
#ifdef SWIFT_DEBUG_CHECKS
if (pi->time_bin >= time_bin_inhibited)
error("Inhibited pi in interaction function!");
if (pj->time_bin >= time_bin_inhibited)
error("Inhibited pj in interaction function!");
#endif
/* Cosmological factors entering the EoMs */
const float fac_mu = pow_three_gamma_minus_five_over_two(a);
const float a2_Hubble = a * a * H;
......@@ -558,6 +579,13 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
float wi, wj, wi_dx, wj_dx;
#ifdef SWIFT_DEBUG_CHECKS
if (pi->time_bin >= time_bin_inhibited)
error("Inhibited pi in interaction function!");
if (pj->time_bin >= time_bin_inhibited)
error("Inhibited pj in interaction function!");
#endif
/* Cosmological factors entering the EoMs */
const float fac_mu = pow_three_gamma_minus_five_over_two(a);
const float a2_Hubble = a * a * H;
......
......@@ -54,9 +54,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_density(
float wi, wj, wi_dx, wj_dx;
#ifdef SWIFT_DEBUG_CHECKS
if (pi->time_bin == time_bin_inhibited)
if (pi->time_bin >= time_bin_inhibited)
error("Inhibited pi in interaction function!");
if (pj->time_bin == time_bin_inhibited)
if (pj->time_bin >= time_bin_inhibited)
error("Inhibited pj in interaction function!");
#endif
......@@ -135,9 +135,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_density(
float wi, wi_dx;
#ifdef SWIFT_DEBUG_CHECKS
if (pi->time_bin == time_bin_inhibited)
if (pi->time_bin >= time_bin_inhibited)
error("Inhibited pi in interaction function!");
if (pj->time_bin == time_bin_inhibited)
if (pj->time_bin >= time_bin_inhibited)
error("Inhibited pj in interaction function!");
#endif
......@@ -196,9 +196,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_force(
struct part *restrict pj, float a, float H) {
#ifdef SWIFT_DEBUG_CHECKS
if (pi->time_bin == time_bin_inhibited)
if (pi->time_bin >= time_bin_inhibited)
error("Inhibited pi in interaction function!");
if (pj->time_bin == time_bin_inhibited)
if (pj->time_bin >= time_bin_inhibited)
error("Inhibited pj in interaction function!");
#endif
......@@ -323,9 +323,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
const struct part *restrict pj, float a, float H) {
#ifdef SWIFT_DEBUG_CHECKS
if (pi->time_bin == time_bin_inhibited)
if (pi->time_bin >= time_bin_inhibited)
error("Inhibited pi in interaction function!");
if (pj->time_bin == time_bin_inhibited)
if (pj->time_bin >= time_bin_inhibited)
error("Inhibited pj in interaction function!");
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment