diff --git a/src/kick.h b/src/kick.h index a679da274186b3ac96fe7ae0e1687511f3f6ed4a..b7dea7ffe9593d92a1eeef38b878c57328bad083 100644 --- a/src/kick.h +++ b/src/kick.h @@ -33,12 +33,11 @@ * @param gp The #gpart to kick. * @param ti_start The starting (integer) time of the kick * @param ti_end The ending (integer) time of the kick - * @param ti_current The current (integer) time. * @param timeBase The minimal allowed time-step size. */ __attribute__((always_inline)) INLINE static void kick_gpart( struct gpart *restrict gp, integertime_t ti_start, integertime_t ti_end, - integertime_t ti_current, double timeBase) { + double timeBase) { /* Time interval for this half-kick */ const float dt = (ti_end - ti_start) * timeBase; @@ -59,7 +58,6 @@ __attribute__((always_inline)) INLINE static void kick_gpart( * @param xp The #xpart of the particle. * @param ti_start The starting (integer) time of the kick * @param ti_end The ending (integer) time of the kick - * @param ti_current The current (integer) time. * @param timeBase The minimal allowed time-step size. */ __attribute__((always_inline)) INLINE static void kick_part( diff --git a/src/runner.c b/src/runner.c index 33f5fab55156809a7cf5c185c28af4f4810e8ce8..d43f914ff143d25cf16b09ec55b41aea07a2d977 100644 --- a/src/runner.c +++ b/src/runner.c @@ -900,7 +900,7 @@ void runner_do_kick1(struct runner *r, struct cell *c, int timer) { #endif /* do the kick */ - kick_gpart(gp, ti_begin, ti_begin + ti_step / 2, ti_current, timeBase); + kick_gpart(gp, ti_begin, ti_begin + ti_step / 2, timeBase); } } } @@ -976,28 +976,23 @@ void runner_do_kick2(struct runner *r, struct cell *c, int timer) { /* Get a handle on the part. */ struct gpart *restrict gp = &gparts[k]; - /* If the g-particle has no counterpart */ - if (gp->id_or_neg_offset > 0) { - - /* need to be kicked ? */ - if (gpart_is_active(gp, e)) { + /* If the g-particle has no counterpart and needs to be kicked */ + if (gp->id_or_neg_offset > 0 && gpart_is_active(gp, e)) { - /* First, finish the force loop */ - gravity_end_force(gp, const_G); + /* First, finish the force loop */ + gravity_end_force(gp, const_G); - const integertime_t ti_step = get_integer_timestep(gp->time_bin); - const integertime_t ti_begin = - get_integer_time_begin(ti_current, gp->time_bin); + const integertime_t ti_step = get_integer_timestep(gp->time_bin); + 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"); + 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); - } + /* Finish the time-step with a second half-kick */ + kick_gpart(gp, ti_begin + ti_step / 2, ti_begin + ti_step, timeBase); } } }