From b5081a5a1f0fa1e31ee5cb60294e33446ba20411 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Wed, 19 Sep 2018 17:28:24 +0200
Subject: [PATCH] Make the drift functions ignore the inhibited particles.

---
 src/cell.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/cell.c b/src/cell.c
index 2c5fe71c31..0a54880706 100644
--- a/src/cell.c
+++ b/src/cell.c
@@ -2895,6 +2895,9 @@ void cell_drift_part(struct cell *c, const struct engine *e, int force) {
       struct part *const p = &parts[k];
       struct xpart *const xp = &xparts[k];
 
+      /* Ignore inhibited particles */
+      if (part_is_inhibited(p, e)) continue;
+
       /* Drift... */
       drift_part(p, xp, dt_drift, dt_kick_hydro, dt_kick_grav, dt_therm,
                  ti_old_part, ti_current);
@@ -3037,6 +3040,9 @@ void cell_drift_gpart(struct cell *c, const struct engine *e, int force) {
       /* Get a handle on the gpart. */
       struct gpart *const gp = &gparts[k];
 
+      /* Ignore inhibited particles */
+      if (gpart_is_inhibited(gp, e)) continue;
+
       /* Drift... */
       drift_gpart(gp, dt_drift, ti_old_gpart, ti_current);
 
@@ -3082,6 +3088,9 @@ void cell_drift_gpart(struct cell *c, const struct engine *e, int force) {
       /* Get a handle on the spart. */
       struct spart *const sp = &sparts[k];
 
+      /* Ignore inhibited particles */
+      if (spart_is_inhibited(sp, e)) continue;
+
       /* Drift... */
       drift_spart(sp, dt_drift, ti_old_gpart, ti_current);
 
-- 
GitLab