Remove / rename DeckItem::size()

This commit is contained in:
Joakim Hove 2019-11-16 12:23:00 +01:00
parent da625838b6
commit 6dbbc8c037
59 changed files with 155 additions and 192 deletions

View File

@ -57,7 +57,8 @@ namespace Opm {
// keywords like e.g. SGL), then the remaining values are defaulted. The deck
// creates the defaulted items if all their sizes are fully specified by the
// keyword, though...
size_t size() const;
size_t data_size() const;
size_t out_size() const;
template<typename T>

View File

@ -195,7 +195,7 @@ namespace Opm {
size_t regionIdx = 0;
size_t tableIdx = 0;
for (unsigned lineIdx = 0; lineIdx < numEntries; ++lineIdx) {
if (keyword.getRecord(lineIdx).getItem("PRESSURE").size() > 0) {
if (keyword.getRecord(lineIdx).getItem("PRESSURE").hasValue(0)) {
rocktable[regionIdx].init(keyword.getRecord(lineIdx), tableIdx);
tableIdx++;
} else { // next region
@ -227,8 +227,8 @@ namespace Opm {
const auto& tableKeyword = deck.getKeyword(keywordName);
for (size_t tableIdx = 0; tableIdx < tableKeyword.size(); ++tableIdx) {
const auto& dataItem = tableKeyword.getRecord( tableIdx ).getItem( 0 );
if (dataItem.size() > 0) {
const auto& dataItem = tableKeyword.getRecord( tableIdx ).getItem("DATA");
if (dataItem.data_size() > 0) {
std::shared_ptr<TableType> table = std::make_shared<TableType>( dataItem, useJFunc() );
container.addTable( tableIdx , table );
}
@ -254,8 +254,8 @@ namespace Opm {
const auto& tableKeyword = deck.getKeyword(keywordName);
for (size_t tableIdx = 0; tableIdx < tableKeyword.size(); ++tableIdx) {
const auto& dataItem = tableKeyword.getRecord( tableIdx ).getItem( 0 );
if (dataItem.size() > 0) {
const auto& dataItem = tableKeyword.getRecord( tableIdx ).getItem("DATA");
if (dataItem.data_size() > 0) {
std::shared_ptr<TableType> table = std::make_shared<TableType>( dataItem );
container.addTable( tableIdx , table );
}
@ -293,8 +293,8 @@ namespace Opm {
const auto& tableKeyword = deck.getKeyword(keywordName);
for (size_t tableIdx = 0; tableIdx < tableKeyword.size(); ++tableIdx) {
const auto& dataItem = tableKeyword.getRecord( tableIdx ).getItem( 0 );
if (dataItem.size() == 0) {
const auto& dataItem = tableKeyword.getRecord( tableIdx ).getItem("DATA");
if (dataItem.data_size() == 0) {
// for simple tables, an empty record indicates that the previous table
// should be copied...
if (tableIdx == 0) {

View File

@ -185,7 +185,7 @@ void python::common::export_DeckKeyword(py::module& module) {
py::class_< DeckItem >(module, "DeckItem")
.def( "__len__", &DeckItem::size )
.def( "__len__", &DeckItem::data_size )
.def("get_str", &DeckItem::get<std::string>)
.def("get_int", &DeckItem::get<int>)
.def("get_raw", &DeckItem::get<double>)

View File

@ -118,7 +118,7 @@ bool DeckItem::hasValue( size_t index ) const {
}
}
size_t DeckItem::size() const {
size_t DeckItem::data_size() const {
switch( this->type ) {
case type_tag::integer: return this->ival.size();
case type_tag::fdouble: return this->dval.size();
@ -128,8 +128,9 @@ size_t DeckItem::size() const {
}
}
size_t DeckItem::out_size() const {
size_t data_size = this->size();
size_t data_size = this->data_size();
return std::max( data_size , this->defaulted.size() );
}
@ -365,7 +366,7 @@ bool DeckItem::equal(const DeckItem& other, bool cmp_default, bool cmp_numeric)
if (this->type != other.type)
return false;
if (this->size() != other.size())
if (this->data_size() != other.data_size())
return false;
if (this->item_name != other.item_name)

View File

@ -237,7 +237,7 @@ namespace Opm {
size_t DeckKeyword::getDataSize() const {
return this->getDataRecord().getDataItem().size();
return this->getDataRecord().getDataItem().data_size();
}

View File

@ -246,7 +246,7 @@ namespace Opm {
template< typename T >
void GridProperty< T >::loadFromDeckKeyword( const DeckKeyword& deckKeyword, bool multiply ) {
const auto& deckItem = getDeckItem(deckKeyword);
const auto size = deckItem.size();
const auto size = deckItem.data_size();
for (size_t dataPointIdx = 0; dataPointIdx < size; ++dataPointIdx) {
if (!deckItem.defaultApplied(dataPointIdx)) {
if (multiply)
@ -266,10 +266,10 @@ namespace Opm {
else {
const auto& deckItem = getDeckItem(deckKeyword);
const std::vector<size_t>& indexList = inputBox.getIndexList();
if (indexList.size() == deckItem.size()) {
if (indexList.size() == deckItem.data_size()) {
for (size_t sourceIdx = 0; sourceIdx < indexList.size(); sourceIdx++) {
size_t targetIdx = indexList[sourceIdx];
if (sourceIdx < deckItem.size()
if (sourceIdx < deckItem.data_size()
&& !deckItem.defaultApplied(sourceIdx))
{
if (multiply)
@ -280,7 +280,7 @@ namespace Opm {
}
} else {
std::string boxSize = std::to_string(static_cast<long long>(indexList.size()));
std::string keywordSize = std::to_string(static_cast<long long>(deckItem.size()));
std::string keywordSize = std::to_string(static_cast<long long>(deckItem.data_size()));
throw std::invalid_argument("Size mismatch: Box:" + boxSize + " DeckKeyword:" + keywordSize);
}
@ -397,9 +397,9 @@ namespace Opm {
const auto& deckItem = deckKeyword.getRecord(0).getItem(0);
if (deckItem.size() > m_data.size())
if (deckItem.data_size() > m_data.size())
throw std::invalid_argument("Size mismatch when setting data for:" + getKeywordName()
+ " keyword size: " + std::to_string( deckItem.size() )
+ " keyword size: " + std::to_string( deckItem.data_size() )
+ " input size: " + std::to_string( m_data.size()) );
return deckItem;

View File

@ -439,8 +439,9 @@ void RestartConfig::handleScheduleSection(const SCHEDULESection& schedule, const
continue;
}
if( name == "TSTEP" ) {
current_step += keyword.getRecord( 0 ).getItem( 0 ).size();
if( name == "TSTEP" ) {
current_step += keyword.getRecord( 0 ).getItem( 0 ).data_size();
continue;
}
@ -668,7 +669,7 @@ void RestartConfig::handleScheduleSection(const SCHEDULESection& schedule, const
const auto& item = record.getItem(0);
for (size_t index = 0; index < item.size(); ++index) {
for (size_t index = 0; index < item.data_size(); ++index) {
const std::string& mnemonic = item.get< std::string >(index);
found_mnemonic_RESTART = mnemonic.find("RESTART=");
@ -685,7 +686,7 @@ void RestartConfig::handleScheduleSection(const SCHEDULESection& schedule, const
Restart integer switch is integer control nr 7 */
if (found_mnemonic_RESTART == std::string::npos) {
if (item.size() >= 7) {
if (item.data_size() >= 7) {
const std::string& integer_control = item.get< std::string >(6);
try {
restart = boost::lexical_cast<size_t>(integer_control);

View File

@ -112,14 +112,14 @@ WellSegmentDims::WellSegmentDims(const Deck& deck) : WellSegmentDims()
}
}
EclHysterConfig::EclHysterConfig(const Opm::Deck& deck)
EclHysterConfig::EclHysterConfig(const Opm::Deck& deck)
{
if (!deck.hasKeyword("SATOPTS"))
return;
const auto& satoptsItem = deck.getKeyword("SATOPTS").getRecord(0).getItem(0);
for (unsigned i = 0; i < satoptsItem.size(); ++i) {
for (unsigned i = 0; i < satoptsItem.data_size(); ++i) {
std::string satoptsValue = satoptsItem.get< std::string >(0);
std::transform(satoptsValue.begin(),
satoptsValue.end(),

View File

@ -253,7 +253,7 @@ namespace {
else if (keyword.name() == "TSTEP") {
checkIfAllConnectionsIsShut(currentStep);
currentStep += keyword.getRecord(0).getItem(0).size(); // This is a bit weird API.
currentStep += keyword.getRecord(0).getItem(0).data_size(); // This is a bit weird API.
}
else if (keyword.name() == "UDQ")

View File

@ -198,7 +198,7 @@ namespace {
{
const auto &item = TSTEPKeyword.getRecord(0).getItem(0);
for (size_t itemIndex = 0; itemIndex < item.size(); itemIndex++) {
for (size_t itemIndex = 0; itemIndex < item.data_size(); itemIndex++) {
const int64_t seconds = static_cast<int64_t>(item.getSIDouble(itemIndex));
addTStep(seconds);
}

View File

@ -37,8 +37,8 @@ namespace {
template <typename T>
inline const Opm::DeckItem& getNonEmptyItem( const Opm::DeckRecord& record) {
const auto& retval = record.getItem<T>();
if (retval.size() == 0) {
throw std::invalid_argument("Zero-sized record found where non-empty record expected");
if (!retval.hasValue(0)) {
throw std::invalid_argument("Missing data");
}
return retval;
}

View File

@ -440,7 +440,7 @@ inline void keywordR2R( SummaryConfig::keyword_list& /* list */,
const auto& item = keyword.getDataRecord().getDataItem();
std::vector<int> regions;
if (item.size() > 0)
if (item.data_size() > 0)
regions = item.getData< int >();
else {
for (size_t region=1; region <= numfip; region++)

View File

@ -131,7 +131,7 @@ namespace Opm {
size_t recordIndex = 0;
while (recordIndex < keyword.size()) {
const auto& item = keyword.getRecord(recordIndex).getItem(0);
if (item.size( ) == 0) {
if (!item.hasValue(0)) {
ranges.push_back( std::make_pair( startRecord , recordIndex ) );
startRecord = recordIndex + 1;
}

View File

@ -75,11 +75,11 @@ namespace Opm {
void SimpleTable::init( const DeckItem& deckItem ) {
this->addColumns();
if ( (deckItem.size() % numColumns()) != 0)
if ( (deckItem.data_size() % numColumns()) != 0)
throw std::runtime_error("Number of columns in the data file is"
"inconsistent with the ones specified");
size_t rows = deckItem.size() / numColumns();
size_t rows = deckItem.data_size() / numColumns();
for (size_t colIdx = 0; colIdx < numColumns(); ++colIdx) {
auto& column = getColumn( colIdx );
for (size_t rowIdx = 0; rowIdx < rows; rowIdx++) {

View File

@ -412,7 +412,7 @@ namespace Opm {
for (size_t tableIdx = 0; tableIdx < tableKeyword.size(); ++tableIdx) {
const auto& tableRecord = tableKeyword.getRecord( tableIdx );
const auto& dataItem = tableRecord.getItem( 0 );
if (dataItem.size() > 0) {
if (dataItem.data_size() > 0) {
std::shared_ptr<GasvisctTable> table = std::make_shared<GasvisctTable>( deck , dataItem );
container.addTable( tableIdx , table );
}
@ -444,7 +444,7 @@ namespace Opm {
const auto& indexRecord = tableKeyword.getRecord( tableIdx );
const auto& dataRecord = tableKeyword.getRecord( tableIdx + 1);
const auto& dataItem = dataRecord.getItem( 0 );
if (dataItem.size() > 0) {
if (dataItem.data_size() > 0) {
std::shared_ptr<PlyshlogTable> table = std::make_shared<PlyshlogTable>(indexRecord , dataRecord);
container.addTable( tableIdx , table );
}
@ -600,7 +600,7 @@ namespace Opm {
for (size_t tableIdx = 0; tableIdx < rocktabKeyword.size(); ++tableIdx) {
const auto& tableRecord = rocktabKeyword.getRecord( tableIdx );
const auto& dataItem = tableRecord.getItem( 0 );
if (dataItem.size() > 0) {
if (dataItem.data_size() > 0) {
std::shared_ptr<RocktabTable> table = std::make_shared<RocktabTable>( dataItem , isDirectional, useStressOption );
container.addTable( tableIdx , table );
}

View File

@ -702,11 +702,11 @@ GasvisctTable::GasvisctTable( const Deck& deck, const DeckItem& deckItem ) {
SimpleTable::addColumns();
if ( deckItem.size() % numColumns() != 0)
if ( deckItem.data_size() % numColumns() != 0)
throw std::runtime_error("Number of columns in the data file is inconsistent "
"with the expected number for keyword GASVISCT");
size_t rows = deckItem.size() / m_schema.size();
size_t rows = deckItem.data_size() / m_schema.size();
for (size_t columnIndex=0; columnIndex < m_schema.size(); columnIndex++) {
auto& column = getColumn( columnIndex );
for (size_t rowIdx = 0; rowIdx < rows; rowIdx++) {

View File

@ -1,7 +1,7 @@
{"name" : "ALKADS" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Density" , "1"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "ALPOLADS" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Density" , "1"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "ALSURFAD" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Density" , "1"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "ALSURFST" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "TABDIMS" , "item" : "NTPVT"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Density" , "1"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "AQUTAB" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "AQUDIMS" , "item" : "NIFTBL", "shift" : -1},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["1" , "1"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "COALADS" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "REGDIMS" , "item" : "NTCREG"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["1", "1", "1"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "COALPP" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "REGDIMS" , "item" : "NTCREG"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["1", "1", "1"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "ESSNODE" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "TABDIMS" , "item" : "NTPVT"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Density"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "FHERCHBL" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "NNEWTF" , "item" : "NTHRBL"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Density" , "1", "1", "Pressure"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "FOAMDCYO" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["1", "Time"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "FOAMDCYW" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["1", "Time"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "FOAMFCN" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["1", "1"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "FOAMFRM" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["1"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "FOAMFSO" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["1", "1"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "FOAMFST" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["FoamDensity", "SurfaceTension"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "FOAMFSW" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["1", "1"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "FOAMMOBP" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "TABDIMS" , "item" : "NTPVT"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Pressure", "1"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "FOAMMOBS" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "TABDIMS" , "item" : "NTPVT"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Length/Time", "1"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "GCVD" ,
"sections" : ["SOLUTION"],
"size" : {"keyword" : "EQLDIMS" , "item" : "NTEQUL"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Length" , "GasSurfaceVolume/Length*Length*Length"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "GINODE" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "TABDIMS" , "item" : "NTPVT"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["1"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "HDISP" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "TABDIMS" , "item" : "NTPVT"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Length" , "Length"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "IMPCVD" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "ENDSCALE" , "item" : "NTENDP"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Length" , "Pressure", "Pressure"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "IMSPCVD" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "ENDSCALE" , "item" : "NTENDP"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Length" , "1", "1"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "LANGMUIR" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "REGDIMS" , "item" : "NTCREG"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Pressure", "GasSurfaceVolume/Length*Length*Length", "GasSurfaceVolume/Length*Length*Length"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "LANGSOLV" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "REGDIMS" , "item" : "NTCREG"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Pressure", "GasSurfaceVolume/Length*Length*Length"]}]}

View File

@ -1,7 +1,7 @@
{"name" : "LSALTFNC" ,
"sections" : ["PROPS"],
"size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Pressure", "1", "1"]}]}

View File

@ -1,5 +1,5 @@
{"name" : "MSFN" , "sections" : ["PROPS"], "size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"},
"items" : [
{"name":"table", "value_type":"DOUBLE", "size_type" : "ALL", "dimension" : ["1","1","1"]}
{"name":"DATA", "value_type":"DOUBLE", "size_type" : "ALL", "dimension" : ["1","1","1"]}
]
}

View File

@ -1,5 +1,5 @@
{"name" : "OVERBURD" , "sections" : ["PROPS"], "size" : {"keyword" : "ROCKCOMP" , "item" : "NTROCC"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Length" , "Pressure"]}]}

View File

@ -1,5 +1,5 @@
{"name" : "PBVD" , "sections" : ["SOLUTION"], "size" : {"keyword" : "EQLDIMS" , "item" : "NTEQUL"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Length" , "Pressure"]}]}

View File

@ -1,5 +1,5 @@
{"name" : "PDVD" , "sections" : ["SOLUTION"], "size" : {"keyword" : "EQLDIMS" , "item" : "NTEQUL"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Length" , "Pressure"]}]}

View File

@ -12,7 +12,7 @@
"PEGTAB7"
],
"size" : {"keyword" : "PEDIMS" , "item" : "NUM_REGIONS"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Pressure" , "Pressure"]}]}

View File

@ -12,7 +12,7 @@
"PEKTAB7"
],
"size" : {"keyword" : "PEDIMS" , "item" : "NUM_REGIONS"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Pressure" , "Pressure"]}]}

View File

@ -1,4 +1,4 @@
{"name" : "PVDG" , "sections" : ["PROPS"], "size" : {"keyword" : "TABDIMS" , "item" : "NTPVT"} , "items" : [
{"name" : "data" , "size_type" : "ALL" , "value_type" : "DOUBLE" , "dimension" : ["Pressure","OilDissolutionFactor","Viscosity"]}]}
{"name" : "DATA" , "size_type" : "ALL" , "value_type" : "DOUBLE" , "dimension" : ["Pressure","OilDissolutionFactor","Viscosity"]}]}

View File

@ -1,2 +1,2 @@
{"name" : "PVDO" , "sections" : ["PROPS"], "size" : {"keyword" : "TABDIMS" , "item" : "NTPVT"} , "items" : [
{"name" : "data" , "size_type" : "ALL" , "value_type" : "DOUBLE" , "dimension" : ["Pressure","1","Viscosity"]}]}
{"name" : "DATA" , "size_type" : "ALL" , "value_type" : "DOUBLE" , "dimension" : ["Pressure","1","Viscosity"]}]}

View File

@ -1,4 +1,4 @@
{"name" : "PVDS" , "sections" : ["PROPS"], "size" : {"keyword" : "TABDIMS" , "item" : "NTPVT"} , "items" : [
{"name" : "data" , "size_type" : "ALL" , "value_type" : "DOUBLE" , "dimension" : ["Pressure","OilDissolutionFactor","Viscosity"]}]}
{"name" : "DATA" , "size_type" : "ALL" , "value_type" : "DOUBLE" , "dimension" : ["Pressure","OilDissolutionFactor","Viscosity"]}]}

View File

@ -1,5 +1,5 @@
{"name" : "ROCKWNOD" , "sections" : ["PROPS"], "size" : {"keyword" : "ROCKCOMP" , "item" : "NTROCC"},
"items" : [
{"name":"SATURATION", "value_type" : "DOUBLE", "size_type" : "ALL", "dimension":"1" }
{"name":"DATA", "value_type" : "DOUBLE", "size_type" : "ALL", "dimension":"1" }
]
}

View File

@ -1,5 +1,5 @@
{"name" : "RSVD" , "sections" : ["SOLUTION"], "size" : {"keyword" : "EQLDIMS" , "item" : "NTEQUL"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Length" , "GasDissolutionFactor"]}]}

View File

@ -1,5 +1,5 @@
{"name" : "RVVD" , "sections" : ["SOLUTION"], "size" : {"keyword" : "EQLDIMS" , "item" : "NTEQUL"},
"items" : [{"name" : "table" ,
"items" : [{"name" : "DATA" ,
"value_type" : "DOUBLE" ,
"size_type" : "ALL",
"dimension" : ["Length" , "OilDissolutionFactor"]}]}

View File

@ -1,5 +1,5 @@
{"name" : "SGOF" , "sections" : ["PROPS"], "size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"},
"items" : [
{"name":"table", "value_type":"DOUBLE", "size_type" : "ALL", "dimension" : ["1","1","1","Pressure"]}
{"name":"DATA", "value_type":"DOUBLE", "size_type" : "ALL", "dimension" : ["1","1","1","Pressure"]}
]
}

View File

@ -6,7 +6,7 @@
"keyword":"EQLDIMS" , "item":"NTTRVD"
},
"items" : [{
"name" : "table",
"name" : "DATA",
"value_type" : "DOUBLE",
"size_type" : "ALL",
"dimension" : ["Length" , "1"]

View File

@ -164,10 +164,10 @@ BOOST_AUTO_TEST_CASE(set_and_get_data_file) {
BOOST_AUTO_TEST_CASE(DummyDefaultsString) {
DeckItem deckStringItem("TEST", std::string() );
BOOST_CHECK_EQUAL(deckStringItem.size(), 0);
BOOST_CHECK_EQUAL(deckStringItem.data_size(), 0);
deckStringItem.push_backDummyDefault();
BOOST_CHECK_EQUAL(deckStringItem.size(), 0);
BOOST_CHECK_EQUAL(deckStringItem.data_size(), 0);
BOOST_CHECK_EQUAL(true, deckStringItem.defaultApplied(0));
BOOST_CHECK_THROW(deckStringItem.get< std::string >(0), std::out_of_range);
}
@ -182,31 +182,31 @@ BOOST_AUTO_TEST_CASE(GetStringAtIndex_NoData_ExceptionThrown) {
BOOST_AUTO_TEST_CASE(size_variouspushes_sizecorrect) {
DeckItem deckStringItem( "TEST", std::string() );
BOOST_CHECK_EQUAL(0U, deckStringItem.size());
BOOST_CHECK_EQUAL(0U, deckStringItem.data_size());
deckStringItem.push_back("WELL-3");
BOOST_CHECK_EQUAL(1U, deckStringItem.size());
BOOST_CHECK_EQUAL(1U, deckStringItem.data_size());
deckStringItem.push_back("WELL-4");
deckStringItem.push_back("WELL-5");
BOOST_CHECK_EQUAL(3U, deckStringItem.size());
BOOST_CHECK_EQUAL(3U, deckStringItem.data_size());
}
BOOST_AUTO_TEST_CASE(DefaultNotAppliedString) {
DeckItem deckStringItem( "TEST", std::string() );
BOOST_CHECK( deckStringItem.size() == 0 );
BOOST_CHECK( deckStringItem.data_size() == 0 );
deckStringItem.push_back( "FOO") ;
BOOST_CHECK( deckStringItem.size() == 1 );
BOOST_CHECK( deckStringItem.data_size() == 1 );
BOOST_CHECK( deckStringItem.get< std::string >(0) == "FOO" );
BOOST_CHECK( !deckStringItem.defaultApplied(0) );
}
BOOST_AUTO_TEST_CASE(DefaultAppliedString) {
DeckItem deckStringItem( "TEST", std::string() );
BOOST_CHECK( deckStringItem.size() == 0 );
BOOST_CHECK( deckStringItem.data_size() == 0 );
deckStringItem.push_backDefault( "FOO" );
BOOST_CHECK( deckStringItem.size() == 1 );
BOOST_CHECK( deckStringItem.data_size() == 1 );
BOOST_CHECK( deckStringItem.get< std::string >(0) == "FOO" );
BOOST_CHECK( deckStringItem.defaultApplied(0) );
}
@ -215,7 +215,7 @@ BOOST_AUTO_TEST_CASE(DefaultAppliedString) {
BOOST_AUTO_TEST_CASE(PushBackMultipleString) {
DeckItem stringItem( "TEST", std::string() );
stringItem.push_back("Heisann ", 100U );
BOOST_CHECK_EQUAL( 100U , stringItem.size() );
BOOST_CHECK_EQUAL( 100U , stringItem.data_size() );
for (size_t i=0; i < 100; i++)
BOOST_CHECK_EQUAL("Heisann " , stringItem.get< std::string >(i));
}
@ -236,13 +236,13 @@ BOOST_AUTO_TEST_CASE(sizeDouble_correct) {
auto dims = make_dims();
DeckItem deckDoubleItem( "TEST", double(), dims.first, dims.second);
BOOST_CHECK_EQUAL( 0U , deckDoubleItem.size());
BOOST_CHECK_EQUAL( 0U , deckDoubleItem.data_size());
deckDoubleItem.push_back( 100.0 );
BOOST_CHECK_EQUAL( 1U , deckDoubleItem.size());
BOOST_CHECK_EQUAL( 1U , deckDoubleItem.data_size());
deckDoubleItem.push_back( 100.0 );
deckDoubleItem.push_back( 100.0 );
BOOST_CHECK_EQUAL( 3U , deckDoubleItem.size());
BOOST_CHECK_EQUAL( 3U , deckDoubleItem.data_size());
}
@ -250,28 +250,28 @@ BOOST_AUTO_TEST_CASE(sizeDouble_correct) {
BOOST_AUTO_TEST_CASE(SetInDeck) {
auto dims = make_dims();
DeckItem deckDoubleItem( "TEST", double(), dims.first, dims.second);
BOOST_CHECK( deckDoubleItem.size() == 0 );
BOOST_CHECK( deckDoubleItem.data_size() == 0 );
deckDoubleItem.push_backDefault( 1.0 );
BOOST_CHECK( deckDoubleItem.size() == 1 );
BOOST_CHECK( deckDoubleItem.data_size() == 1 );
BOOST_CHECK_EQUAL( true , deckDoubleItem.defaultApplied(0) );
deckDoubleItem.push_back( 10.0 );
BOOST_CHECK( deckDoubleItem.size() == 2 );
BOOST_CHECK( deckDoubleItem.data_size() == 2 );
BOOST_CHECK_EQUAL( false , deckDoubleItem.defaultApplied(1) );
deckDoubleItem.push_backDefault( 1.0 );
BOOST_CHECK( deckDoubleItem.size() == 3 );
BOOST_CHECK( deckDoubleItem.data_size() == 3 );
BOOST_CHECK_EQUAL( true , deckDoubleItem.defaultApplied(2) );
}
BOOST_AUTO_TEST_CASE(DummyDefaultsDouble) {
auto dims = make_dims();
DeckItem deckDoubleItem( "TEST", double(), dims.first, dims.second);
BOOST_CHECK_EQUAL(deckDoubleItem.size(), 0);
BOOST_CHECK_EQUAL(deckDoubleItem.data_size(), 0);
deckDoubleItem.push_backDummyDefault();
BOOST_CHECK_EQUAL(deckDoubleItem.size(), 0);
BOOST_CHECK_EQUAL(deckDoubleItem.data_size(), 0);
BOOST_CHECK_EQUAL(true, deckDoubleItem.defaultApplied(0));
BOOST_CHECK_THROW(deckDoubleItem.get< double >(0), std::out_of_range);
}
@ -280,7 +280,7 @@ BOOST_AUTO_TEST_CASE(PushBackMultipleDouble) {
auto dims = make_dims();
DeckItem item( "HEI", double() , dims.first, dims.second);
item.push_back(10.22 , 100 );
BOOST_CHECK_EQUAL( 100U , item.size() );
BOOST_CHECK_EQUAL( 100U , item.data_size() );
for (size_t i=0; i < 100; i++)
BOOST_CHECK_EQUAL(10.22 , item.get< double >(i));
}
@ -342,10 +342,10 @@ BOOST_AUTO_TEST_CASE(HasValue) {
BOOST_AUTO_TEST_CASE(DummyDefaultsInt) {
DeckItem deckIntItem( "TEST", int() );
BOOST_CHECK_EQUAL(deckIntItem.size(), 0);
BOOST_CHECK_EQUAL(deckIntItem.data_size(), 0);
deckIntItem.push_backDummyDefault();
BOOST_CHECK_EQUAL(deckIntItem.size(), 0);
BOOST_CHECK_EQUAL(deckIntItem.data_size(), 0);
BOOST_CHECK_EQUAL(true, deckIntItem.defaultApplied(0));
BOOST_CHECK_EQUAL( false , deckIntItem.hasValue(0));
BOOST_CHECK_EQUAL( false , deckIntItem.hasValue(1));
@ -361,27 +361,27 @@ BOOST_AUTO_TEST_CASE(GetIntAtIndex_NoData_ExceptionThrown) {
BOOST_AUTO_TEST_CASE(InitializeDefaultApplied) {
DeckItem deckIntItem( "TEST", int() );
BOOST_CHECK( deckIntItem.size() == 0 );
BOOST_CHECK( deckIntItem.data_size() == 0 );
}
BOOST_AUTO_TEST_CASE(size_correct) {
DeckItem deckIntItem( "TEST", int() );
BOOST_CHECK_EQUAL( 0U , deckIntItem.size());
BOOST_CHECK_EQUAL( 0U , deckIntItem.data_size());
deckIntItem.push_back( 100 );
BOOST_CHECK_EQUAL( 1U , deckIntItem.size());
BOOST_CHECK_EQUAL( 1U , deckIntItem.data_size());
deckIntItem.push_back( 100 );
deckIntItem.push_back( 100 );
BOOST_CHECK_EQUAL( 3U , deckIntItem.size());
BOOST_CHECK_EQUAL( 3U , deckIntItem.data_size());
}
BOOST_AUTO_TEST_CASE(DefaultNotAppliedInt) {
DeckItem deckIntItem( "TEST", int() );
BOOST_CHECK( deckIntItem.size() == 0 );
BOOST_CHECK( deckIntItem.data_size() == 0 );
deckIntItem.push_back( 100 );
BOOST_CHECK( deckIntItem.size() == 1 );
BOOST_CHECK( deckIntItem.data_size() == 1 );
BOOST_CHECK( deckIntItem.get< int >(0) == 100 );
BOOST_CHECK( !deckIntItem.defaultApplied(0) );
@ -403,24 +403,24 @@ BOOST_AUTO_TEST_CASE(UseDefault) {
BOOST_AUTO_TEST_CASE(DefaultAppliedInt) {
DeckItem deckIntItem( "TEST", int() );
BOOST_CHECK( deckIntItem.size() == 0 );
BOOST_CHECK( deckIntItem.data_size() == 0 );
deckIntItem.push_backDefault( 100 );
BOOST_CHECK( deckIntItem.size() == 1 );
BOOST_CHECK( deckIntItem.data_size() == 1 );
BOOST_CHECK( deckIntItem.get< int >(0) == 100 );
BOOST_CHECK( deckIntItem.defaultApplied(0) );
deckIntItem.push_back( 10 );
BOOST_CHECK_EQUAL( false, deckIntItem.defaultApplied(1) );
deckIntItem.push_backDefault( 1 );
BOOST_CHECK_EQUAL( true , deckIntItem.defaultApplied(2) );
BOOST_CHECK_EQUAL( 3 , deckIntItem.size() );
BOOST_CHECK_EQUAL( 3 , deckIntItem.data_size() );
}
BOOST_AUTO_TEST_CASE(PushBackMultipleInt) {
DeckItem item( "HEI", int() );
item.push_back(10 , 100U );
BOOST_CHECK_EQUAL( 100U , item.size() );
BOOST_CHECK_EQUAL( 100U , item.data_size() );
for (size_t i=0; i < 100; i++)
BOOST_CHECK_EQUAL(10 , item.get< int >(i));
}

View File

@ -648,7 +648,7 @@ BOOST_AUTO_TEST_CASE(Scan_All_CorrectIntSetInDeckItem) {
RawRecord rawRecord( "100 443 10*77 10*1 25" );
UnitSystem unit_system;
const auto deckIntItem = itemInt.scan(rawRecord, unit_system, unit_system);
BOOST_CHECK_EQUAL(23U, deckIntItem.size());
BOOST_CHECK_EQUAL(23U, deckIntItem.data_size());
BOOST_CHECK_EQUAL(77, deckIntItem.get< int >(3));
BOOST_CHECK_EQUAL(1, deckIntItem.get< int >(21));
BOOST_CHECK_EQUAL(25, deckIntItem.get< int >(22));
@ -662,7 +662,7 @@ BOOST_AUTO_TEST_CASE(Scan_All_WithDefaults) {
RawRecord rawRecord( "100 10* 10*1 25" );
UnitSystem unit_system;
const auto deckIntItem = itemInt.scan(rawRecord, unit_system, unit_system);
BOOST_CHECK_EQUAL(22U, deckIntItem.size());
BOOST_CHECK_EQUAL(22U, deckIntItem.data_size());
BOOST_CHECK(!deckIntItem.defaultApplied(0));
BOOST_CHECK( deckIntItem.defaultApplied(1));
BOOST_CHECK(!deckIntItem.defaultApplied(11));
@ -848,7 +848,7 @@ BOOST_AUTO_TEST_CASE(scan_all_valuesCorrect) {
UnitSystem unit_system;
itemString.setSizeType( ParserItem::item_size::ALL );
const auto deckItem = itemString.scan(rawRecord, unit_system, unit_system);
BOOST_CHECK_EQUAL(8U, deckItem.size());
BOOST_CHECK_EQUAL(8U, deckItem.data_size());
BOOST_CHECK_EQUAL("WELL1", deckItem.get< std::string >(0));
BOOST_CHECK_EQUAL("FISK", deckItem.get< std::string >(1));
@ -868,7 +868,7 @@ BOOST_AUTO_TEST_CASE(scan_all_withdefaults) {
itemString.setSizeType( ParserItem::item_size::ALL );
const auto deckItem = itemString.scan(rawRecord, unit_system, unit_system);
BOOST_CHECK_EQUAL(30U, deckItem.size());
BOOST_CHECK_EQUAL(30U, deckItem.data_size());
BOOST_CHECK( !deckItem.defaultApplied(0) );
BOOST_CHECK( !deckItem.defaultApplied(9) );
@ -891,7 +891,6 @@ BOOST_AUTO_TEST_CASE(scan_single_dataCorrect) {
RawRecord rawRecord( "'WELL1' 'WELL2'" );
UnitSystem unit_system;
const auto deckItem = itemString.scan(rawRecord, unit_system, unit_system);
BOOST_CHECK_EQUAL(1U, deckItem.size());
BOOST_CHECK_EQUAL("WELL1", deckItem.get< std::string >(0));
}
@ -1144,10 +1143,6 @@ BOOST_AUTO_TEST_CASE(ParseWithDefault_defaultAppliedCorrectInDeck) {
const auto& deckIntItem = itemInt.scan(rawRecord, unit_system, unit_system);
const auto& deckDoubleItem = itemDouble.scan(rawRecord, unit_system, unit_system);
BOOST_CHECK(deckStringItem.size() == 1);
BOOST_CHECK(deckIntItem.size() == 1);
BOOST_CHECK(deckDoubleItem.size() == 1);
BOOST_CHECK(deckStringItem.defaultApplied(0));
BOOST_CHECK(deckIntItem.defaultApplied(0));
BOOST_CHECK(deckDoubleItem.defaultApplied(0));
@ -1160,10 +1155,6 @@ BOOST_AUTO_TEST_CASE(ParseWithDefault_defaultAppliedCorrectInDeck) {
const auto deckIntItem = itemInt.scan(rawRecord, unit_system, unit_system);
const auto deckDoubleItem = itemDouble.scan(rawRecord, unit_system, unit_system);
BOOST_CHECK_EQUAL(deckStringItem.size(), 1);
BOOST_CHECK_EQUAL(deckIntItem.size(), 1);
BOOST_CHECK_EQUAL(deckDoubleItem.size(), 1);
BOOST_CHECK(deckStringItem.defaultApplied(0));
BOOST_CHECK(deckIntItem.defaultApplied(0));
BOOST_CHECK(deckDoubleItem.defaultApplied(0));
@ -1180,10 +1171,6 @@ BOOST_AUTO_TEST_CASE(ParseWithDefault_defaultAppliedCorrectInDeck) {
const auto& deckIntItem = itemInt.scan(rawRecord, unit_system, unit_system);
const auto& deckDoubleItem = itemDouble.scan(rawRecord, unit_system, unit_system);
BOOST_CHECK_EQUAL(deckStringItem.size(), 1);
BOOST_CHECK_EQUAL(deckIntItem.size(), 1);
BOOST_CHECK_EQUAL(deckDoubleItem.size(), 1);
BOOST_CHECK(!deckStringItem.defaultApplied(0));
BOOST_CHECK(!deckIntItem.defaultApplied(0));
BOOST_CHECK(!deckDoubleItem.defaultApplied(0));
@ -1197,10 +1184,6 @@ BOOST_AUTO_TEST_CASE(ParseWithDefault_defaultAppliedCorrectInDeck) {
const auto deckIntItem = itemInt.scan(rawRecord, unit_system, unit_system);
const auto deckDoubleItem = itemDouble.scan(rawRecord, unit_system, unit_system);
BOOST_CHECK_EQUAL(deckStringItem.size(), 1);
BOOST_CHECK_EQUAL(deckIntItem.size(), 1);
BOOST_CHECK_EQUAL(deckDoubleItem.size(), 1);
BOOST_CHECK(deckStringItem.defaultApplied(0));
BOOST_CHECK(deckIntItem.defaultApplied(0));
BOOST_CHECK(deckDoubleItem.defaultApplied(0));
@ -1213,10 +1196,6 @@ BOOST_AUTO_TEST_CASE(ParseWithDefault_defaultAppliedCorrectInDeck) {
const auto deckIntItem = itemInt.scan(rawRecord, unit_system, unit_system);
const auto deckDoubleItem = itemDouble.scan(rawRecord, unit_system, unit_system);
BOOST_CHECK_EQUAL(deckStringItem.size(), 1);
BOOST_CHECK_EQUAL(deckIntItem.size(), 1);
BOOST_CHECK_EQUAL(deckDoubleItem.size(), 1);
BOOST_CHECK(deckStringItem.defaultApplied(0));
BOOST_CHECK(deckIntItem.defaultApplied(0));
BOOST_CHECK(deckDoubleItem.defaultApplied(0));
@ -1653,8 +1632,6 @@ BOOST_AUTO_TEST_CASE(ParseEmptyRecord) {
const auto& deckRecord = deckKeyword.getRecord(0);
BOOST_REQUIRE_EQUAL( 1U , deckRecord.size());
BOOST_CHECK_EQUAL(0U , deckRecord.getItem( 0 ).size());
}
@ -1945,9 +1922,6 @@ DENSITY
BOOST_CHECK_EQUAL( rs.name( ), "RS" );
BOOST_CHECK_EQUAL( pbub.name( ), "PB" );
BOOST_CHECK_EQUAL( rs.size( ), 1 );
BOOST_CHECK_EQUAL( pbub.size( ), 1 );
BOOST_CHECK( ! rs.defaultApplied( 0 ) );
BOOST_CHECK( ! pbub.defaultApplied( 0 ) );
@ -1995,9 +1969,6 @@ DENSITY
BOOST_CHECK_EQUAL( rs.name( ), "RS" );
BOOST_CHECK_EQUAL( pbub.name( ), "PB" );
BOOST_CHECK_EQUAL( rs.size( ), 0 );
BOOST_CHECK_EQUAL( pbub.size( ), 0 );
BOOST_CHECK( rs.defaultApplied( 0 ) );
BOOST_CHECK( pbub.defaultApplied( 0 ) );
}
@ -2082,9 +2053,6 @@ DENSITY
BOOST_CHECK_EQUAL( rs.name( ), "RS_CONSTT" );
BOOST_CHECK_EQUAL( pbub.name( ), "PB_CONSTT" );
BOOST_CHECK_EQUAL( rs.size( ), 1 );
BOOST_CHECK_EQUAL( pbub.size( ), 1 );
BOOST_CHECK( ! rs.defaultApplied( 0 ) );
BOOST_CHECK( ! pbub.defaultApplied( 0 ) );
@ -2106,9 +2074,6 @@ DENSITY
BOOST_CHECK_EQUAL( rs.name( ), "RS_CONSTT" );
BOOST_CHECK_EQUAL( pbub.name( ), "PB_CONSTT" );
BOOST_CHECK_EQUAL( rs.size( ), 1 );
BOOST_CHECK_EQUAL( pbub.size( ), 1 );
BOOST_CHECK( ! rs.defaultApplied( 0 ) );
BOOST_CHECK( ! pbub.defaultApplied( 0 ) );

View File

@ -731,10 +731,10 @@ BOOST_AUTO_TEST_CASE( RSVD ) {
const auto& rec1 = kw1.getRecord(0);
const auto& rec3 = kw1.getRecord(2);
const auto& item1 = rec1.getItem("table");
const auto& item1 = rec1.getItem("DATA");
BOOST_CHECK( fabs(item1.getSIDouble(0) - 2382) < 0.001);
const auto& item3 = rec3.getItem("table");
const auto& item3 = rec3.getItem("DATA");
BOOST_CHECK( fabs(item3.getSIDouble(7) - 106.77) < 0.001);
}
@ -775,21 +775,18 @@ PVTG
const auto& item0_0 = record0.getItem("GAS_PRESSURE");
const auto& item0_1 = record0.getItem("DATA");
BOOST_CHECK_EQUAL(1U , item0_0.size());
BOOST_CHECK_EQUAL(9U , item0_1.size());
BOOST_CHECK_EQUAL(2U , record0.size());
BOOST_CHECK(item0_0.hasValue(0));
BOOST_CHECK_EQUAL(9U , item0_1.data_size());
const auto& item1_0 = record1.getItem("GAS_PRESSURE");
const auto& item1_1 = record1.getItem("DATA");
BOOST_CHECK_EQUAL(1U , item1_0.size());
BOOST_CHECK_EQUAL(9U , item1_1.size());
BOOST_CHECK_EQUAL(2U , record1.size());
BOOST_CHECK(item1_0.hasValue(0));
BOOST_CHECK_EQUAL(9U , item1_1.data_size());
const auto& item2_0 = record2.getItem("GAS_PRESSURE");
const auto& item2_1 = record2.getItem("DATA");
BOOST_CHECK( item2_0.defaultApplied(0));
BOOST_CHECK_EQUAL(0U , item2_1.size());
BOOST_CHECK_EQUAL(2U , record2.size());
BOOST_CHECK_EQUAL(0U , item2_1.data_size());
const auto& item3_0 = record3.getItem("GAS_PRESSURE");
@ -800,16 +797,14 @@ PVTG
BOOST_CHECK( !item3_1.defaultApplied(3));
BOOST_CHECK( item3_1.defaultApplied(4));
BOOST_CHECK( !item3_1.defaultApplied(5));
BOOST_CHECK_EQUAL(1U , item3_0.size());
BOOST_CHECK_EQUAL(9U , item3_1.size());
BOOST_CHECK_EQUAL(2U , record3.size());
BOOST_CHECK(item3_0.hasValue(0));
BOOST_CHECK_EQUAL(9U , item3_1.data_size());
const auto& item4_0 = record4.getItem("GAS_PRESSURE");
const auto& item4_1 = record4.getItem("DATA");
BOOST_CHECK_EQUAL(1U , item4_0.size());
BOOST_CHECK_EQUAL(9U , item4_1.size());
BOOST_CHECK_EQUAL(2U , record4.size());
BOOST_CHECK(item4_0.hasValue(0));
BOOST_CHECK_EQUAL(9U , item4_1.data_size());
/*
{
@ -872,32 +867,32 @@ PVTO
const auto& item0_0 = record0.getItem("RS");
const auto& item0_1 = record0.getItem("DATA");
BOOST_CHECK_EQUAL(1U , item0_0.size());
BOOST_CHECK_EQUAL(9U , item0_1.size());
BOOST_CHECK(item0_0.hasValue(0));
BOOST_CHECK_EQUAL(9U , item0_1.data_size());
BOOST_CHECK_EQUAL(2U , record0.size());
const auto& item1_0 = record1.getItem("RS");
const auto& item1_1 = record1.getItem("DATA");
BOOST_CHECK_EQUAL(1U , item1_0.size());
BOOST_CHECK_EQUAL(9U , item1_1.size());
BOOST_CHECK(item1_0.hasValue(0));
BOOST_CHECK_EQUAL(9U , item1_1.data_size());
BOOST_CHECK_EQUAL(2U , record1.size());
const auto& item2_0 = record2.getItem("RS");
const auto& item2_1 = record2.getItem("DATA");
BOOST_CHECK(item2_0.defaultApplied(0));
BOOST_CHECK_EQUAL(0U , item2_1.size());
BOOST_CHECK_EQUAL(0U , item2_1.data_size());
BOOST_CHECK_EQUAL(2U , record2.size());
const auto& item3_0 = record3.getItem("RS");
const auto& item3_1 = record3.getItem("DATA");
BOOST_CHECK_EQUAL(1U , item3_0.size());
BOOST_CHECK_EQUAL(9U , item3_1.size());
BOOST_CHECK(item3_0.hasValue(0));
BOOST_CHECK_EQUAL(9U , item3_1.data_size());
BOOST_CHECK_EQUAL(2U , record3.size());
const auto& item4_0 = record4.getItem("RS");
const auto& item4_1 = record4.getItem("DATA");
BOOST_CHECK_EQUAL(1U , item4_0.size());
BOOST_CHECK_EQUAL(9U , item4_1.size());
BOOST_CHECK(item4_0.hasValue(0));
BOOST_CHECK_EQUAL(9U , item4_1.data_size());
BOOST_CHECK_EQUAL(2U , record4.size());
@ -945,7 +940,7 @@ SGOF
const auto& record0 = kw1.getRecord(0);
BOOST_CHECK_EQUAL(1U , record0.size());
const auto& item0 = record0.getItem(0);
BOOST_CHECK_EQUAL(10U * 4, item0.size());
BOOST_CHECK_EQUAL(10U * 4, item0.data_size());
Opm::SgofTable sgofTable(deck.getKeyword("SGOF").getRecord(0).getItem(0), false);
BOOST_CHECK_EQUAL(10U, sgofTable.getSgColumn().size());
@ -983,7 +978,7 @@ SWOF
const auto& item0 = record0.getItem(0);
BOOST_CHECK_EQUAL(1U , kw1.size());
BOOST_CHECK_EQUAL(1U , record0.size());
BOOST_CHECK_EQUAL(10U * 4, item0.size());
BOOST_CHECK_EQUAL(10U * 4, item0.data_size());
Opm::SwofTable swofTable(deck.getKeyword("SWOF").getRecord(0).getItem(0), false);
BOOST_CHECK_EQUAL(10U, swofTable.getSwColumn().size());
@ -1039,7 +1034,7 @@ SLGOF
const auto& item0 = record0.getItem(0);
BOOST_CHECK_EQUAL(1U , kw1.size());
BOOST_CHECK_EQUAL(1U , record0.size());
BOOST_CHECK_EQUAL(10U * 4, item0.size());
BOOST_CHECK_EQUAL(10U * 4, item0.data_size());
Opm::SlgofTable slgofTable( deck.getKeyword("SLGOF").getRecord(0).getItem(0), false );
BOOST_CHECK_EQUAL(10U, slgofTable.getSlColumn().size());
@ -1169,7 +1164,7 @@ BOOST_AUTO_TEST_CASE( VFPPROD ) {
const auto& record = VFPPROD1.getRecord(1);
const auto& item = record.getItem("FLOW_VALUES");
BOOST_CHECK_EQUAL( item.size() , 12 );
BOOST_CHECK_EQUAL( item.data_size() , 12 );
BOOST_CHECK_EQUAL( item.get< double >(0) , 100 );
BOOST_CHECK_EQUAL( item.get< double >(11) , 20000 );
}
@ -1178,7 +1173,7 @@ BOOST_AUTO_TEST_CASE( VFPPROD ) {
const auto& record = VFPPROD1.getRecord(2);
const auto& item = record.getItem("THP_VALUES");
BOOST_CHECK_EQUAL( item.size() , 7 );
BOOST_CHECK_EQUAL( item.data_size() , 7 );
BOOST_CHECK_CLOSE( item.get< double >(0) , 16.01 , 0.0001 );
BOOST_CHECK_CLOSE( item.get< double >(6) , 61.01 , 0.0001 );
}
@ -1187,7 +1182,7 @@ BOOST_AUTO_TEST_CASE( VFPPROD ) {
const auto& record = VFPPROD1.getRecord(3);
const auto& item = record.getItem("WFR_VALUES");
BOOST_CHECK_EQUAL( item.size() , 9 );
BOOST_CHECK_EQUAL( item.data_size() , 9 );
BOOST_CHECK_CLOSE( item.get< double >(1) , 0.1 , 0.0001 );
BOOST_CHECK_CLOSE( item.get< double >(7) , 0.9 , 0.0001 );
}
@ -1196,7 +1191,7 @@ BOOST_AUTO_TEST_CASE( VFPPROD ) {
const auto& record = VFPPROD1.getRecord(4);
const auto& item = record.getItem("GFR_VALUES");
BOOST_CHECK_EQUAL( item.size() , 9 );
BOOST_CHECK_EQUAL( item.data_size() , 9 );
BOOST_CHECK_EQUAL( item.get< double >(0) , 90 );
BOOST_CHECK_EQUAL( item.get< double >(8) , 10000 );
}
@ -1205,7 +1200,7 @@ BOOST_AUTO_TEST_CASE( VFPPROD ) {
const auto& record = VFPPROD1.getRecord(5);
const auto& item = record.getItem("ALQ_VALUES");
BOOST_CHECK_EQUAL( item.size() , 1 );
BOOST_CHECK_EQUAL( item.data_size() , 1 );
BOOST_CHECK_EQUAL( item.get< double >(0) , 0 );
}
@ -1214,28 +1209,28 @@ BOOST_AUTO_TEST_CASE( VFPPROD ) {
{
const auto& item = record.getItem("THP_INDEX");
BOOST_CHECK_EQUAL( item.size() , 1 );
BOOST_CHECK( item.hasValue(0));
BOOST_CHECK_EQUAL( item.get< int >(0) , 1 );
}
{
const auto& item = record.getItem("WFR_INDEX");
BOOST_CHECK_EQUAL( item.size() , 1 );
BOOST_CHECK( item.hasValue(0));
BOOST_CHECK_EQUAL( item.get< int >(0) , 1 );
}
{
const auto& item = record.getItem("GFR_INDEX");
BOOST_CHECK_EQUAL( item.size() , 1 );
BOOST_CHECK( item.hasValue(0));
BOOST_CHECK_EQUAL( item.get< int >(0) , 1 );
}
{
const auto& item = record.getItem("ALQ_INDEX");
BOOST_CHECK_EQUAL( item.size() , 1 );
BOOST_CHECK( item.hasValue(0));
BOOST_CHECK_EQUAL( item.get< int >(0) , 1 );
}
{
const auto& item = record.getItem("VALUES");
BOOST_CHECK_EQUAL( item.size() , 12 );
BOOST_CHECK_EQUAL( item.data_size() , 12 );
BOOST_CHECK_EQUAL( item.get< double >(0) , 44.85 );
BOOST_CHECK_EQUAL( item.get< double >(11) , 115.14 );
}
@ -1245,27 +1240,27 @@ BOOST_AUTO_TEST_CASE( VFPPROD ) {
const auto& record = VFPPROD1.getRecord(572);
{
const auto& item = record.getItem("THP_INDEX");
BOOST_CHECK_EQUAL( item.size() , 1 );
BOOST_CHECK( item.hasValue(0));
BOOST_CHECK_EQUAL( item.get< int >(0) , 7 );
}
{
const auto& item = record.getItem("WFR_INDEX");
BOOST_CHECK_EQUAL( item.size() , 1 );
BOOST_CHECK( item.hasValue(0));
BOOST_CHECK_EQUAL( item.get< int >(0) , 9 );
}
{
const auto& item = record.getItem("GFR_INDEX");
BOOST_CHECK_EQUAL( item.size() , 1 );
BOOST_CHECK( item.hasValue(0));
BOOST_CHECK_EQUAL( item.get< int >(0) , 9 );
}
{
const auto& item = record.getItem("ALQ_INDEX");
BOOST_CHECK_EQUAL( item.size() , 1 );
BOOST_CHECK( item.hasValue(0));
BOOST_CHECK_EQUAL( item.get< int >(0) , 1 );
}
{
const auto& item = record.getItem("VALUES");
BOOST_CHECK_EQUAL( item.size() , 12 );
BOOST_CHECK_EQUAL( item.data_size() , 12 );
BOOST_CHECK_EQUAL( item.get< double >(0) , 100.80 );
BOOST_CHECK_EQUAL( item.get< double >(11) , 147.79 );
}