[Flux Reconstruction] Mak ODE test print the flux reconstruction residuals

parent 6c8f552a
......@@ -122,16 +122,21 @@ def evaluate(iniinfo,runtime):
l2_flux = [np.sqrt(average(np.square(r[iy_inv]))) for r in res_flux.T]
print("flux L2 errors: {:.2e}, {:.2e}, {:.2e}".format(*l2_flux))
plt.figure()
plt.plot(y,res_flux)
plt.savefig("{}/flux_residual.png".format(iniinfo["richards.output.outputPath"]))
plt.close()
if do_flux_rt:
flux_rt = data[flux_rt_key][iy,:]
res_flux_rt = flux_rt - np.array([0.,influx,0.])[np.newaxis,:]
l2_flux_rt = [np.sqrt(average(np.square(r[iy_inv]))) for r in res_flux_rt.T]
print(flux_rt_key + " L2 errors: {:.2e}, {:.2e}, {:.2e}".format(*l2_flux_rt))
plt.figure()
plt.plot(y,res_flux)
plt.savefig("{}/flux_residual.png".format(iniinfo["richards.output.outputPath"]))
plt.close()
plt.figure()
plt.plot(y,res_flux_rt)
plt.savefig("{}/flux_rt_residual.png".format(iniinfo["richards.output.outputPath"]))
plt.close()
head_tol = 1E-5 if not "_ode.head_abstol" in iniinfo else float(iniinfo["_ode.head_abstol"])
flux_tol = abs(influx) * 1e-5 if not "_ode.flux_abstol" in iniinfo else float(iniinfo["_ode.flux_abstol"])
......
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