From af3f90f058b651f3db23b07416d354274e77d9b7 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Sun, 31 Jul 2016 14:23:53 +0100
Subject: [PATCH] Post-merge fixes

---
 src/cell.c               |  4 ++--
 src/engine.c             |  2 +-
 src/runner_doiact_grav.h | 38 +++++++++++++++++++-------------------
 3 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/cell.c b/src/cell.c
index 9907a3747e..05782c1c18 100644
--- a/src/cell.c
+++ b/src/cell.c
@@ -721,11 +721,11 @@ int cell_are_neighbours(const struct cell *restrict ci,
                         const struct cell *restrict cj) {
 
 #ifdef SWIFT_DEBUG_CHECKS
-  if (ci->h[0] != cj->h[0]) error("Cells of different size !");
+  if (ci->width[0] != cj->width[0]) error("Cells of different size !");
 #endif
 
   /* Maximum allowed distance */
-  const double min_dist = 1.2 * ci->h[0]; /* 1.2 accounts for rounding errors */
+  const double min_dist = 1.2 * ci->width[0]; /* 1.2 accounts for rounding errors */
 
   /* (Manhattan) Distance between the cells */
   for (int k = 0; k < 3; k++) {
diff --git a/src/engine.c b/src/engine.c
index ce1acfec43..8420248d9d 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -2646,7 +2646,7 @@ void engine_step(struct engine *e) {
   /* Check the gravity accelerations */
   struct gpart *temp = malloc(s->nr_gparts * sizeof(struct gpart));
   memcpy(temp, s->gparts, s->nr_gparts * sizeof(struct gpart));
-  const double rlr = const_gravity_a_smooth * s->cells[0].h[0];
+  const double rlr = const_gravity_a_smooth * s->cells[0].width[0];
   gravity_n2(temp, s->nr_gparts, e->physical_constants, rlr);
   file = fopen("grav_brute.dat", "w");
   for (size_t k = 0; k < s->nr_gparts; ++k) {
diff --git a/src/runner_doiact_grav.h b/src/runner_doiact_grav.h
index ae6607ecd6..907178681d 100644
--- a/src/runner_doiact_grav.h
+++ b/src/runner_doiact_grav.h
@@ -72,7 +72,7 @@ __attribute__((always_inline)) INLINE static void runner_dopair_grav_pm(
   struct gpart *restrict gparts = ci->gparts;
   const struct multipole multi = cj->multipole;
   const int ti_current = e->ti_current;
-  const float rlr_inv = 1. / (const_gravity_a_smooth * ci->super->h[0]);
+  const float rlr_inv = 1. / (const_gravity_a_smooth * ci->super->width[0]);
 
   TIMER_TIC;
 
@@ -95,7 +95,7 @@ __attribute__((always_inline)) INLINE static void runner_dopair_grav_pm(
     if (gp->id_or_neg_offset == ICHECK)
       message("id=%lld loc=[ %f %f %f ] size= %f count= %d",
               gp->id_or_neg_offset, cj->loc[0], cj->loc[1], cj->loc[2],
-              cj->h[0], cj->gcount);
+              cj->width[0], cj->gcount);
   }
 #endif
 
@@ -139,13 +139,13 @@ __attribute__((always_inline)) INLINE static void runner_dopair_grav_pp(
   struct gpart *restrict gparts_i = ci->gparts;
   struct gpart *restrict gparts_j = cj->gparts;
   const int ti_current = e->ti_current;
-  const float rlr_inv = 1. / (const_gravity_a_smooth * ci->super->h[0]);
+  const float rlr_inv = 1. / (const_gravity_a_smooth * ci->super->width[0]);
 
   TIMER_TIC;
 
 #ifdef SWIFT_DEBUG_CHECKS
-  if (ci->h[0] != cj->h[0])  // MATTHIEU sanity check
-    error("Non matching cell sizes !! h_i=%f h_j=%f", ci->h[0], cj->h[0]);
+  if (ci->width[0] != cj->width[0])  // MATTHIEU sanity check
+    error("Non matching cell sizes !! h_i=%f h_j=%f", ci->width[0], cj->width[0]);
 #endif
 
   /* Anything to do here? */
@@ -160,7 +160,7 @@ __attribute__((always_inline)) INLINE static void runner_dopair_grav_pp(
     if (gp->id_or_neg_offset == ICHECK)
       message("id=%lld loc=[ %f %f %f ] size= %f count= %d",
               gp->id_or_neg_offset, cj->loc[0], cj->loc[1], cj->loc[2],
-              cj->h[0], cj->gcount);
+              cj->width[0], cj->gcount);
   }
 
   for (int pid = 0; pid < gcount_j; pid++) {
@@ -171,7 +171,7 @@ __attribute__((always_inline)) INLINE static void runner_dopair_grav_pp(
     if (gp->id_or_neg_offset == ICHECK)
       message("id=%lld loc=[ %f %f %f ] size= %f count=%d",
               gp->id_or_neg_offset, ci->loc[0], ci->loc[1], ci->loc[2],
-              ci->h[0], ci->gcount);
+              ci->width[0], ci->gcount);
   }
 #endif
 
@@ -233,7 +233,7 @@ __attribute__((always_inline)) INLINE static void runner_doself_grav_pp(
   const int gcount = c->gcount;
   struct gpart *restrict gparts = c->gparts;
   const int ti_current = e->ti_current;
-  const float rlr_inv = 1. / (const_gravity_a_smooth * c->super->h[0]);
+  const float rlr_inv = 1. / (const_gravity_a_smooth * c->super->width[0]);
 
   TIMER_TIC;
 
@@ -253,7 +253,7 @@ __attribute__((always_inline)) INLINE static void runner_doself_grav_pp(
 
     if (gp->id_or_neg_offset == ICHECK)
       message("id=%lld loc=[ %f %f %f ] size= %f count= %d",
-              gp->id_or_neg_offset, c->loc[0], c->loc[1], c->loc[2], c->h[0],
+              gp->id_or_neg_offset, c->loc[0], c->loc[1], c->loc[2], c->width[0],
               c->gcount);
   }
 #endif
@@ -324,8 +324,8 @@ static void runner_dopair_grav(struct runner *r, struct cell *ci,
   if (gcount_i == 0 || gcount_j == 0) error("Empty cell !");
 
   /* Bad stuff will happen if cell sizes are different */
-  if (ci->h[0] != cj->h[0])
-    error("Non matching cell sizes !! h_i=%f h_j=%f", ci->h[0], cj->h[0]);
+  if (ci->width[0] != cj->width[0])
+    error("Non matching cell sizes !! h_i=%f h_j=%f", ci->width[0], cj->width[0]);
 
   /* Sanity check */
   if (ci == cj)
@@ -336,10 +336,10 @@ static void runner_dopair_grav(struct runner *r, struct cell *ci,
   /* Are the cells direct neighbours? */
   if (!cell_are_neighbours(ci, cj))
     error(
-        "Non-neighbouring cells ! ci->x=[%f %f %f] ci->h=%f cj->loc=[%f %f %f] "
-        "cj->h=%f",
-        ci->loc[0], ci->loc[1], ci->loc[2], ci->h[0], cj->loc[0], cj->loc[1],
-        cj->loc[2], cj->h[0]);
+        "Non-neighbouring cells ! ci->x=[%f %f %f] ci->width=%f cj->loc=[%f %f %f] "
+        "cj->width=%f",
+        ci->loc[0], ci->loc[1], ci->loc[2], ci->width[0], cj->loc[0], cj->loc[1],
+        cj->loc[2], cj->width[0]);
 
 #endif
 
@@ -352,7 +352,7 @@ static void runner_dopair_grav(struct runner *r, struct cell *ci,
     if (gp->id_or_neg_offset == ICHECK)
       message("id=%lld loc=[ %f %f %f ] size= %f count= %d",
               gp->id_or_neg_offset, cj->loc[0], cj->loc[1], cj->loc[2],
-              cj->h[0], cj->gcount);
+              cj->width[0], cj->gcount);
   }
 
   for (int pid = 0; pid < cj->gcount; pid++) {
@@ -363,7 +363,7 @@ static void runner_dopair_grav(struct runner *r, struct cell *ci,
     if (gp->id_or_neg_offset == ICHECK)
       message("id=%lld loc=[ %f %f %f ] size= %f count= %d",
               gp->id_or_neg_offset, ci->loc[0], ci->loc[1], ci->loc[2],
-              ci->h[0], ci->gcount);
+              ci->width[0], ci->gcount);
   }
 #endif
 
@@ -479,7 +479,7 @@ static void runner_do_grav_mm(struct runner *r, struct cell *ci, int timer) {
     if (gp->id_or_neg_offset == ICHECK)
       message("id=%lld loc=[ %f %f %f ] size= %f count= %d",
               gp->id_or_neg_offset, ci->loc[0], ci->loc[1], ci->loc[2],
-              ci->h[0], ci->gcount);
+              ci->width[0], ci->gcount);
   }
 #endif
 
@@ -488,7 +488,7 @@ static void runner_do_grav_mm(struct runner *r, struct cell *ci, int timer) {
   struct cell *cells = e->s->cells;
   const int nr_cells = e->s->nr_cells;
   const int ti_current = e->ti_current;
-  const double max_d = const_gravity_a_smooth * const_gravity_r_cut * ci->h[0];
+  const double max_d = const_gravity_a_smooth * const_gravity_r_cut * ci->width[0];
   const double max_d2 = max_d * max_d;
   const double pos_i[3] = {ci->loc[0], ci->loc[1], ci->loc[2]};
 
-- 
GitLab