From 94d7353faa01ffeba2f0282507ea022784667c24 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Sat, 1 Feb 2020 15:04:47 +0100
Subject: [PATCH] Make the disk patch example solution script use the pressure
 in the snapshots and not the internal energy.

---
 .../GravityTests/DiscPatch/HydroStatic/plotSolution.py    | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/examples/GravityTests/DiscPatch/HydroStatic/plotSolution.py b/examples/GravityTests/DiscPatch/HydroStatic/plotSolution.py
index 681f7d8ab3..b00b617655 100644
--- a/examples/GravityTests/DiscPatch/HydroStatic/plotSolution.py
+++ b/examples/GravityTests/DiscPatch/HydroStatic/plotSolution.py
@@ -62,11 +62,9 @@ def get_analytic_pressure(x):
 def get_data(name):
   file = h5py.File(name, "r")
   coords = np.array(file["/PartType0/Coordinates"])
-  rho = np.array(file["/PartType0/Density"])
-  u = np.array(file["/PartType0/InternalEnergy"])
+  rho = np.array(file["/PartType0/Densities"])
   v = np.array(file["/PartType0/Velocities"])
-
-  P = (gamma - 1.) * rho * u
+  P = np.array(file["/PartType0/Pressures"])
 
   vtot = np.sqrt( v[:,0]**2 + v[:,1]**2 + v[:,2]**2 )
 
@@ -79,7 +77,7 @@ for f in sorted(glob.glob("Disc-Patch_*.hdf5")):
   if num < start or num > stop:
     continue
 
-  print "processing", f, "..."
+  print("processing", f, "...")
 
   xrange = np.linspace(0., 2. * x_disc, 1000)
   time, x, rho, P, v = get_data(f)
-- 
GitLab