Linearised Table: Add Constructor with User-Defined Fill Value
Reimplement original constructor in terms of the new constructor. The main purpose of the new constructor is to support PVT tables which use a fill/padding value different from 1.0e+20.
This commit is contained in:
@@ -125,6 +125,48 @@ namespace {
|
||||
}
|
||||
} // Anonymous
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// Constructors
|
||||
|
||||
BOOST_AUTO_TEST_SUITE (Basic_Operations)
|
||||
|
||||
BOOST_AUTO_TEST_CASE (Construct_Defaulted_FillVal)
|
||||
{
|
||||
const auto numTables = std::size_t{2};
|
||||
const auto numPrimary = std::size_t{3};
|
||||
const auto numRows = std::size_t{4};
|
||||
const auto numCols = std::size_t{5};
|
||||
|
||||
auto linTable = ::Opm::LinearisedOutputTable {
|
||||
numTables, numPrimary, numRows, numCols
|
||||
};
|
||||
|
||||
const auto expect_initial = std::vector<double>(
|
||||
numTables * numPrimary * numRows * numCols, 1.0e20);
|
||||
|
||||
check_is_close(linTable.getData(), expect_initial);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE (Construct_UserDefined_FillVal)
|
||||
{
|
||||
const auto numTables = std::size_t{2};
|
||||
const auto numPrimary = std::size_t{3};
|
||||
const auto numRows = std::size_t{4};
|
||||
const auto numCols = std::size_t{5};
|
||||
const auto fillVal = 1.234e-5;
|
||||
|
||||
auto linTable = ::Opm::LinearisedOutputTable {
|
||||
numTables, numPrimary, numRows, numCols, fillVal
|
||||
};
|
||||
|
||||
const auto expect_initial = std::vector<double>(
|
||||
numTables * numPrimary * numRows * numCols, fillVal);
|
||||
|
||||
check_is_close(linTable.getData(), expect_initial);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END ()
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// Saturation Functions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user