diff --git a/src/runner.c b/src/runner.c index dc1eb9f13c263735984954d2cf85afd8de4a9af2..33f5fab55156809a7cf5c185c28af4f4810e8ce8 100644 --- a/src/runner.c +++ b/src/runner.c @@ -867,6 +867,13 @@ void runner_do_kick1(struct runner *r, struct cell *c, int timer) { const integertime_t ti_begin = get_integer_time_begin(ti_current, p->time_bin); +#ifdef SWIFT_DEBUG_CHECKS + const integertime_t ti_end = + get_integer_time_end(ti_current, p->time_bin); + + if (ti_end - ti_begin != ti_step) error("Particle in wrong time-bin"); +#endif + /* do the kick */ kick_part(p, xp, ti_begin, ti_begin + ti_step / 2, timeBase); } @@ -885,6 +892,13 @@ void runner_do_kick1(struct runner *r, struct cell *c, int timer) { const integertime_t ti_begin = get_integer_time_begin(ti_current, gp->time_bin); +#ifdef SWIFT_DEBUG_CHECKS + const integertime_t ti_end = + get_integer_time_end(ti_current, gp->time_bin); + + if (ti_end - ti_begin != ti_step) error("Particle in wrong time-bin"); +#endif + /* do the kick */ kick_gpart(gp, ti_begin, ti_begin + ti_step / 2, ti_current, timeBase); } @@ -943,6 +957,11 @@ void runner_do_kick2(struct runner *r, struct cell *c, int timer) { const integertime_t ti_begin = get_integer_time_begin(ti_current, p->time_bin); +#ifdef SWIFT_DEBUG_CHECKS + if (ti_begin + ti_step != ti_current) + error("Particle in wrong time-bin"); +#endif + /* Finish the time-step with a second half-kick */ kick_part(p, xp, ti_begin + ti_step / 2, ti_begin + ti_step, timeBase); @@ -970,6 +989,11 @@ void runner_do_kick2(struct runner *r, struct cell *c, int timer) { const integertime_t ti_begin = get_integer_time_begin(ti_current, gp->time_bin); +#ifdef SWIFT_DEBUG_CHECKS + if (ti_begin + ti_step != ti_current) + error("Particle in wrong time-bin"); +#endif + /* Finish the time-step with a second half-kick */ kick_gpart(gp, ti_begin + ti_step / 2, ti_begin + ti_step, ti_current, timeBase);