Skip to content
Snippets Groups Projects
Commit d847056c authored by Bert Vandenbroucke's avatar Bert Vandenbroucke Committed by Matthieu Schaller
Browse files

Added debug check on particle drift distance.

parent b403c0fa
Branches
Tags
1 merge request!524Improvements to GIZMO implementation
...@@ -2405,6 +2405,15 @@ void cell_drift_part(struct cell *c, const struct engine *e, int force) { ...@@ -2405,6 +2405,15 @@ void cell_drift_part(struct cell *c, const struct engine *e, int force) {
drift_part(p, xp, dt_drift, dt_kick_hydro, dt_kick_grav, dt_therm, drift_part(p, xp, dt_drift, dt_kick_hydro, dt_kick_grav, dt_therm,
ti_old_part, ti_current); ti_old_part, ti_current);
#ifdef SWIFT_DEBUG_CHECKS
/* Make sure the particle does not drift by more than a box length. */
if (fabsf(xp->v_full[0] * dt_drift) > e->s->dim[0] ||
fabsf(xp->v_full[1] * dt_drift) > e->s->dim[1] ||
fabsf(xp->v_full[2] * dt_drift) > e->s->dim[2]) {
error("Particle drifts by more than a box length!");
}
#endif
/* 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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment