From ec55fbbd7436376832421c007f3eeb658c53ea8a Mon Sep 17 00:00:00 2001
From: Pedro Gonnet <pedro.gonnet@durham.ac.uk>
Date: Wed, 10 Apr 2013 11:22:29 +0000
Subject: [PATCH] fix potential bug in non-symmetric interactions.

Former-commit-id: 25f5a8df020aaba40e2f86421b4a945c4869d4bb
---
 src/runner_doiact.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/runner_doiact.h b/src/runner_doiact.h
index 599473e1d8..9acf0c8004 100644
--- a/src/runner_doiact.h
+++ b/src/runner_doiact.h
@@ -774,7 +774,7 @@ void DOPAIR1 ( struct runner *r , struct cell *ci , struct cell *cj ) {
             /* Compute the pairwise distance. */
             r2 = 0.0f;
             for ( k = 0 ; k < 3 ; k++ ) {
-                dx[k] = cpi->x[k] - pjx[k];
+                dx[k] = pjx[k] - cpi->x[k];
                 r2 += dx[k]*dx[k];
                 }
                 
@@ -1094,7 +1094,7 @@ void DOPAIR2 ( struct runner *r , struct cell *ci , struct cell *cj ) {
                 /* Compute the pairwise distance. */
                 r2 = 0.0f;
                 for ( k = 0 ; k < 3 ; k++ ) {
-                    dx[k] = pjx[k] - cpi->x[k];
+                    dx[k] = cpi->x[k] - pjx[k];
                     r2 += dx[k]*dx[k];
                     }
 
@@ -1143,7 +1143,7 @@ void DOPAIR2 ( struct runner *r , struct cell *ci , struct cell *cj ) {
                 /* Compute the pairwise distance. */
                 r2 = 0.0f;
                 for ( k = 0 ; k < 3 ; k++ ) {
-                    dx[k] = cpi->x[k] - pjx[k];
+                    dx[k] = pjx[k] - cpi->x[k];
                     r2 += dx[k]*dx[k];
                     }
 
-- 
GitLab