Commit 11ce4c4d authored by Lukas Riedel's avatar Lukas Riedel

Test reconstructed flux residuals on ODE system tests

Compare against a static residual of 1e-13. Meta-ini files remain
unaffected.
parent e8b7f3be
......@@ -67,7 +67,7 @@ def evaluate(iniinfo,runtime):
print("Operating on file: {}".format(vtk_file))
variables = ["head","flux","K_0","flux"]
variables = ["head", "flux", "K_0"]
if do_flux_rt:
variables.append(flux_rt_key)
grid = vtk_file.read(variables)
......@@ -127,6 +127,9 @@ def evaluate(iniinfo,runtime):
plt.savefig("{}/flux_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"])
if do_flux_rt:
flux_rt = data[flux_rt_key][iy,:]
res_flux_rt = flux_rt - np.array([0.,influx,0.])[np.newaxis,:]
......@@ -138,7 +141,11 @@ def evaluate(iniinfo,runtime):
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"])
flux_rt_tol = 1e-13 if not "_ode.flux_rt_abstol" in iniinfo else float(iniinfo["_ode.flux_rt_abstol"])
return bool(l2_head < head_tol) \
and all([l < flux_tol for l in l2_flux]) \
and all([l < flux_rt_tol for l in l2_flux_rt])
# no flux reconstruction
return bool(l2_head < head_tol) and all([l < flux_tol for l in l2_flux])
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