Commit ac5d865c authored by Ashwin Vishnu Mohanan's avatar Ashwin Vishnu 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): ...@@ -40,7 +40,7 @@ def solve(Simul, nx, time_scheme, coef_dealiasing):
params.time_stepping.type_time_scheme = time_scheme params.time_stepping.type_time_scheme = time_scheme
params.init_fields.type = "in_script" 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) sim = Simul(params)
...@@ -67,11 +67,14 @@ def solve(Simul, nx, time_scheme, coef_dealiasing): ...@@ -67,11 +67,14 @@ def solve(Simul, nx, time_scheme, coef_dealiasing):
sim.time_stepping.start() 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) 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() 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