From 6488cfcfe5072d88cfb5323b3d04d8af3b5acf61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Kvalsvik?= Date: Tue, 1 Nov 2016 12:56:05 +0100 Subject: [PATCH 1/3] Remove weak enum Opm::Phase This weak enum is really just an alias for four other constants which in turn alias another enum. Since they're mostly used for indexing they're relaxed to constexpr ints. --- opm/autodiff/BlackoilModelBase.hpp | 6 +++--- opm/autodiff/BlackoilModelEnums.hpp | 10 ++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/opm/autodiff/BlackoilModelBase.hpp b/opm/autodiff/BlackoilModelBase.hpp index 76259d327..5fa46ff25 100644 --- a/opm/autodiff/BlackoilModelBase.hpp +++ b/opm/autodiff/BlackoilModelBase.hpp @@ -133,9 +133,9 @@ namespace Opm { SimulatorData(int num_phases); enum FipId { - FIP_AQUA = Opm::Phases::Water, - FIP_LIQUID = Opm::Phases::Oil, - FIP_VAPOUR = Opm::Phases::Gas, + FIP_AQUA = Opm::Water, + FIP_LIQUID = Opm::Oil, + FIP_VAPOUR = Opm::Gas, FIP_DISSOLVED_GAS = 3, FIP_VAPORIZED_OIL = 4, FIP_PV = 5, //< Pore volume diff --git a/opm/autodiff/BlackoilModelEnums.hpp b/opm/autodiff/BlackoilModelEnums.hpp index 65ad4f62c..97bc359ed 100644 --- a/opm/autodiff/BlackoilModelEnums.hpp +++ b/opm/autodiff/BlackoilModelEnums.hpp @@ -26,12 +26,10 @@ namespace Opm { - enum Phases { - Water = BlackoilPropsAdInterface::Water, - Oil = BlackoilPropsAdInterface::Oil , - Gas = BlackoilPropsAdInterface::Gas , - MaxNumPhases = BlackoilPropsAdInterface::MaxNumPhases - }; + constexpr const auto Water = BlackoilPropsAdInterface::Water; + constexpr const auto Oil = BlackoilPropsAdInterface::Oil; + constexpr const auto Gas = BlackoilPropsAdInterface::Gas; + constexpr const auto MaxNumPhases = BlackoilPropsAdInterface::MaxNumPhases; enum PrimalVariables { Sg = 0, From 5c308614b64994be454d8cce42279c5cd4457f70 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Thu, 3 Nov 2016 09:08:39 +0100 Subject: [PATCH 2/3] changed: drop usage of python based comparison script in polymer integration test replace with compareECL from opm-output --- jenkins/run-polymer.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/jenkins/run-polymer.sh b/jenkins/run-polymer.sh index b73ea8a4b..fb4cc01ae 100755 --- a/jenkins/run-polymer.sh +++ b/jenkins/run-polymer.sh @@ -10,7 +10,14 @@ test $? -eq 0 || exit 1 cd ../.. # Compare OPM with eclipse reference -PYTHONPATH=$WORKSPACE/$configuration/install/lib/python2.7/dist-packages/ python output_comparator/src/compare_eclipse.py polymer_test_suite/simple2D/eclipse-simulation/ polymer_test_suite/simple2D/opm-simulation/ 2D_THREEPHASE_POLY_HETER 0.0006 0.004 +compareECL=$WORKSPACE/$configuration/install/bin/compareECL +reffile=polymer_test_suite/simple2D/eclipse-simulation/2D_THREEPHASE_POLY_HETER +opmfile=polymer_test_suite/simple2D/opm-simulation/2D_THREEPHASE_POLY_HETER +$compareECL $reffile $opmfile 1.0 0.004 -k SGAS +test $? -eq 0 || exit 1 +$compareECL $reffile $opmfile 1.0 0.004 -k SWAT +test $? -eq 0 || exit 1 +$compareECL $reffile $opmfile 0.0006 1.0 -k PRESSURE test $? -eq 0 || exit 1 popd From 3607ba9127ec225fe89614db3a8ef9e9695e041c Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Thu, 3 Nov 2016 09:09:06 +0100 Subject: [PATCH 3/3] changed: drop usage of python based comparison script in spe integration tests use compareECL from opm-output instead --- jenkins/run-spe.sh | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/jenkins/run-spe.sh b/jenkins/run-spe.sh index b26ff28e9..0d25a4596 100755 --- a/jenkins/run-spe.sh +++ b/jenkins/run-spe.sh @@ -1,5 +1,14 @@ #!/bin/bash +function dotest { + $compareECL $reffile $opmfile 1.0 $1 -k SGAS + test $? -eq 0 || exit 1 + $compareECL $reffile $opmfile $2 1.0 -k SWAT + test $? -eq 0 || exit 1 + $compareECL $reffile $opmfile $2 1.0 -k PRESSURE + test $? -eq 0 || exit 1 +} + pushd . cd deps/opm-data @@ -17,20 +26,39 @@ $WORKSPACE/$configuration/build-opm-simulators/bin/flow max_iter=50 deck_filenam test $? -eq 0 || exit 1 cd .. +compareECL=$WORKSPACE/$configuration/install/bin/compareECL + # Compare OPM with eclipse reference -PYTHONPATH=$WORKSPACE/$configuration/install/lib/python2.7/dist-packages/ python output_comparator/src/compare_eclipse.py spe1/eclipse-simulation/ spe1/ SPE1CASE2 0.01 0.01 +reffile=spe1/eclipse-simulation/SPE1CASE2 +opmfile=spe1/SPE1CASE2 +dotest 0.01 0.01 +refffile=spe1/opm-simulation-reference/SPE1CASE2 test $? -eq 0 || exit 1 -PYTHONPATH=$WORKSPACE/$configuration/install/lib/python2.7/dist-packages/ python output_comparator/src/compare_eclipse.py spe3/eclipse-simulation/ spe3/ SPE3CASE1 0.02 0.02 + +reffile=spe3/eclipse-simulation/SPE3CASE1 +opmfile=spe3/SPE3CASE1 +dotest 0.02 0.02 test $? -eq 0 || exit 1 -PYTHONPATH=$WORKSPACE/$configuration/install/lib/python2.7/dist-packages/ python output_comparator/src/compare_eclipse.py spe9/eclipse-simulation/ spe9/ SPE9_CP 0.002 0.001 + +reffile=spe9/eclipse-simulation/SPE9_CP +opmfile=spe9/SPE9_CP +dotest 0.002 0.001 test $? -eq 0 || exit 1 # Compare OPM with OPM reference -PYTHONPATH=$WORKSPACE/$configuration/install/lib/python2.7/dist-packages/ python output_comparator/src/compare_eclipse.py spe1/opm-simulation-reference/ spe1/ SPE1CASE2 0.001 0.001 +reffile=spe1/opm-simulation-reference/SPE1CASE2 +opmfile=spe1/SPE1CASE2 +dotest 0.001 0.001 test $? -eq 0 || exit 1 -PYTHONPATH=$WORKSPACE/$configuration/install/lib/python2.7/dist-packages/ python output_comparator/src/compare_eclipse.py spe3/opm-simulation-reference/ spe3/ SPE3CASE1 0.001 0.001 + +reffile=spe3/opm-simulation-reference/SPE3CASE1 +opmfile=spe3/SPE3CASE1 +dotest 0.001 0.001 test $? -eq 0 || exit 1 -PYTHONPATH=$WORKSPACE/$configuration/install/lib/python2.7/dist-packages/ python output_comparator/src/compare_eclipse.py spe9/opm-simulation-reference/ spe9/ SPE9_CP 0.002 0.007 + +reffile=spe9/opm-simulation-reference/SPE9_CP +opmfile=spe9/SPE9_CP +dotest 0.002 0.007 test $? -eq 0 || exit 1 popd