Completed INTEHEAD vector-data, added LOGIHEAD vector data.

This commit is contained in:
Jostein Alvestad
2018-04-17 10:01:02 +02:00
committed by Joakim Hove
parent ce1f66b4e5
commit 17767fab3a
10 changed files with 818 additions and 490 deletions

View File

@@ -43,7 +43,7 @@ BOOST_AUTO_TEST_CASE(Dimensions_Individual)
BOOST_AUTO_TEST_CASE(Dimensions_Array)
{
const auto ih = Opm::RestartIO::InteHEAD{}
.dimensions({100, 60, 15});
.dimensions({100, 60, 15});
const auto& v = ih.data();
@@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE(Dimensions_Array)
BOOST_AUTO_TEST_CASE(NumActive)
{
const auto ih = Opm::RestartIO::InteHEAD{}
.numActive(72390);
.numActive(72390);
const auto& v = ih.data();
@@ -118,11 +118,12 @@ BOOST_AUTO_TEST_CASE(WellTableDimensions)
});
const auto& v = ih.data();
const auto nwgmax = std::max(maxWellInGroup, maxGroupInField);
BOOST_CHECK_EQUAL(v[17 - 1], numWells); // NWELLS
BOOST_CHECK_EQUAL(v[18 - 1], maxPerf); // NCWMAX
BOOST_CHECK_EQUAL(v[20 - 1], maxWellInGroup); // NWGMAX
BOOST_CHECK_EQUAL(v[21 - 1], maxGroupInField); // NGMAXZ
BOOST_CHECK_EQUAL(v[17 - 1], numWells); // NWELLS
BOOST_CHECK_EQUAL(v[18 - 1], maxPerf); // NCWMAX
BOOST_CHECK_EQUAL(v[20 - 1], nwgmax); // NWGMAX
BOOST_CHECK_EQUAL(v[21 - 1], maxGroupInField + 1); // NGMAXZ
}
BOOST_AUTO_TEST_CASE(CalendarDate)
@@ -130,7 +131,7 @@ BOOST_AUTO_TEST_CASE(CalendarDate)
// 2015-04-09T11:22:33+0000
const auto ih = Opm::RestartIO::InteHEAD{}
. calenderDate({
.calenderDate({
2015, 4, 9, 11, 22, 33
});
@@ -276,9 +277,8 @@ BOOST_AUTO_TEST_CASE(Time_and_report_step)
const auto& v = ih.data();
BOOST_CHECK_EQUAL(v[67], 12); // TSTEP
BOOST_CHECK_EQUAL(v[68], 2); // REP_STEP
BOOST_CHECK_EQUAL(v[67], 12); // TSTEP
BOOST_CHECK_EQUAL(v[68], 2); // REP_STEP
}
BOOST_AUTO_TEST_CASE(Tuning_param)
@@ -301,20 +301,22 @@ BOOST_AUTO_TEST_CASE(Tuning_param)
BOOST_CHECK_EQUAL(v[81], newtmn); // NEWTMN
BOOST_CHECK_EQUAL(v[82], litmax); // LITMAX
BOOST_CHECK_EQUAL(v[83], litmin); // LITMIN
BOOST_CHECK_EQUAL(v[84], mxwsit); // MXWSIT
BOOST_CHECK_EQUAL(v[85], mxwpit); // MXWPIT
BOOST_CHECK_EQUAL(v[86], mxwsit); // MXWSIT
BOOST_CHECK_EQUAL(v[87], mxwpit); // MXWPIT
}
BOOST_AUTO_TEST_CASE(Various_Parameters)
{
const auto ih = Opm::RestartIO::InteHEAD{}
.variousParam(100, 2, 3);
.variousParam(2015, 100);
const auto& v = ih.data();
BOOST_CHECK_EQUAL(v[ 1], 2015); // VERSION
BOOST_CHECK_EQUAL(v[ 94], 100); // IPROG
BOOST_CHECK_EQUAL(v[101], 2); // IH_101
BOOST_CHECK_EQUAL(v[103], 3); // IH_103
BOOST_CHECK_EQUAL(v[ 76], 2); // IH_076
BOOST_CHECK_EQUAL(v[101], 1); // IH_101
BOOST_CHECK_EQUAL(v[103], 1); // IH_103
}
BOOST_AUTO_TEST_CASE(wellSegDimensions)
@@ -345,24 +347,21 @@ BOOST_AUTO_TEST_CASE(wellSegDimensions)
BOOST_AUTO_TEST_CASE(regionDimensions)
{
const auto ntfip = 12;
const auto nmfipr = 22;
const auto nrfreg = 5;
const auto ntfreg = 6;
const auto nplmix = 7;
const auto ih = Opm::RestartIO::InteHEAD{}
const auto ih = Opm::RestartIO::InteHEAD{}
.regionDimensions({
ntfip, nmfipr, nrfreg, ntfreg, nplmix
ntfip, nmfipr, nrfreg, ntfreg, nplmix
});
const auto& v = ih.data();
BOOST_CHECK_EQUAL(v[88], ntfip); // NTFIP
BOOST_CHECK_EQUAL(v[99], nmfipr); // NMFIPR
BOOST_CHECK_EQUAL(v[89], ntfip); // NTFIP
BOOST_CHECK_EQUAL(v[99], nmfipr); // NMFIPR
}

56
tests/test_LogiHEAD.cpp Normal file
View File

@@ -0,0 +1,56 @@
/*
Copyright 2018 Statoil IT
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#define BOOST_TEST_MODULE LogiHEAD_Vector
#include <boost/test/unit_test.hpp>
#include <opm/output/eclipse/LogiHEAD.hpp>
BOOST_AUTO_TEST_SUITE(Member_Functions)
BOOST_AUTO_TEST_CASE(Radial_Settings_and_Init)
{
const auto e300_radial = false;
const auto e100_radial = true;
const auto lh = Opm::RestartIO::LogiHEAD{}
.variousParam(e300_radial, e100_radial, 4);
const auto& v = lh.data();
BOOST_CHECK_EQUAL(v[ 0], true); //
BOOST_CHECK_EQUAL(v[ 1], true); //
BOOST_CHECK_EQUAL(v[ 3], false); // E300 Radial
BOOST_CHECK_EQUAL(v[ 4], true); // E100 Radial
BOOST_CHECK_EQUAL(v[ 16], true); //
BOOST_CHECK_EQUAL(v[ 18], true); //
BOOST_CHECK_EQUAL(v[ 31], true); //
BOOST_CHECK_EQUAL(v[ 44], true); //
BOOST_CHECK_EQUAL(v[ 75], true); // MS Well Simulation Case
BOOST_CHECK_EQUAL(v[ 76], true); //
BOOST_CHECK_EQUAL(v[ 87], true); //
BOOST_CHECK_EQUAL(v[ 99], true); //
BOOST_CHECK_EQUAL(v[113], true); //
BOOST_CHECK_EQUAL(v[114], true); //
BOOST_CHECK_EQUAL(v[115], true); //
BOOST_CHECK_EQUAL(v[117], true); //
}
BOOST_AUTO_TEST_SUITE_END()