From d820e7f28e8c15ea276e0343814f3d94a7c1cb39 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <matthieu.schaller@durham.ac.uk> Date: Fri, 22 Jul 2016 18:03:48 +0100 Subject: [PATCH] Allow for different velocity and pressure fields --- src/debug.c | 1 + src/hydro/Gadget2/hydro_part.h | 58 ++++++++++++++++------------------ 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/src/debug.c b/src/debug.c index e7b60c52f9..487fd53e74 100644 --- a/src/debug.c +++ b/src/debug.c @@ -32,6 +32,7 @@ /* Local includes. */ #include "config.h" #include "const.h" +#include "hydro.h" #include "inline.h" #include "part.h" diff --git a/src/hydro/Gadget2/hydro_part.h b/src/hydro/Gadget2/hydro_part.h index 02fd1bddce..b2e5e53094 100644 --- a/src/hydro/Gadget2/hydro_part.h +++ b/src/hydro/Gadget2/hydro_part.h @@ -55,56 +55,52 @@ struct part { /* Particle density. */ float rho; - /* Derivative of the density with respect to this particle's smoothing length. - */ - float rho_dh; - /* Particle entropy. */ float entropy; - /* Derivative of the density with respect to smoothing length. */ + /* Derivative of the density with respect to smoothing length. */ float rho_dh; - union { + // union { - struct { + struct { - /* Number of neighbours. */ - float wcount; + /* Number of neighbours. */ + float wcount; - /* Number of neighbours spatial derivative. */ - float wcount_dh; + /* Number of neighbours spatial derivative. */ + float wcount_dh; - /* Particle velocity curl. */ - float rot_v[3]; + /* Particle velocity curl. */ + float rot_v[3]; - /* Particle velocity divergence. */ - float div_v; + /* Particle velocity divergence. */ + float div_v; - } density; + } density; - struct { + struct { - /* Balsara switch */ - float balsara; + /* Balsara switch */ + float balsara; - /* Pressure over density squared (including drho/dh term) */ - float P_over_rho2; + /* Pressure over density squared (including drho/dh term) */ + float P_over_rho2; - /* Particle sound speed. */ - float soundspeed; + /* Particle sound speed. */ + float soundspeed; - /* Signal velocity. */ - float v_sig; + /* Signal velocity. */ + float v_sig; - /* Entropy time derivative */ - float entropy_dt; + /* Entropy time derivative */ + float entropy_dt; - /* Time derivative of the smoothing length */ - float h_dt; + /* Time derivative of the smoothing length */ + float h_dt; - } force; - }; + } force; + // }; /* Particle ID. */ long long id; -- GitLab