From 0b53c3e31d031b883b8182be7c6117b66aa1211c Mon Sep 17 00:00:00 2001 From: Yolan Uyttenhove <yolan.uyttenhove@ugent.be> Date: Fri, 31 Jan 2025 16:12:21 +0000 Subject: [PATCH] BUGFIX: do not set h-depth before applying min and max h (cherry picked from commit 3d08262d599e1c77ebbfeac0f60474f83e981cb5) Co-authored-by: Yolan Uyttenhove <yolan.uyttenhove@ugent.be> --- src/cell_drift.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cell_drift.c b/src/cell_drift.c index 3ca4aa9b83..9b5b07cc3d 100644 --- a/src/cell_drift.c +++ b/src/cell_drift.c @@ -279,9 +279,6 @@ void cell_drift_part(struct cell *c, const struct engine *e, int force, with_cosmology, e->cosmology, e->hydro_properties, e->cooling_func, e->time); - /* Set the appropriate depth level for this particle */ - cell_set_part_h_depth(p, c); - #ifdef SWIFT_DEBUG_CHECKS /* Make sure the particle does not drift by more than a box length. */ if (fabs(xp->v_full[0] * dt_drift) > e->s->dim[0] || @@ -334,6 +331,8 @@ void cell_drift_part(struct cell *c, const struct engine *e, int force, /* Limit h to within the allowed range */ p->h = min(p->h, hydro_h_max); p->h = max(p->h, hydro_h_min); + /* Set the appropriate depth level for this particle */ + cell_set_part_h_depth(p, c); /* Compute (square of) motion since last cell construction */ const float dx2 = xp->x_diff[0] * xp->x_diff[0] + -- GitLab