Commit dcaace6c authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Same rule for the other hydro schemes.

parent 0d73ea36
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment