From eb1d3499824a2124e9ce971b3bc53061d7de18a0 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Mon, 18 Sep 2017 22:15:34 +0100
Subject: [PATCH] Applied @jwillis' correction to the second loop of DOPAIR2.
 dx_max was entering the external loop with the wrong sign.

---
 src/runner_doiact.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/runner_doiact.h b/src/runner_doiact.h
index d5120194c4..473c0604ee 100644
--- a/src/runner_doiact.h
+++ b/src/runner_doiact.h
@@ -1093,7 +1093,7 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) {
      we are out of range of anything in ci (using the maximal hj). */
   for (int pjd = 0;
        pjd < count_j &&
-       sort_j[pjd].d - hj_max * kernel_gamma + dx_max < di_max - rshift;
+       sort_j[pjd].d - hj_max * kernel_gamma - dx_max < di_max - rshift;
        pjd++) {
 
     /* Get a hold of the jth part in cj. */
-- 
GitLab