Skip to content
Snippets Groups Projects
Commit 4f3ada40 authored by podlesny's avatar podlesny
Browse files

plot with respect to physical time

parent 476a5c6e
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,14 @@ import matplotlib.pyplot as plt
def iterations(h5file, FINAL_TIME, interval = []):
# read time steps
# read time
time = np.array(h5file['relativeTime']) * FINAL_TIME
time = np.delete(time, 0)
if len(interval) == 0:
interval = [0, FINAL_TIME]
t = [i for i in range(len(time)) if time[i]>=interval[0] and time[i]<=interval[1]]
time = time[t]
tau = np.array(h5file['relativeTimeIncrement']) * FINAL_TIME
tau = np.delete(tau, 0)
......@@ -17,25 +24,21 @@ def iterations(h5file, FINAL_TIME, interval = []):
multigrid_final = np.delete(multigrid_final, 0)
#multigrid_total = np.array(h5file['iterations/multiGrid/total'])
if len(interval) == 0:
interval = [0, len(tau)-1]
t = np.linspace(interval[0], interval[1], interval[1]-interval[0]+1, endpoint=True, dtype='int8')
# plot
fig = plt.figure()
ax_fpi = fig.add_subplot(3, 1, 1)
ax_fpi.plot(t, fpi_final[t], color='black', linestyle='-')
ax_fpi.plot(time, fpi_final[t], color='black', linestyle='-')
ax_fpi.set_ylabel('fpi')
#-------------------------
ax_mg = fig.add_subplot(3, 1, 2)
ax_mg.plot(t, multigrid_final[t], color='black', linestyle='-')
ax_mg.plot(time, multigrid_final[t], color='black', linestyle='-')
ax_mg.set_ylabel('multigrid')
#-------------------------
ax_tau = fig.add_subplot(3, 1, 3)
ax_tau.plot(t, tau[t], color='black', linestyle='-')
ax_tau.plot(time, tau[t], color='black', linestyle='-')
ax_tau.set_ylabel('tau')
#-------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment