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

Merge branch 'hydro-test-fixes' into 'master'

Hydro test fixes

See merge request !1623
parents 5baeeec0 7de066f8
Branches
Tags
8 merge requests!1715Update planetary strength after planetary plus's master rebase,!1693More threapool plotting tweaks,!1668before Mag.Egy in all the flavors,!1663Initial sync to work again,!1662Initial sync from previous months,!1642When searching for more particles in a ghost task we walk up the cell tree,...,!1633When searching for more particles in a ghost task we walk up the cell tree,...,!1623Hydro test fixes
......@@ -51,7 +51,7 @@ if gamma != 1.4:
"Error: SWIFT was run with the wrong adiabatic index. Should have been 1.4",
gamma,
)
exit()
exit(1)
ref = np.loadtxt("interactingBlastWaves1D_exact.txt")
......
#!/bin/bash
# Generate the initial conditions if they are not present.
# Generate the initial conditions if they are not present.
if [ ! -e glassPlane_128.hdf5 ]
then
./getGlass.sh
fi
if [ ! -e kelvinHelmholtzGrowthRate.hdf5 ]
then
echo "Generating initial conditions for the Kelvin-Helmholtz growth rate " \
......
#!/bin/bash
# Generate the initial conditions if they are not present.
# Generate the initial conditions if they are not present.
if [ ! -e glassCube_64.hdf5 ]
then
./getGlass.sh
fi
if [ ! -e kelvinHelmholtzGrowthRate.hdf5 ]
then
echo "Generating initial conditions for the Kelvin-Helmholtz growth rate " \
......
......@@ -58,25 +58,25 @@ pos = sim["/PartType0/Coordinates"][:, :]
x = pos[:, 0] - boxSize / 2
y = pos[:, 1] - boxSize / 2
vel = sim["/PartType0/Velocities"][:, :]
v_norm = sqrt(vel[:, 0] ** 2 + vel[:, 1] ** 2)
v_norm = np.sqrt(vel[:, 0] ** 2 + vel[:, 1] ** 2)
rho = sim["/PartType0/Densities"][:]
u = sim["/PartType0/InternalEnergies"][:]
S = sim["/PartType0/Entropies"][:]
P = sim["/PartType0/Pressures"][:]
# Plot the interesting quantities
plt.figure()
plt.figure(figsize=(7, 7 / 1.6))
# Azimuthal velocity profile -----------------------------
plt.subplot(231)
scatter(
plt.scatter(
pos[:, 0],
pos[:, 1],
c=vel[:, 0],
cmap="PuBu",
edgecolors="face",
s=4,
s=0.25,
vmin=-1.0,
vmax=1.0,
)
......@@ -91,7 +91,14 @@ plt.ylim(0, 1)
# Radial density profile --------------------------------
plt.subplot(232)
plt.scatter(
pos[:, 0], pos[:, 1], c=rho, cmap="PuBu", edgecolors="face", s=4, vmin=0.8, vmax=2.2
pos[:, 0],
pos[:, 1],
c=rho,
cmap="PuBu",
edgecolors="face",
s=0.25,
vmin=0.8,
vmax=2.2,
)
plt.text(0.97, 0.97, "${\\rm{Density}}$", ha="right", va="top", backgroundcolor="w")
plt.xlabel("${\\rm{Position}}~x$", labelpad=0)
......@@ -102,7 +109,7 @@ plt.ylim(0, 1)
# Radial pressure profile --------------------------------
plt.subplot(233)
plt.scatter(
pos[:, 0], pos[:, 1], c=P, cmap="PuBu", edgecolors="face", s=4, vmin=1, vmax=4
pos[:, 0], pos[:, 1], c=P, cmap="PuBu", edgecolors="face", s=0.25, vmin=1, vmax=4
)
plt.text(0.97, 0.97, "${\\rm{Pressure}}$", ha="right", va="top", backgroundcolor="w")
plt.xlabel("${\\rm{Position}}~x$", labelpad=0)
......@@ -113,7 +120,14 @@ plt.ylim(0, 1)
# Internal energy profile --------------------------------
plt.subplot(234)
plt.scatter(
pos[:, 0], pos[:, 1], c=u, cmap="PuBu", edgecolors="face", s=4, vmin=1.5, vmax=5.0
pos[:, 0],
pos[:, 1],
c=u,
cmap="PuBu",
edgecolors="face",
s=0.25,
vmin=1.5,
vmax=5.0,
)
plt.text(
0.97, 0.97, "${\\rm{Internal~energy}}$", ha="right", va="top", backgroundcolor="w"
......@@ -126,7 +140,14 @@ plt.ylim(0, 1)
# Radial entropy profile --------------------------------
plt.subplot(235)
plt.scatter(
pos[:, 0], pos[:, 1], c=S, cmap="PuBu", edgecolors="face", s=4, vmin=0.5, vmax=3.0
pos[:, 0],
pos[:, 1],
c=S,
cmap="PuBu",
edgecolors="face",
s=0.25,
vmin=0.5,
vmax=3.0,
)
plt.text(0.97, 0.97, "${\\rm{Entropy}}$", ha="right", va="top", backgroundcolor="w")
plt.xlabel("${\\rm{Position}}~x$", labelpad=0)
......
......@@ -12,4 +12,5 @@ fi
# Plot the solution
python3 plotSolution.py 100
python3 makeMovieSwiftsimIO.py
......@@ -98,9 +98,8 @@ binned_marker_size = 4
scatter_props = dict(
marker=".",
ms=1,
ms=4,
markeredgecolor="none",
alpha=0.2,
zorder=-1,
rasterized=True,
linestyle="none",
......@@ -110,7 +109,7 @@ errorbar_props = dict(color=binned_color, ms=binned_marker_size, fmt=".", lw=1.2
# Velocity profile --------------------------------
plt.subplot(231)
plt.plot(r, v, **scatter_props)
plt.plot(x, v, **scatter_props)
plt.plot(x_s, v_s, "--", color=line_color, alpha=0.8, lw=1.2)
plt.xlabel("${\\rm{Position}}~x$", labelpad=0)
plt.ylabel("${\\rm{Velocity}}~v_x$", labelpad=-4)
......@@ -119,7 +118,7 @@ plt.ylim(-1.2, 1.2)
# Density profile --------------------------------
plt.subplot(232)
plt.plot(r, rho, **scatter_props)
plt.plot(x, rho, **scatter_props)
plt.plot(x_s, rho_s, "--", color=line_color, alpha=0.8, lw=1.2)
plt.xlabel("${\\rm{Position}}~x$", labelpad=0)
plt.ylabel("${\\rm{Density}}~\\rho$", labelpad=0)
......@@ -128,7 +127,7 @@ plt.ylim(0.95, 4.4)
# Pressure profile --------------------------------
plt.subplot(233)
plt.plot(r, P, **scatter_props)
plt.plot(x, P, **scatter_props)
plt.plot(x_s, P_s, "--", color=line_color, alpha=0.8, lw=1.2)
plt.xlabel("${\\rm{Position}}~x$", labelpad=0)
plt.ylabel("${\\rm{Pressure}}~P$", labelpad=0)
......@@ -137,7 +136,7 @@ plt.ylim(-0.05, 1.8)
# Internal energy profile -------------------------
plt.subplot(234)
plt.plot(r, u, **scatter_props)
plt.plot(x, u, **scatter_props)
plt.plot(x_s, u_s, "--", color=line_color, alpha=0.8, lw=1.2)
plt.xlabel("${\\rm{Position}}~x$", labelpad=0)
plt.ylabel("${\\rm{Internal~Energy}}~u$", labelpad=0)
......@@ -146,7 +145,7 @@ plt.ylim(-0.05, 0.8)
# Entropy profile ---------------------------------
plt.subplot(235)
plt.plot(r, S, **scatter_props)
plt.plot(x, S, **scatter_props)
plt.plot(x_s, s_s, "--", color=line_color, alpha=0.8, lw=1.2)
plt.xlabel("${\\rm{Position}}~x$", labelpad=0)
plt.ylabel("${\\rm{Entropy}}~S$", labelpad=-9)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment