From 0c59431ecce708a60a1b7f8c01dad9b02ba6844e Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Sun, 13 May 2018 16:53:19 +0200
Subject: [PATCH] Add the function to interpolate a m-pole from/to the mesh to
 the public interface.

---
 src/runner_doiact_fft.c | 11 +++++------
 src/runner_doiact_fft.h |  9 ++++++++-
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/runner_doiact_fft.c b/src/runner_doiact_fft.c
index 9bcf69feda..97a3ed4465 100644
--- a/src/runner_doiact_fft.c
+++ b/src/runner_doiact_fft.c
@@ -95,9 +95,8 @@ __attribute__((always_inline)) INLINE static double CIC_get(
  * @param fac The width of a mesh cell.
  * @param dim The dimensions of the simulation box.
  */
-__attribute__((always_inline)) INLINE static void multipole_to_mesh_CIC(
-    const struct gravity_tensors* m, double* rho, int N, double fac,
-    const double dim[3]) {
+void multipole_to_mesh_CIC(const struct gravity_tensors* m, double* rho, int N,
+                           double fac, const double dim[3]) {
 
   /* Box wrap the multipole's position */
   const double CoM_x = box_wrap(m->CoM[0], 0., dim[0]);
@@ -137,6 +136,7 @@ __attribute__((always_inline)) INLINE static void multipole_to_mesh_CIC(
   rho[row_major_id(i + 1, j + 1, k + 0, N)] += mass * dx * dy * tz;
   rho[row_major_id(i + 1, j + 1, k + 1, N)] += mass * dx * dy * dz;
 }
+
 /**
  * @brief Computes the potential on a multipole from a given mesh using the CIC
  * method.
@@ -147,9 +147,8 @@ __attribute__((always_inline)) INLINE static void multipole_to_mesh_CIC(
  * @param fac width of a mesh cell.
  * @param dim The dimensions of the simulation box.
  */
-__attribute__((always_inline)) INLINE static void mesh_to_multipole_CIC(
-    struct gravity_tensors* m, const double* pot, int N, double fac,
-    const double dim[3]) {
+void mesh_to_multipole_CIC(struct gravity_tensors* m, const double* pot, int N,
+                           double fac, const double dim[3]) {
 
   /* Box wrap the multipole's position */
   const double CoM_x = box_wrap(m->CoM[0], 0., dim[0]);
diff --git a/src/runner_doiact_fft.h b/src/runner_doiact_fft.h
index e9836311e7..93fee635e1 100644
--- a/src/runner_doiact_fft.h
+++ b/src/runner_doiact_fft.h
@@ -20,7 +20,14 @@
 #define SWIFT_RUNNER_DOIACT_FFT_H
 
 struct runner;
+struct gravity_tensors;
 
-void runner_do_grav_fft(struct runner *r, int timer);
+void runner_do_grav_fft(struct runner* r, int timer);
+
+void multipole_to_mesh_CIC(const struct gravity_tensors* m, double* rho, int N,
+                           double fac, const double dim[3]);
+
+void mesh_to_multipole_CIC(struct gravity_tensors* m, const double* pot, int N,
+                           double fac, const double dim[3]);
 
 #endif /* SWIFT_RUNNER_DOIACT_FFT_H */
-- 
GitLab