From d80ed50798b82a4f5d700c5593177b88dc924bc7 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Tue, 7 Mar 2017 18:38:31 +0000
Subject: [PATCH] Added configuration option to change the order of the
 multipole scheme.

---
 configure.ac    | 10 ++++++++++
 src/multipole.h |  4 +---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9199f5cca2..1786a42e8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -788,6 +788,15 @@ case "$with_potential" in
    ;;
 esac
 
+#  Gravity multipole order
+AC_ARG_WITH([multipole-order],
+   [AS_HELP_STRING([--with-multipole-order=<order>],
+      [order of the multipole and gravtiational field expansion @<:@ default: 2@:>@]
+   )],
+   [with_multipole_order="$withval"],
+   [with_multipole_order="2"]
+)
+AC_DEFINE_UNQUOTED([SELF_GRAVITY_MULTIPOLE_ORDER], [$with_multipole_order], [Multipole order])
 
 
 # Check for git, needed for revision stamps.
@@ -835,6 +844,7 @@ AC_MSG_RESULT([
    Riemann solver     : $with_riemann
    Cooling function   : $with_cooling
    External potential : $with_potential
+   Multipole order    : $with_multipole_order
 
    Task debugging     : $enable_task_debugging
    Debugging checks   : $enable_debugging_checks
diff --git a/src/multipole.h b/src/multipole.h
index 81ad981c42..3cbb55301f 100644
--- a/src/multipole.h
+++ b/src/multipole.h
@@ -110,8 +110,7 @@ INLINE static void gravity_reset(struct gravity_tensors *m) {
  * @param m The #multipole.
  * @param dt The drift time-step.
  */
-INLINE static void gravity_drift(struct gravity_tensors *m,
-                                           double dt) {
+INLINE static void gravity_drift(struct gravity_tensors *m, double dt) {
 
   /* Move the whole thing according to bulk motion */
   m->CoM[0] += m->m_pole.vel[0];
@@ -119,7 +118,6 @@ INLINE static void gravity_drift(struct gravity_tensors *m,
   m->CoM[2] += m->m_pole.vel[2];
 }
 
-
 INLINE static void gravity_field_tensors_init(struct gravity_tensors *m) {
 
   bzero(&m->a_x, sizeof(struct acc_tensor));
-- 
GitLab