From 0d70e63da7d6861abd52d4dce2208a9e4802c39c Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Wed, 9 Aug 2017 12:08:38 +0100
Subject: [PATCH] Actually use the Ewald correction in the exact gravity
 checks.

---
 src/gravity.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/gravity.c b/src/gravity.c
index e54754d2ca..95509066e2 100644
--- a/src/gravity.c
+++ b/src/gravity.c
@@ -195,7 +195,7 @@ void gravity_exact_force_ewald_init(double boxSize) {
 }
 
 /**
- * @param Free the Ewald summation tables.
+ * @brief Free the Ewald summation tables.
  */
 void gravity_exact_force_ewald_free() {
 #ifdef SWIFT_GRAVITY_FORCE_CHECKS
@@ -208,7 +208,7 @@ void gravity_exact_force_ewald_free() {
 }
 
 /**
- * @param Compute the Ewald correction for a given distance vector r.
+ * @brief Compute the Ewald correction for a given distance vector r.
  *
  * We interpolate the Ewald correction tables using a tri-linear interpolation
  * similar to a CIC.
@@ -417,9 +417,11 @@ void gravity_exact_force_compute_mapper(void *map_data, int nr_gparts,
         if (periodic) {
 
           double corr[3];
-          a_grav[0] += mj * corr[0];
-          a_grav[1] += mj * corr[1];
-          a_grav[2] += mj * corr[2];
+	  gravity_exact_force_ewald_evaluate(dx, dy, dz, corr);
+
+          a_grav[0] += mj * corr[0] * 0.;
+          a_grav[1] += mj * corr[1] * 0.;
+          a_grav[2] += mj * corr[2] * 0.;
         }
       }
 
-- 
GitLab