From 302977fbb5cefe7927bbabe94045ba58f50581a8 Mon Sep 17 00:00:00 2001 From: maggul Date: Wed, 11 Sep 2024 11:52:13 -0500 Subject: [PATCH] Formatting --- examples/arkode/CXX_manyvector/plot_sod.py | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/arkode/CXX_manyvector/plot_sod.py b/examples/arkode/CXX_manyvector/plot_sod.py index d8bc5f6dc4..7ca2690a18 100755 --- a/examples/arkode/CXX_manyvector/plot_sod.py +++ b/examples/arkode/CXX_manyvector/plot_sod.py @@ -30,7 +30,7 @@ sys.exit(msg) # read solution file, storing each line as a string in a list -with open(datafile, 'r') as file: +with open(datafile, "r") as file: lines = file.readlines() # extract header information @@ -55,15 +55,15 @@ line = (lines.pop(0)).split() t[it] = line.pop(0) for ix in range(nx): - rho[it,ix] = line.pop(0) - mx[it,ix] = line.pop(0) - my[it,ix] = line.pop(0) - mz[it,ix] = line.pop(0) - et[it,ix] = line.pop(0) + rho[it, ix] = line.pop(0) + mx[it, ix] = line.pop(0) + my[it, ix] = line.pop(0) + mz[it, ix] = line.pop(0) + et[it, ix] = line.pop(0) - gamma=1.4 - u = mx/rho - p = (gamma-1.0)*(et - (mx*mx+my*my+mz*mz)/(2.0*rho)) + gamma = 1.4 + u = mx / rho + p = (gamma - 1.0) * (et - (mx * mx + my * my + mz * mz) / (2.0 * rho)) # generate plots x = np.linspace(xl, xr, nx) @@ -87,9 +87,9 @@ ax12 = fig.add_subplot(gs[1, 2]) ax22 = fig.add_subplot(gs[2, 2]) it = 0 -ax00.plot(x, rho[it,:]) -ax10.plot(x, u[it,:]) -ax20.plot(x, p[it,:]) +ax00.plot(x, rho[it, :]) +ax10.plot(x, u[it, :]) +ax20.plot(x, p[it, :]) ax00.set_title(r"$t =$ " + repr(t[it]).zfill(3)) ax00.set_ylabel(r"$\rho$") ax10.set_ylabel(r"$v_x$") @@ -102,9 +102,9 @@ ax01.set_title(r"$t =$ " + repr(t[it]).zfill(3)) ax21.set_xlabel(r"$x$") it = nt-1 -ax02.plot(x, rho[it,:]) -ax12.plot(x, u[it,:]) -ax22.plot(x, p[it,:]) +ax02.plot(x, rho[it, :]) +ax12.plot(x, u[it, :]) +ax22.plot(x, p[it, :]) ax02.set_title(r"$t =$ " + repr(t[it]).zfill(3)) ax22.set_xlabel(r"$x$") plt.savefig("sod_frames.png")