From 159c9532c177c29613aab00121a31a6ec32d95bc Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Wed, 3 Feb 2016 14:26:49 +0000
Subject: [PATCH] Now initialise the particles using the hydro functions.

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

diff --git a/src/cell.c b/src/cell.c
index 79afff700f..044f64d57f 100644
--- a/src/cell.c
+++ b/src/cell.c
@@ -45,6 +45,7 @@
 /* Local headers. */
 #include "atomic.h"
 #include "error.h"
+#include "hydro.h"
 #include "space.h"
 #include "timers.h"
 
@@ -560,10 +561,11 @@ void cell_init_parts(struct cell *c, void *data) {
   for(int i=0; i<c->count; ++i) {
     p[i].t_begin = 0.;
     p[i].t_end = 0.;
-    p[i].rho = -1.;
     xp[i].v_full[0] = p[i].v[0];
     xp[i].v_full[1] = p[i].v[1];
     xp[i].v_full[2] = p[i].v[2];
+    hydro_init_part(p);
+    hydro_reset_acceleration(p);
   }
   c->t_end_min = 0.;
 }
-- 
GitLab