mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #759 from joakim-hove/check-INIT
Regression testing on SPE1 DX, DY, DZ and DEPTH
This commit is contained in:
@@ -152,7 +152,8 @@ if (HAVE_OPM_DATA)
|
||||
if (ERT_PYTHON_PATH)
|
||||
include(OpmPythonTest)
|
||||
|
||||
opm_add_python_test( check_INIT_SPE1 ${PROJECT_SOURCE_DIR}/tests/compare_INIT.py $<TARGET_FILE:flow> ${OPM_DATA_ROOT}/spe1/SPE1CASE1.DATA ${OPM_DATA_ROOT}/spe1/eclipse-simulation/SPE1CASE1.INIT TRANX TRANY TRANZ PORO PORV PERMX )
|
||||
opm_add_python_test( check_INIT_SPE1 ${PROJECT_SOURCE_DIR}/tests/compare_INIT.py $<TARGET_FILE:flow> ${OPM_DATA_ROOT}/spe1/SPE1CASE1.DATA ${OPM_DATA_ROOT}/spe1/eclipse-simulation/SPE1CASE1.INIT
|
||||
TRANX TRANY TRANZ PORO PORV PERMX DX DY DZ DEPTH PVTNUM SATNUM EQLNUM FIPNUM )
|
||||
opm_add_python_test( check_INIT_NORNE ${PROJECT_SOURCE_DIR}/tests/compare_INIT.py $<TARGET_FILE:flow> ${OPM_DATA_ROOT}/norne/NORNE_ATW2013.DATA ${OPM_DATA_ROOT}/norne/ECL.2014.2/NORNE_ATW2013.INIT PORO PORV PERMX )
|
||||
endif()
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ from ert.test import TestAreaContext
|
||||
|
||||
|
||||
def compare_files( flow_file , ref_file , kw_list):
|
||||
abs_epsilon = 0
|
||||
rel_epsilon = 1e-2
|
||||
flow = EclFile( flow_file )
|
||||
ref = EclFile( ref_file )
|
||||
|
||||
@@ -15,8 +17,10 @@ def compare_files( flow_file , ref_file , kw_list):
|
||||
flow_kw = flow[kw][0]
|
||||
ref_kw = ref[kw][0]
|
||||
|
||||
if not flow_kw.equal_numeric( ref_kw , abs_epsilon = 0 , rel_epsilon = 1e-2):
|
||||
sys.exit("Keyword:%s was different in flow simulation and reference" % kw)
|
||||
if not flow_kw.equal_numeric( ref_kw , abs_epsilon = abs_epsilon , rel_epsilon = rel_epsilon):
|
||||
first_different = ref_kw.firstDifferent( flow_kw , abs_epsilon = abs_epsilon , rel_epsilon = rel_epsilon)
|
||||
sys.exit("Keyword:%s was different in flow simulation and reference. Index of first difference: %d" % (kw , first_different))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user