Skip to content
Snippets Groups Projects
Commit 46e220ee authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'cherry-pick-3d08262d' into 'master'

(bugfix) Do not set h-depth before applying min and max h

See merge request !2078
parents 81ab35eb 23033f03
No related branches found
No related tags found
4 merge requests!2165Merge master,!2119Mhd canvas,!2112Prep for remix merge,!2078(bugfix) Do not set h-depth before applying min and max h
...@@ -279,9 +279,6 @@ void cell_drift_part(struct cell *c, const struct engine *e, int force, ...@@ -279,9 +279,6 @@ void cell_drift_part(struct cell *c, const struct engine *e, int force,
with_cosmology, e->cosmology, e->hydro_properties, with_cosmology, e->cosmology, e->hydro_properties,
e->cooling_func, e->time); e->cooling_func, e->time);
/* Set the appropriate depth level for this particle */
cell_set_part_h_depth(p, c);
#ifdef SWIFT_DEBUG_CHECKS #ifdef SWIFT_DEBUG_CHECKS
/* Make sure the particle does not drift by more than a box length. */ /* 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] || 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, ...@@ -334,6 +331,8 @@ void cell_drift_part(struct cell *c, const struct engine *e, int force,
/* Limit h to within the allowed range */ /* Limit h to within the allowed range */
p->h = min(p->h, hydro_h_max); p->h = min(p->h, hydro_h_max);
p->h = max(p->h, hydro_h_min); 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 */ /* Compute (square of) motion since last cell construction */
const float dx2 = xp->x_diff[0] * xp->x_diff[0] + const float dx2 = xp->x_diff[0] * xp->x_diff[0] +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment