14import matplotlib
as mpl
15import matplotlib.pyplot
as plt
16from mpl_toolkits.axes_grid1
import make_axes_locatable
17from matplotlib.colors
import LogNorm
24 "xtick.labelsize": 12,
25 "ytick.labelsize": 12,
26 "xtick.direction":
"in",
27 "ytick.direction":
"in",
30 "figure.subplot.left": 0.045,
31 "figure.subplot.right": 0.99,
32 "figure.subplot.bottom": 0.05,
33 "figure.subplot.top": 0.93,
34 "figure.subplot.wspace": 0.15,
37mpl.rcParams.update(params)
43 time = float(sys.argv[1])
45pvdfile =
"particles.pvd"
46reader = ParticleVTUReader(pvdfile=pvdfile, snapshot_time=time)
47partData = reader.load()
48time = reader.get_snapshot_time()
68 Plot the specified quantity. Options:
71 - "u" (internal energy)
80 elif quantity ==
"p" or quantity ==
"P":
89 title =
"Internal Energy "
94 alpha = 0.4 + 0.6 * qarr / qarr.max()
95 title += f
"$t=${time:.2f}"
97 fig = plt.figure(figsize=(6, 6), dpi=300)
98 ax1 = fig.add_subplot(111, projection=
"3d", aspect=
"equal")
99 ax1.set_title(title, fontsize=16)
115 s=2.0 + 4.0 * alpha / alpha.max(),
117 norm=LogNorm(vmin=minval, vmax=maxval),
124 ax1.view_init(elev=14, azim=8)
125 fig.colorbar(sc, shrink=0.8, aspect=40, pad=0.0)
132 fname = quantity +
"-" + f
"_{time}.png"
134 print(
"saved", fname)
Reads in particle fields from a single .vtu file, or all .vtu at a given snapshot time specified in t...