diff --git a/src/hydro/Minimal/hydro.h b/src/hydro/Minimal/hydro.h index a434372c4fd51948243fd70838d6f3ce3e2c94b2..20856b7e038855e22aa3776a74ba9f495ff6c93f 100644 --- a/src/hydro/Minimal/hydro.h +++ b/src/hydro/Minimal/hydro.h @@ -360,7 +360,7 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra( struct part *restrict p, struct xpart *restrict xp, float dt) { /* Do not decrease the energy by more than a factor of 2*/ - if (p->u_dt < -0.5f * xp->u_full / dt) { + if (dt > 0. && p->u_dt * dt < -0.5f * xp->u_full) { p->u_dt = -0.5f * xp->u_full / dt; } xp->u_full += p->u_dt * dt; diff --git a/src/hydro/PressureEntropy/hydro.h b/src/hydro/PressureEntropy/hydro.h index 3e6c19abde5c65a219f5c1d58e91fe9b52a2f73d..f22bb8a13a8ba4d896a77bd4c4f5e86bed5a5960 100644 --- a/src/hydro/PressureEntropy/hydro.h +++ b/src/hydro/PressureEntropy/hydro.h @@ -394,7 +394,7 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra( struct part *restrict p, struct xpart *restrict xp, float dt) { /* Do not decrease the entropy (temperature) by more than a factor of 2*/ - if (p->entropy_dt < -0.5f * xp->entropy_full / dt) { + if (dt > 0. && p->entropy_dt * dt < -0.5f * xp->entropy_full) { p->entropy_dt = -0.5f * xp->entropy_full / dt; } xp->entropy_full += p->entropy_dt * dt; diff --git a/src/runner_doiact.h b/src/runner_doiact.h index b27c8bc2412dc174d1c18e7850c876bcafffee8b..7b40343954e628f670df0b02f65f31b55de47348 100644 --- a/src/runner_doiact.h +++ b/src/runner_doiact.h @@ -2080,7 +2080,8 @@ void DOSUB_SELF1(struct runner *r, struct cell *ci, int gettimer) { /* Otherwise, compute self-interaction. */ else { -#if (DOSELF1 == runner_doself1_density) && defined(WITH_VECTORIZATION) && defined(GADGET2_SPH) +#if (DOSELF1 == runner_doself1_density) && defined(WITH_VECTORIZATION) && \ + defined(GADGET2_SPH) runner_doself1_density_vec(r, ci); #else DOSELF1(r, ci);