From 53bc63dc7419983976ec3315dba9d39e80bc2220 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <matthieu.schaller@durham.ac.uk> Date: Tue, 22 Mar 2016 09:49:11 +0000 Subject: [PATCH] Better name for temporary variable --- src/runner.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/runner.c b/src/runner.c index 92eb8c3df7..5e1b6497d7 100644 --- a/src/runner.c +++ b/src/runner.c @@ -664,7 +664,7 @@ void runner_dodrift(struct runner *r, struct cell *c, int timer) { const float ti_current = r->e->ti_current; struct part *restrict p, *restrict parts = c->parts; struct xpart *restrict xp, *restrict xparts = c->xparts; - float dx_max = 0.f, h_max = 0.f; + float dx_max = 0.f, dx2_max = 0.f, h_max = 0.f; float w; TIMER_TIC @@ -710,17 +710,17 @@ void runner_dodrift(struct runner *r, struct cell *c, int timer) { hydro_predict_extra(p, xp, ti_old, ti_current, timeBase); /* Compute (square of) motion since last cell construction */ - const float dx = (p->x[0] - xp->x_old[0]) * (p->x[0] - xp->x_old[0]) + - (p->x[1] - xp->x_old[1]) * (p->x[1] - xp->x_old[1]) + - (p->x[2] - xp->x_old[2]) * (p->x[2] - xp->x_old[2]); - dx_max = fmaxf(dx_max, dx); + const float dx2 = (p->x[0] - xp->x_old[0]) * (p->x[0] - xp->x_old[0]) + + (p->x[1] - xp->x_old[1]) * (p->x[1] - xp->x_old[1]) + + (p->x[2] - xp->x_old[2]) * (p->x[2] - xp->x_old[2]); + dx2_max = fmaxf(dx2_max, dx2); /* Maximal smoothing length */ h_max = fmaxf(p->h, h_max); } /* Now, get the maximal particle motion from its square */ - dx_max = sqrtf(dx_max); + dx_max = sqrtf(dx2_max); } /* Otherwise, aggregate data from children. */ -- GitLab