From b57dd387b269d6934b0598bae2545cb75874be00 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Sat, 20 Feb 2016 23:36:22 +0000
Subject: [PATCH] Minimal SPH also moved to integer timeline

---
 src/hydro/Minimal/hydro.h       | 12 +++++++-----
 src/hydro/Minimal/hydro_debug.h |  6 +++---
 src/hydro/Minimal/hydro_part.h  |  4 ++--
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/hydro/Minimal/hydro.h b/src/hydro/Minimal/hydro.h
index 3585fc3c29..f4e3f1a706 100644
--- a/src/hydro/Minimal/hydro.h
+++ b/src/hydro/Minimal/hydro.h
@@ -116,10 +116,11 @@ __attribute__((always_inline))
  *
  * @param p The particle to act upon
  * @param xp The extended particle data to act upon
- * @param time The current time
+ * @param ti_current The current time (on the timeline)
+ * @param timeBase The minimal time-step size
  */
 __attribute__((always_inline)) INLINE static void hydro_prepare_force(
-    struct part* p, struct xpart* xp, float time) {
+    struct part* p, struct xpart* xp, int ti_current, double timeBase) {
 
   p->force.pressure = p->rho * p->u * (const_hydro_gamma - 1.f);
 }
@@ -154,11 +155,12 @@ __attribute__((always_inline))
  *
  * @param p The particle
  * @param xp The extended data of the particle
- * @param t0 The time at the start of the drift
- * @param t1 The time at the end of the drift
+ * @param t0 The time at the start of the drift (on the timeline)
+ * @param t1 The time at the end of the drift (on the timeline)
+ * @param timeBase The minimal time-step size
  */
 __attribute__((always_inline)) INLINE static void hydro_predict_extra(
-    struct part* p, struct xpart* xp, float t0, float t1) {
+    struct part* p, struct xpart* xp, int t0, int t1, double timeBase) {
 
   const float dt = t1 - t0;
 
diff --git a/src/hydro/Minimal/hydro_debug.h b/src/hydro/Minimal/hydro_debug.h
index b208d5b867..85fdbac0a7 100644
--- a/src/hydro/Minimal/hydro_debug.h
+++ b/src/hydro/Minimal/hydro_debug.h
@@ -24,10 +24,10 @@ __attribute__((always_inline))
       "v=[%.3e,%.3e,%.3e],v_full=[%.3e,%.3e,%.3e] \n a=[%.3e,%.3e,%.3e], "
       "u_full=%.3e, u=%.3e, du/dt=%.3e v_sig=%.3e, P=%.3e\n"
       "h=%.3e, dh/dt=%.3e "
-      "wcount=%d, m=%.3e, dh_drho=%.3e, rho=%.3e, t_begin=%.3e, t_end=%.3e\n",
+      "wcount=%d, m=%.3e, dh_drho=%.3e, rho=%.3e, t_begin=%d, t_end=%d\n",
       p->x[0], p->x[1], p->x[2], p->v[0], p->v[1], p->v[2], xp->v_full[0],
       xp->v_full[1], xp->v_full[2], p->a_hydro[0], p->a_hydro[1], p->a_hydro[2],
       xp->u_full, p->u, p->u_dt, p->force.v_sig, p->force.pressure, p->h,
-      p->h_dt, (int)p->density.wcount, p->mass, p->rho_dh, p->rho, p->t_begin,
-      p->t_end);
+      p->h_dt, (int)p->density.wcount, p->mass, p->rho_dh, p->rho, p->ti_begin,
+      p->ti_end);
 }
diff --git a/src/hydro/Minimal/hydro_part.h b/src/hydro/Minimal/hydro_part.h
index b89cc249a4..8875e737c6 100644
--- a/src/hydro/Minimal/hydro_part.h
+++ b/src/hydro/Minimal/hydro_part.h
@@ -55,9 +55,9 @@ struct part {
 
   float h_dt; /*!< Time derivative of smoothing length  */
 
-  float t_begin; /*!< Time at the beginning of time-step. */
+  int ti_begin; /*!< Time at the beginning of time-step. */
 
-  float t_end; /*!< Time at the end of time-step. */
+  int ti_end; /*!< Time at the end of time-step. */
 
   float u; /*!< Particle internal energy. */
 
-- 
GitLab