This instance will be upgraded to Heptapod 0.26.0rc1 on 2021-10-25 at 14:00 UTC+2 (a few minutes of down time)

Commit ac5d865c authored by Ashwin V. Mohanan's avatar Ashwin V. Mohanan
Browse files

Plot energy

parent 97c5aa62cccf
Pipeline #22799 passed with stage
in 14 minutes and 58 seconds
......@@ -40,7 +40,7 @@ def solve(Simul, nx, time_scheme, coef_dealiasing):
params.time_stepping.type_time_scheme = time_scheme
params.init_fields.type = "in_script"
params.output.periods_print.print_stdout = 0.5
params.output.periods_print.print_stdout = 0.1
sim = Simul(params)
......@@ -67,11 +67,14 @@ def solve(Simul, nx, time_scheme, coef_dealiasing):
sim.time_stepping.start()
E_final = sim.output.compute_energy()
ax.plot(x, sim.state.state_phys.get_var("u"))
E_final = sim.output.compute_energy()
print("Final Energy / Initial Energy =", E_final / E_initial)
sim.output.print_stdout.plot_energy()
ax2 = plt.gca()
ax2.set(yscale="log")
ax.plot(x, sim.state.state_phys.get_var("u"))
plt.show()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment