From 8b49a37d63f243fc9ce91d883a3e1be5e8fc3880 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Tue, 20 Oct 2015 13:02:05 +0100
Subject: [PATCH] Particles (and cells) now carry a time for the end and for
 the begining of their current timesteps and not a dt anymore.

---
 src/cell.h |  6 +++---
 src/part.h | 17 ++++++++++++-----
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/cell.h b/src/cell.h
index 7a5353bcae..8ab3035f27 100644
--- a/src/cell.h
+++ b/src/cell.h
@@ -38,7 +38,7 @@ extern int cell_next_tag;
 struct pcell {
 
   /* Stats on this cell's particles. */
-  double h_max, dt_min, dt_max;
+  double h_max, t_end_min, t_end_max;
 
   /* Number of particles in this cell. */
   int count;
@@ -62,8 +62,8 @@ struct cell {
   /* Max radii in this cell. */
   double h_max;
 
-  /* Minimum and maximum dt in this cell. */
-  double dt_min, dt_max;
+  /* Minimum and maximum end of time step in this cell. */
+  double t_end_min, t_end_max;
 
   /* Minimum dimension, i.e. smallest edge of this cell. */
   float dmin;
diff --git a/src/part.h b/src/part.h
index 380c2dedb2..ee62a0a82a 100644
--- a/src/part.h
+++ b/src/part.h
@@ -1,6 +1,7 @@
 /*******************************************************************************
  * This file is part of SWIFT.
  * Coypright (c) 2012 Pedro Gonnet (pedro.gonnet@durham.ac.uk)
+ *                    Matthieu Schaller (matthieu.schaller@durhm.ac.uk)
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published
@@ -60,8 +61,11 @@ struct gpart {
   /* Particle mass. */
   float mass;
 
-  /* Particle time step. */
-  float dt;
+  /* Particle time of beginning of time-step. */
+  float t_begin;
+
+  /* Particle time of end of time-step. */
+  float t_end;
 
   /* Anonymous union for id/part. */
   union {
@@ -81,7 +85,7 @@ struct part {
   /* Particle position. */
   double x[3];
 
-  /* Particle velocity. */
+  /* Particle predicted velocity. */
   float v[3];
 
   /* Particle acceleration. */
@@ -90,8 +94,11 @@ struct part {
   /* Particle cutoff radius. */
   float h;
 
-  /* Particle time-step. */
-  float dt;
+  /* Particle time of beginning of time-step. */
+  float t_begin;
+
+  /* Particle time of end of time-step. */
+  float t_end;
 
   /* Particle internal energy. */
   float u;
-- 
GitLab