diff --git a/examples/HydroTests/InteractingBlastWaves_1D/plotSolution.py b/examples/HydroTests/InteractingBlastWaves_1D/plotSolution.py index 0e143567930b856cb5af5e79ca6682df9974c435..862ff3ec03655639037287c48b97c40ddbb1f062 100644 --- a/examples/HydroTests/InteractingBlastWaves_1D/plotSolution.py +++ b/examples/HydroTests/InteractingBlastWaves_1D/plotSolution.py @@ -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") diff --git a/examples/HydroTests/KelvinHelmholtzGrowthRate_2D/run.sh b/examples/HydroTests/KelvinHelmholtzGrowthRate_2D/run.sh index 479de1398092dac3fc1275ffd1fc5741ff4c8c61..d134b8be7a52fb7ad6e968d5a98d7be9499461ca 100755 --- a/examples/HydroTests/KelvinHelmholtzGrowthRate_2D/run.sh +++ b/examples/HydroTests/KelvinHelmholtzGrowthRate_2D/run.sh @@ -1,6 +1,11 @@ #!/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 " \ diff --git a/examples/HydroTests/KelvinHelmholtzGrowthRate_3D/run.sh b/examples/HydroTests/KelvinHelmholtzGrowthRate_3D/run.sh index 479de1398092dac3fc1275ffd1fc5741ff4c8c61..73f81e3da13e5395d74e9b5509a6dfd0ec31ea3e 100755 --- a/examples/HydroTests/KelvinHelmholtzGrowthRate_3D/run.sh +++ b/examples/HydroTests/KelvinHelmholtzGrowthRate_3D/run.sh @@ -1,6 +1,11 @@ #!/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 " \ diff --git a/examples/HydroTests/KelvinHelmholtz_2D/plotSolution.py b/examples/HydroTests/KelvinHelmholtz_2D/plotSolution.py index ce5a394585c0b6a07e67d0365141346f123e2f34..750dd016328dfdd44296bb400f6dc84a7e58fea5 100644 --- a/examples/HydroTests/KelvinHelmholtz_2D/plotSolution.py +++ b/examples/HydroTests/KelvinHelmholtz_2D/plotSolution.py @@ -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) diff --git a/examples/HydroTests/KelvinHelmholtz_2D/run.sh b/examples/HydroTests/KelvinHelmholtz_2D/run.sh index 583d270a7a0092f606bf782809aae66628862120..95c3076921de9fd373ed8319de34e7b8c69046f0 100755 --- a/examples/HydroTests/KelvinHelmholtz_2D/run.sh +++ b/examples/HydroTests/KelvinHelmholtz_2D/run.sh @@ -12,4 +12,5 @@ fi # Plot the solution +python3 plotSolution.py 100 python3 makeMovieSwiftsimIO.py diff --git a/examples/HydroTests/Noh_1D/plotSolution.py b/examples/HydroTests/Noh_1D/plotSolution.py index d4be4757a295fa086f00c39ad6e443c74dc63bc6..d224b7fe7bd67ac63fa172065c84dcff8a26405c 100644 --- a/examples/HydroTests/Noh_1D/plotSolution.py +++ b/examples/HydroTests/Noh_1D/plotSolution.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)