Skip to content
Snippets Groups Projects
Commit 94d7353f authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Make the disk patch example solution script use the pressure in the snapshots...

Make the disk patch example solution script use the pressure in the snapshots and not the internal energy.
parent 675bafff
Branches
Tags
No related merge requests found
...@@ -62,11 +62,9 @@ def get_analytic_pressure(x): ...@@ -62,11 +62,9 @@ def get_analytic_pressure(x):
def get_data(name): def get_data(name):
file = h5py.File(name, "r") file = h5py.File(name, "r")
coords = np.array(file["/PartType0/Coordinates"]) coords = np.array(file["/PartType0/Coordinates"])
rho = np.array(file["/PartType0/Density"]) rho = np.array(file["/PartType0/Densities"])
u = np.array(file["/PartType0/InternalEnergy"])
v = np.array(file["/PartType0/Velocities"]) v = np.array(file["/PartType0/Velocities"])
P = np.array(file["/PartType0/Pressures"])
P = (gamma - 1.) * rho * u
vtot = np.sqrt( v[:,0]**2 + v[:,1]**2 + v[:,2]**2 ) 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")): ...@@ -79,7 +77,7 @@ for f in sorted(glob.glob("Disc-Patch_*.hdf5")):
if num < start or num > stop: if num < start or num > stop:
continue continue
print "processing", f, "..." print("processing", f, "...")
xrange = np.linspace(0., 2. * x_disc, 1000) xrange = np.linspace(0., 2. * x_disc, 1000)
time, x, rho, P, v = get_data(f) time, x, rho, P, v = get_data(f)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment