From a25a70239353688b1165f525fc9dda8b2598d76a Mon Sep 17 00:00:00 2001
From: Bert Vandenbroucke <bert.vandenbroucke@ugent.be>
Date: Fri, 23 Sep 2016 08:06:16 +0200
Subject: [PATCH] Pressure is now also updated by hydro_set_internal_energy and
 hydro_set_entropy.

---
 src/hydro/Gizmo/hydro.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/hydro/Gizmo/hydro.h b/src/hydro/Gizmo/hydro.h
index a383a2fdce..bd970795bd 100644
--- a/src/hydro/Gizmo/hydro.h
+++ b/src/hydro/Gizmo/hydro.h
@@ -524,6 +524,7 @@ __attribute__((always_inline)) INLINE static void hydro_set_internal_energy(
   /* conserved.energy is NOT the specific energy (u), but the total thermal
      energy (u*m) */
   p->conserved.energy = u * p->conserved.mass;
+  p->primitives.P = hydro_gamma_minus_one * p->primitives.rho * u;
 }
 
 /**
@@ -540,4 +541,5 @@ __attribute__((always_inline)) INLINE static void hydro_set_entropy(
 
   p->conserved.energy = gas_internal_energy_from_entropy(p->primitives.rho, S) *
                         p->conserved.mass;
+  p->primitives.P = gas_pressure_from_entropy(p->primitives.rho, S);
 }
-- 
GitLab