From d5e85e12fddd1ca75ee7df39ffe74287446b14d0 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Tue, 12 Apr 2016 14:19:58 +0100
Subject: [PATCH] Made the magical constant in the potential timestep a #define
 constant

---
 src/potentials.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/potentials.h b/src/potentials.h
index 43d9bb48e8..433c9dba70 100644
--- a/src/potentials.h
+++ b/src/potentials.h
@@ -48,6 +48,8 @@ struct external_potential {
 /* Include exteral pointmass potential */
 #ifdef EXTERNAL_POTENTIAL_POINTMASS
 
+#define EXTERNAL_GRAVITY_TIMESTEP_PREFACTOR 0.03f
+
 /**
  * @brief Computes the time-step due to the acceleration from a point mass
  *
@@ -79,7 +81,7 @@ __attribute__((always_inline))
   const float a_2 = g->a_grav[0] * g->a_grav[0] + g->a_grav[1] * g->a_grav[1] +
                     g->a_grav[2] * g->a_grav[2];
 
-  return 0.03f * sqrtf(a_2 / dota_2);
+  return EXTERNAL_GRAVITY_TIMESTEP_PREFACTOR * sqrtf(a_2 / dota_2);
 }
 
 /**
-- 
GitLab