Skip to content
Snippets Groups Projects
plotSolution.py 1.27 KiB
###############################################################################
# This file is part of SWIFT.
# Copyright (c) 2018 Bert Vandenbroucke (bert.vandenbroucke@gmail.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

import h5py
import matplotlib
matplotlib.use("Agg")
import pylab as pl
import sys

snap = int(sys.argv[1])

sim = h5py.File("interactingBlastWaves_%04d.hdf5" % snap, "r")
coords = sim["/PartType0/Coordinates"]
rho = sim["/PartType0/Density"]

pl.xlabel("$x$")
pl.ylabel("$\\rho{}$")
pl.xlim(0.4, 1.)
pl.ylim(0., 7.)
pl.plot(coords[:,0], rho, "k.")
pl.savefig("InteractingBlastWaves.png")