From 11bab0251d6495f0484278f9e790d5585576d7ed Mon Sep 17 00:00:00 2001
From: "Peter W. Draper" <p.w.draper@durham.ac.uk>
Date: Mon, 10 Oct 2016 13:12:41 +0100
Subject: [PATCH] SWIFT_DEBUG_CHECKS: scope of ih and cdim is limited to the
 MPI section, so add explicit values

---
 src/space.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/space.c b/src/space.c
index 93e96ac433..880264e8ee 100644
--- a/src/space.c
+++ b/src/space.c
@@ -589,9 +589,10 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
   for (size_t k = 1; k < nr_parts; k++) {
     if (ind[k - 1] > ind[k]) {
       error("Sort failed!");
-    } else if (ind[k] != cell_getid(cdim, s->parts[k].x[0] * ih[0],
-                                    s->parts[k].x[1] * ih[1],
-                                    s->parts[k].x[2] * ih[2])) {
+    } else if (ind[k] != cell_getid(s->cdim, 
+                                    s->parts[k].x[0] * s->iwidth[0],
+                                    s->parts[k].x[1] * s->iwidth[1],
+                                    s->parts[k].x[2] * s->iwidth[2])) {
       error("Incorrect indices!");
     }
   }
-- 
GitLab