Commit 6e583827 authored by Dion Haefner's avatar Dion Haefner

test ALL the things!

parent 0d810dba
......@@ -80,12 +80,12 @@ def evaluate(iniinfo,runtime):
data = grid.data()
iy = np.argsort(y)
y = y[iy]
head = data["head"].flatten()[iy]
k0_dorie = data["K_0"].flatten()[iy]
k0_calc = [parfun(yi)["k0"] for yi in y]
if not np.allclose(k0_dorie,k0_calc):
print("Encountered unexpected parameter values")
k0_calc = np.array([parfun(yi)["k0"] for yi in y]).flatten()
maxdiff = np.max(np.abs(k0_dorie-k0_calc))
if maxdiff > 1e-10:
print("Encountered unexpected parameter values. Maximum difference: {:.2e}".format(maxdiff))
return False
del k0_dorie
del k0_calc
......@@ -101,6 +101,7 @@ def evaluate(iniinfo,runtime):
r.integrate(t)
r_y.append(r.y[0])
r_y = np.array(r_y)
head = data["head"].flatten()[iy]
res_head = r_y - head
l2_head = np.sqrt(average_2d_mesh(tri.T,np.square(res_head),connectivity))
print("head L2 error: {:.2e}".format(float(l2_head)))
......
......@@ -28,9 +28,7 @@ def richards(y,h,jw,param):
:param float y: Current depth
:param float h: Matric head
:param float jw: Inflow at the top of the domain
:param dict param1: Set of parameters passed to :func:`k` (K0, tau, alpha, n) for y < edge
:param dict param2: Set of parameters passed to :func:`k` (K0, tau, alpha, n) for y > edge
:param float edge: Position of the edge dividing the two sets of parameters
:param callable param: Function that accepts y and returns material parameters as a dict
"""
return -1-jw/k(h,**param(y))
......
......@@ -21,6 +21,7 @@ dorie_add_system_test_dependency(dorie_muphi dorie-pfg_muphi_pfg)
dorie_add_system_test(dorie reference_2d.mini)
dorie_add_system_test(dorie reference_3d.mini)
dorie_add_system_test(dorie reference_evaporation.mini)
dorie_add_system_test(dorie reference_interpolators.mini)
# dorie pfg
dorie_add_system_test(dorie-pfg parfield.mini)
......
......@@ -2,6 +2,7 @@ set(HDF5_IS_PARALLEL @HDF5_IS_PARALLEL@)
if(NOT HDF5_IS_PARALLEL)
list(APPEND CTEST_CUSTOM_TESTS_IGNORE
"dorie-pfg_pfg_parallel"
"dorie-pfg_correlation_parallel_0000"
"dorie-pfg_correlation_parallel_0001"
)
endif()
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -13,11 +13,9 @@ time.end = 1E7
time.maxTimestep = 1E7
time.startTimestep = 1E4
adaptivity.threshold = 1E-10
adaptivity.useAdaptivity = false, true | expand distribution
grid.gridType = rectangular, gmsh | expand gridtype
grid.cells = 1 100
grid.initialLevel = 3, 0 | expand distribution
grid.initialLevel = 3
grid.gridFile = "{_asset_path}/meshes/square.msh"
boundary.file = "{_asset_path}/bcs/evaporation_2d.dat"
......@@ -26,9 +24,9 @@ parameters.arrayFile = "{_asset_path}/parfields/sand.h5", "{_asset_path}/parfiel
[_ode]
flux = 2e-7
head_abstol = 1E-5
flux_abstol = 1E-9
head_abstol = 1E-5, 1E-4 | expand gridtype
flux_abstol = 1E-9, 4E-9 | expand gridtype
[NewtonParameters]
AbsoluteLimit = 1E-10
Reduction = 1E-10
AbsoluteLimit = 1E-8
Reduction = 1E-8
......@@ -13,7 +13,7 @@ time.end = 1E7
time.maxTimestep = 1E7
time.startTimestep = 1E4
adaptivity.threshold = 1E-8
adaptivity.threshold = 1E-9
adaptivity.useAdaptivity = false, true | expand gridtype
grid.gridType = rectangular, gmsh | expand gridtype
grid.cells = 1 100
......@@ -27,8 +27,8 @@ parameters.interpolation = linear
[_ode]
flux = -3e-6
head_abstol = 1E-5
flux_abstol = 1E-8
head_abstol = 1E-5, 1E-4 | expand gridtype
flux_abstol = 1E-8, 5E-8 | expand gridtype
[NewtonParameters]
AbsoluteLimit = 1E-8
......
......@@ -15,7 +15,8 @@ time.maxTimestep = 1E5
time.startTimestep = 1E3
adaptivity.useAdaptivity = false, true | expand adaptivity
adaptivity.threshold = 1E-6
adaptivity.threshold = 1E-8
adaptivity.refinementFraction = 0.05
grid.initialLevel = 2, 0 | expand adaptivity
grid.gridType = gmsh, rectangular | expand
......@@ -24,4 +25,4 @@ grid.extensions = 1 1
grid.gridFile = "{_asset_path}/meshes/square.msh"
boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
parameters.arrayFile = "{_asset_path}/parfields/fft_2d.h5", "{_asset_path}/parfields/fft_2d_miller.h5" | expand
parameters.arrayFile = "{_asset_path}/parfields/fft_2d.h5", "{_asset_path}/parfields/fft_2d_miller.h5" | expand distribution
include ${CMAKE_BINARY_DIR}/doc/default_files/config.ini
__name = reference_interpolators
_test_command = run
_asset_path = "${CMAKE_CURRENT_LIST_DIR}"
_evaluation = reference
_reference.path = {_asset_path}/references/interpolators/
output.fileName = reference_interpolators | unique name
output.outputPath = reference_interpolators | unique name
output.verbose = 0
time.end = 1E5
time.maxTimestep = 1E5
time.startTimestep = 1E3
adaptivity.useAdaptivity = true
adaptivity.threshold = 1E-8
grid.initialLevel = 2
grid.gridType = gmsh, rectangular | expand
grid.cells = 20 20
grid.extensions = 1 1
grid.gridFile = "{_asset_path}/meshes/square.msh"
boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
parameters.arrayFile = "{_asset_path}/parfields/fft_2d_miller.h5"
parameters.interpolation = linear, cubic | expand
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
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