diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index 6ac044630..b6fe435be 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -651,6 +651,7 @@ if(ENABLE_ECL_OUTPUT) opm/output/eclipse/VectorItems/intehead.hpp opm/output/eclipse/VectorItems/logihead.hpp opm/output/eclipse/VectorItems/msw.hpp + opm/output/eclipse/VectorItems/tabdims.hpp opm/output/eclipse/VectorItems/well.hpp opm/output/eclipse/AggregateGroupData.hpp opm/output/eclipse/AggregateConnectionData.hpp diff --git a/opm/output/eclipse/VectorItems/tabdims.hpp b/opm/output/eclipse/VectorItems/tabdims.hpp new file mode 100644 index 000000000..00db65cc0 --- /dev/null +++ b/opm/output/eclipse/VectorItems/tabdims.hpp @@ -0,0 +1,76 @@ +/* + Copyright (c) 2019 Equinor ASA + + 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 . +*/ + +#ifndef OPM_OUTPUT_ECLIPSE_VECTOR_TABDIMS_HPP +#define OPM_OUTPUT_ECLIPSE_VECTOR_TABDIMS_HPP + +#include + +namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems { + + namespace TabDims { + enum index : std::vector::size_type { + // Number of elements in 'TAB' array + TabSize = 0, + + // Oil PVT table + PvtoMainStart = 6, + PvtoCompStart = 7, + NumPvtoCompNodes = 8, + NumPvtoPressNodes = 9, + NumPvtoTables = 10, + + // Water PVT table + PvtwStart = 11, + NumPvtwTables = 12, + + // Gas PVT tables + PvtgMainStart = 13, + PvtgPressStart = 14, + NumPvtgCompNodes = 15, + NumPvtgPressNodes = 16, + NumPvtgTables = 17, + + // Density tables + DensityTableStart = 18, + DensityNumTables = 19, + + // SWFN tables + SwfnTableStart = 20, + SwfnNumSatNodes = 21, + SwfnNumTables = 22, + + // SGFN tables + SgfnTableStart = 23, + SgfnNumSatNodes = 24, + SgfnNumTables = 25, + + // SOFN tables + SofnTableStart = 26, + SofnNumSatNodes = 28, + SofnNumTables = 29, + + // Size of TABDIMS array + TabDimsNumElems = 100, + }; + } // namespace TabDims + +}}}} // namespace Opm::RestartIO::Helpers::VectorItems + +#endif // OPM_OUTPUT_ECLIPSE_VECTOR_TABDIMS_HPP diff --git a/src/opm/output/eclipse/Tables.cpp b/src/opm/output/eclipse/Tables.cpp index 28eb616a5..27b9506a6 100644 --- a/src/opm/output/eclipse/Tables.cpp +++ b/src/opm/output/eclipse/Tables.cpp @@ -21,8 +21,6 @@ #include -#include - #include #include #include // PVTW, PVCDO @@ -40,6 +38,7 @@ #include #include +#include #include #include @@ -51,7 +50,10 @@ #include #include +using Ix = ::Opm::RestartIO::Helpers::VectorItems::TabDims::index; + namespace { + /// Convenience type alias for a callable entity that extracts the /// independent and primary dependent variates of a single property /// function table into a linearised output table. Calling the function @@ -1960,7 +1962,7 @@ namespace Opm { Tables::Tables(const UnitSystem& units0) : units (units0) - , m_tabdims(TABDIMS_SIZE, 0) + , m_tabdims(Ix::TabDimsNumElems, 0) { // Initialize subset of base pointers and dimensions to 1 to honour // requirements of TABDIMS protocol. The magic constant 59 is @@ -1975,7 +1977,7 @@ namespace Opm { this->data.insert(this->data.end(), new_data.begin(), new_data.end()); - this->m_tabdims[ TABDIMS_TAB_SIZE_ITEM ] = this->data.size(); + this->m_tabdims[ Ix::TabSize ] = this->data.size(); } void Tables::addDensity( const DensityTable& density) @@ -1985,14 +1987,14 @@ namespace Opm { const size_t num_columns = density[0].size; std::vector densityData( density.size() * num_columns , default_value); - this->m_tabdims[ TABDIMS_NTDENS_ITEM ] = density.size(); + this->m_tabdims[Ix::DensityNumTables] = density.size(); for (size_t table_num = 0; table_num < density.size(); table_num++) { const auto& record = density[table_num]; densityData[ table_num * num_columns ] = this->units.from_si( UnitSystem::measure::density , record.oil); densityData[ table_num * num_columns + 1] = this->units.from_si( UnitSystem::measure::density , record.water); densityData[ table_num * num_columns + 2] = this->units.from_si( UnitSystem::measure::density , record.gas); } - this->addData( TABDIMS_IBDENS_OFFSET_ITEM , densityData ); + this->addData(Ix::DensityTableStart, densityData ); } } @@ -2062,9 +2064,9 @@ namespace Opm { const auto sgfn = SatFunc::Gas::fromSGOF(nssfun, this->units, tables); - this->addData(TABDIMS_IBSGFN_OFFSET_ITEM, sgfn); - this->m_tabdims[TABDIMS_NSSGFN_ITEM] = nssfun; - this->m_tabdims[TABDIMS_NTSGFN_ITEM] = tables.size(); + this->addData(Ix::SgfnTableStart, sgfn); + this->m_tabdims[Ix::SgfnNumSatNodes] = nssfun; + this->m_tabdims[Ix::SgfnNumTables] = tables.size(); } if (oil) { @@ -2074,9 +2076,9 @@ namespace Opm { const auto sofn = SatFunc::Oil::TwoPhase::fromSGOF(nssfun, tables); - this->addData(TABDIMS_IBSOFN_OFFSET_ITEM, sofn); - this->m_tabdims[TABDIMS_NSSOFN_ITEM] = nssfun; - this->m_tabdims[TABDIMS_NTSOFN_ITEM] = tables.size(); + this->addData(Ix::SofnTableStart, sofn); + this->m_tabdims[Ix::SofnNumSatNodes] = nssfun; + this->m_tabdims[Ix::SofnNumTables] = tables.size(); } else if (wat && !gas) { // 2p O/W System const auto& tables = tabMgr.getSwofTables(); @@ -2084,9 +2086,9 @@ namespace Opm { const auto sofn = SatFunc::Oil::TwoPhase::fromSWOF(nssfun, tables); - this->addData(TABDIMS_IBSOFN_OFFSET_ITEM, sofn); - this->m_tabdims[TABDIMS_NSSOFN_ITEM] = nssfun; - this->m_tabdims[TABDIMS_NTSOFN_ITEM] = tables.size(); + this->addData(Ix::SofnTableStart, sofn); + this->m_tabdims[Ix::SofnNumSatNodes] = nssfun; + this->m_tabdims[Ix::SofnNumTables] = tables.size(); } else { // 3p G/O/W System const auto& sgof = tabMgr.getSgofTables(); @@ -2099,9 +2101,9 @@ namespace Opm { const auto sofn = SatFunc::Oil::ThreePhase:: fromSGOFandSWOF(numRows, sgof, swof); - this->addData(TABDIMS_IBSOFN_OFFSET_ITEM, sofn); - this->m_tabdims[TABDIMS_NSSOFN_ITEM] = numRows; - this->m_tabdims[TABDIMS_NTSOFN_ITEM] = sgof.size(); + this->addData(Ix::SofnTableStart, sofn); + this->m_tabdims[Ix::SofnNumSatNodes] = numRows; + this->m_tabdims[Ix::SofnNumTables] = sgof.size(); } } @@ -2111,9 +2113,9 @@ namespace Opm { const auto swfn = SatFunc::Water::fromSWOF(nssfun, this->units, tables); - this->addData(TABDIMS_IBSWFN_OFFSET_ITEM, swfn); - this->m_tabdims[TABDIMS_NSSWFN_ITEM] = nssfun; - this->m_tabdims[TABDIMS_NTSWFN_ITEM] = tables.size(); + this->addData(Ix::SwfnTableStart, swfn); + this->m_tabdims[Ix::SwfnNumSatNodes] = nssfun; + this->m_tabdims[Ix::SwfnNumTables] = tables.size(); } } @@ -2132,9 +2134,9 @@ namespace Opm { const auto sgfn = SatFunc::Gas::fromSGFN(nssfun, this->units, tables); - this->addData(TABDIMS_IBSGFN_OFFSET_ITEM, sgfn); - this->m_tabdims[TABDIMS_NSSGFN_ITEM] = nssfun; - this->m_tabdims[TABDIMS_NTSGFN_ITEM] = tables.size(); + this->addData(Ix::SgfnTableStart, sgfn); + this->m_tabdims[Ix::SgfnNumSatNodes] = nssfun; + this->m_tabdims[Ix::SgfnNumTables] = tables.size(); } if (oil) { @@ -2144,9 +2146,9 @@ namespace Opm { const auto sofn = SatFunc::Oil::TwoPhase::fromSOF2(nssfun, tables); - this->addData(TABDIMS_IBSOFN_OFFSET_ITEM, sofn); - this->m_tabdims[TABDIMS_NSSOFN_ITEM] = nssfun; - this->m_tabdims[TABDIMS_NTSOFN_ITEM] = tables.size(); + this->addData(Ix::SofnTableStart, sofn); + this->m_tabdims[Ix::SofnNumSatNodes] = nssfun; + this->m_tabdims[Ix::SofnNumTables] = tables.size(); } else { // 3p G/O/W System const auto& tables = tabMgr.getSof3Tables(); @@ -2154,9 +2156,9 @@ namespace Opm { const auto sofn = SatFunc::Oil::ThreePhase::fromSOF3(nssfun, tables); - this->addData(TABDIMS_IBSOFN_OFFSET_ITEM, sofn); - this->m_tabdims[TABDIMS_NSSOFN_ITEM] = nssfun; - this->m_tabdims[TABDIMS_NTSOFN_ITEM] = tables.size(); + this->addData(Ix::SofnTableStart, sofn); + this->m_tabdims[Ix::SofnNumSatNodes] = nssfun; + this->m_tabdims[Ix::SofnNumTables] = tables.size(); } } @@ -2166,9 +2168,9 @@ namespace Opm { const auto swfn = SatFunc::Water::fromSWFN(nssfun, this->units, tables); - this->addData(TABDIMS_IBSWFN_OFFSET_ITEM, swfn); - this->m_tabdims[TABDIMS_NSSWFN_ITEM] = nssfun; - this->m_tabdims[TABDIMS_NTSWFN_ITEM] = tables.size(); + this->addData(Ix::SwfnTableStart, swfn); + this->m_tabdims[Ix::SwfnNumSatNodes] = nssfun; + this->m_tabdims[Ix::SwfnNumTables] = tables.size(); } } @@ -2203,12 +2205,12 @@ namespace Opm { const auto pressData = PVTFunc::Gas:: pressureNodes(numPrimary, this->units, pvtg); - this->addData(TABDIMS_IBPVTG_OFFSET_ITEM, tableData); - this->addData(TABDIMS_JBPVTG_OFFSET_ITEM, pressData); + this->addData(Ix::PvtgMainStart, tableData); + this->addData(Ix::PvtgPressStart, pressData); - this->m_tabdims[TABDIMS_NPPVTG_ITEM] = numPrimary; - this->m_tabdims[TABDIMS_NRPVTG_ITEM] = numCompNodes; - this->m_tabdims[TABDIMS_NTPVTG_ITEM] = pvtg.size(); + this->m_tabdims[Ix::NumPvtgPressNodes] = numPrimary; + this->m_tabdims[Ix::NumPvtgCompNodes] = numCompNodes; + this->m_tabdims[Ix::NumPvtgTables] = pvtg.size(); } else { // Dry gas, pressure dependent compressibility. @@ -2219,9 +2221,9 @@ namespace Opm { const auto tableData = PVTFunc::Gas::fromPVDG(numRows, this->units, pvdg); - this->addData(TABDIMS_IBPVTG_OFFSET_ITEM, tableData); - this->m_tabdims[TABDIMS_NPPVTG_ITEM] = numRows; - this->m_tabdims[TABDIMS_NTPVTG_ITEM] = pvdg.size(); + this->addData(Ix::PvtgMainStart, tableData); + this->m_tabdims[Ix::NumPvtgPressNodes] = numRows; + this->m_tabdims[Ix::NumPvtgTables] = pvdg.size(); } } @@ -2257,12 +2259,12 @@ namespace Opm { const auto rsData = PVTFunc::Oil:: compositionNodes(numCompNodes, this->units, pvto); - this->addData(TABDIMS_IBPVTO_OFFSET_ITEM, tableData); - this->addData(TABDIMS_JBPVTO_OFFSET_ITEM, rsData); + this->addData(Ix::PvtoMainStart, tableData); + this->addData(Ix::PvtoCompStart, rsData); - this->m_tabdims[TABDIMS_NPPVTO_ITEM] = numRows; - this->m_tabdims[TABDIMS_NRPVTO_ITEM] = numCompNodes; - this->m_tabdims[TABDIMS_NTPVTO_ITEM] = pvto.size(); + this->m_tabdims[Ix::NumPvtoPressNodes] = numRows; + this->m_tabdims[Ix::NumPvtoCompNodes] = numCompNodes; + this->m_tabdims[Ix::NumPvtoTables] = pvto.size(); } else if (hasPVDO) { // Dead oil, pressure dependent compressibility. @@ -2273,9 +2275,9 @@ namespace Opm { const auto tableData = PVTFunc::Oil::fromPVDO(numRows, this->units, pvdo); - this->addData(TABDIMS_IBPVTO_OFFSET_ITEM, tableData); - this->m_tabdims[TABDIMS_NPPVTO_ITEM] = numRows; - this->m_tabdims[TABDIMS_NTPVTO_ITEM] = pvdo.size(); + this->addData(Ix::PvtoMainStart, tableData); + this->m_tabdims[Ix::NumPvtoPressNodes] = numRows; + this->m_tabdims[Ix::NumPvtoTables] = pvdo.size(); } else { // Dead oil, constant compressibility. @@ -2285,9 +2287,9 @@ namespace Opm { const auto tableData = PVTFunc::Oil::fromPVCDO(numRows, this->units, pvcdo); - this->addData(TABDIMS_IBPVTO_OFFSET_ITEM, tableData); - this->m_tabdims[TABDIMS_NPPVTO_ITEM] = numRows; - this->m_tabdims[TABDIMS_NTPVTO_ITEM] = pvcdo.size(); + this->addData(Ix::PvtoMainStart, tableData); + this->m_tabdims[Ix::NumPvtoPressNodes] = numRows; + this->m_tabdims[Ix::NumPvtoTables] = pvcdo.size(); } } @@ -2303,7 +2305,7 @@ namespace Opm { const auto tableData = PVTFunc::Water::fromPVTW(this->units, pvtw); - this->addData(TABDIMS_IBPVTW_OFFSET_ITEM, tableData); - this->m_tabdims[TABDIMS_NTPVTW_ITEM] = pvtw.size(); + this->addData(Ix::PvtwStart, tableData); + this->m_tabdims[Ix::NumPvtwTables] = pvtw.size(); } } diff --git a/tests/test_Tables.cpp b/tests/test_Tables.cpp index 0c91ceac1..97945701d 100644 --- a/tests/test_Tables.cpp +++ b/tests/test_Tables.cpp @@ -31,8 +31,6 @@ #include #include -#include - #include #include #include @@ -40,7 +38,9 @@ #include #include +#include +using Ix = ::Opm::RestartIO::Helpers::VectorItems::TabDims::index; namespace { template @@ -1172,9 +1172,9 @@ BOOST_AUTO_TEST_CASE (Oil_Water_Family_One) // SOFN { - const auto ibsofn = tabdims[ TABDIMS_IBSOFN_OFFSET_ITEM ] - 1; - const auto nssofn = tabdims[ TABDIMS_NSSOFN_ITEM ]; - const auto ntsofn = tabdims[ TABDIMS_NTSOFN_ITEM ]; + const auto ibsofn = tabdims[ Ix::SofnTableStart ] - 1; + const auto nssofn = tabdims[ Ix::SofnNumSatNodes ]; + const auto ntsofn = tabdims[ Ix::SofnNumTables ]; const auto ncol = 3; const auto sofn = std::vector { @@ -1190,9 +1190,9 @@ BOOST_AUTO_TEST_CASE (Oil_Water_Family_One) // SWFN { - const auto ibswfn = tabdims[ TABDIMS_IBSWFN_OFFSET_ITEM ] - 1; - const auto nsswfn = tabdims[ TABDIMS_NSSWFN_ITEM ]; - const auto ntswfn = tabdims[ TABDIMS_NTSWFN_ITEM ]; + const auto ibswfn = tabdims[ Ix::SwfnTableStart ] - 1; + const auto nsswfn = tabdims[ Ix::SwfnNumSatNodes ]; + const auto ntswfn = tabdims[ Ix::SwfnNumTables ]; const auto ncol = 5; const auto swfn = std::vector { @@ -1219,9 +1219,9 @@ BOOST_AUTO_TEST_CASE (Oil_Water_Family_Two) // SOFN { - const auto ibsofn = tabdims[ TABDIMS_IBSOFN_OFFSET_ITEM ] - 1; - const auto nssofn = tabdims[ TABDIMS_NSSOFN_ITEM ]; - const auto ntsofn = tabdims[ TABDIMS_NTSOFN_ITEM ]; + const auto ibsofn = tabdims[ Ix::SofnTableStart ] - 1; + const auto nssofn = tabdims[ Ix::SofnNumSatNodes ]; + const auto ntsofn = tabdims[ Ix::SofnNumTables ]; const auto ncol = 3; const auto sofn = std::vector { @@ -1237,9 +1237,9 @@ BOOST_AUTO_TEST_CASE (Oil_Water_Family_Two) // SWFN { - const auto ibswfn = tabdims[ TABDIMS_IBSWFN_OFFSET_ITEM ] - 1; - const auto nsswfn = tabdims[ TABDIMS_NSSWFN_ITEM ]; - const auto ntswfn = tabdims[ TABDIMS_NTSWFN_ITEM ]; + const auto ibswfn = tabdims[ Ix::SwfnTableStart ] - 1; + const auto nsswfn = tabdims[ Ix::SwfnNumSatNodes ]; + const auto ntswfn = tabdims[ Ix::SwfnNumTables ]; const auto ncol = 5; const auto swfn = std::vector { @@ -1266,9 +1266,9 @@ BOOST_AUTO_TEST_CASE (Gas_Oil_Familiy_One) // SGFN { - const auto ibsgfn = tabdims[ TABDIMS_IBSGFN_OFFSET_ITEM ] - 1; - const auto nssgfn = tabdims[ TABDIMS_NSSGFN_ITEM ]; - const auto ntsgfn = tabdims[ TABDIMS_NTSGFN_ITEM ]; + const auto ibsgfn = tabdims[ Ix::SgfnTableStart ] - 1; + const auto nssgfn = tabdims[ Ix::SgfnNumSatNodes ]; + const auto ntsgfn = tabdims[ Ix::SgfnNumTables ]; const auto ncol = 5; const auto sgfn = std::vector { @@ -1284,9 +1284,9 @@ BOOST_AUTO_TEST_CASE (Gas_Oil_Familiy_One) // SOFN { - const auto ibsofn = tabdims[ TABDIMS_IBSOFN_OFFSET_ITEM ] - 1; - const auto nssofn = tabdims[ TABDIMS_NSSOFN_ITEM ]; - const auto ntsofn = tabdims[ TABDIMS_NTSOFN_ITEM ]; + const auto ibsofn = tabdims[ Ix::SofnTableStart ] - 1; + const auto nssofn = tabdims[ Ix::SofnNumSatNodes ]; + const auto ntsofn = tabdims[ Ix::SofnNumTables ]; const auto ncol = 3; const auto sofn = std::vector { @@ -1313,9 +1313,9 @@ BOOST_AUTO_TEST_CASE (Gas_Oil_Familiy_Two) // SGFN { - const auto ibsgfn = tabdims[ TABDIMS_IBSGFN_OFFSET_ITEM ] - 1; - const auto nssgfn = tabdims[ TABDIMS_NSSGFN_ITEM ]; - const auto ntsgfn = tabdims[ TABDIMS_NTSGFN_ITEM ]; + const auto ibsgfn = tabdims[ Ix::SgfnTableStart ] - 1; + const auto nssgfn = tabdims[ Ix::SgfnNumSatNodes ]; + const auto ntsgfn = tabdims[ Ix::SgfnNumTables ]; const auto ncol = 5; const auto sgfn = std::vector { @@ -1331,9 +1331,9 @@ BOOST_AUTO_TEST_CASE (Gas_Oil_Familiy_Two) // SOFN { - const auto ibsofn = tabdims[ TABDIMS_IBSOFN_OFFSET_ITEM ] - 1; - const auto nssofn = tabdims[ TABDIMS_NSSOFN_ITEM ]; - const auto ntsofn = tabdims[ TABDIMS_NTSOFN_ITEM ]; + const auto ibsofn = tabdims[ Ix::SofnTableStart ] - 1; + const auto nssofn = tabdims[ Ix::SofnNumSatNodes ]; + const auto ntsofn = tabdims[ Ix::SofnNumTables ]; const auto ncol = 3; const auto sofn = std::vector { @@ -1366,9 +1366,9 @@ BOOST_AUTO_TEST_CASE (Serialize_Family_One) // SGFN { - const auto ibsgfn = tabdims[ TABDIMS_IBSGFN_OFFSET_ITEM ] - 1; - const auto nssgfn = tabdims[ TABDIMS_NSSGFN_ITEM ]; - const auto ntsgfn = tabdims[ TABDIMS_NTSGFN_ITEM ]; + const auto ibsgfn = tabdims[ Ix::SgfnTableStart ] - 1; + const auto nssgfn = tabdims[ Ix::SgfnNumSatNodes ]; + const auto ntsgfn = tabdims[ Ix::SgfnNumTables ]; const auto ncol = 5; const auto sgfn = std::vector { @@ -1384,9 +1384,9 @@ BOOST_AUTO_TEST_CASE (Serialize_Family_One) // SOFN { - const auto ibsofn = tabdims[ TABDIMS_IBSOFN_OFFSET_ITEM ] - 1; - const auto nssofn = tabdims[ TABDIMS_NSSOFN_ITEM ]; - const auto ntsofn = tabdims[ TABDIMS_NTSOFN_ITEM ]; + const auto ibsofn = tabdims[ Ix::SofnTableStart ] - 1; + const auto nssofn = tabdims[ Ix::SofnNumSatNodes ]; + const auto ntsofn = tabdims[ Ix::SofnNumTables ]; const auto ncol = 5; const auto sofn = std::vector { @@ -1402,9 +1402,9 @@ BOOST_AUTO_TEST_CASE (Serialize_Family_One) // SWFN { - const auto ibswfn = tabdims[ TABDIMS_IBSWFN_OFFSET_ITEM ] - 1; - const auto nsswfn = tabdims[ TABDIMS_NSSWFN_ITEM ]; - const auto ntswfn = tabdims[ TABDIMS_NTSWFN_ITEM ]; + const auto ibswfn = tabdims[ Ix::SwfnTableStart ] - 1; + const auto nsswfn = tabdims[ Ix::SwfnNumSatNodes ]; + const auto ntswfn = tabdims[ Ix::SwfnNumTables ]; const auto ncol = 5; const auto swfn = std::vector { @@ -1431,9 +1431,9 @@ BOOST_AUTO_TEST_CASE (Serialize_Family_Two) // SGFN { - const auto ibsgfn = tabdims[ TABDIMS_IBSGFN_OFFSET_ITEM ] - 1; - const auto nssgfn = tabdims[ TABDIMS_NSSGFN_ITEM ]; - const auto ntsgfn = tabdims[ TABDIMS_NTSGFN_ITEM ]; + const auto ibsgfn = tabdims[ Ix::SgfnTableStart ] - 1; + const auto nssgfn = tabdims[ Ix::SgfnNumSatNodes ]; + const auto ntsgfn = tabdims[ Ix::SgfnNumTables ]; const auto ncol = 5; const auto sgfn = std::vector { @@ -1449,9 +1449,9 @@ BOOST_AUTO_TEST_CASE (Serialize_Family_Two) // SOFN { - const auto ibsofn = tabdims[ TABDIMS_IBSOFN_OFFSET_ITEM ] - 1; - const auto nssofn = tabdims[ TABDIMS_NSSOFN_ITEM ]; - const auto ntsofn = tabdims[ TABDIMS_NTSOFN_ITEM ]; + const auto ibsofn = tabdims[ Ix::SofnTableStart ] - 1; + const auto nssofn = tabdims[ Ix::SofnNumSatNodes ]; + const auto ntsofn = tabdims[ Ix::SofnNumTables ]; const auto ncol = 5; const auto sofn = std::vector { @@ -1467,9 +1467,9 @@ BOOST_AUTO_TEST_CASE (Serialize_Family_Two) // SWFN { - const auto ibswfn = tabdims[ TABDIMS_IBSWFN_OFFSET_ITEM ] - 1; - const auto nsswfn = tabdims[ TABDIMS_NSSWFN_ITEM ]; - const auto ntswfn = tabdims[ TABDIMS_NTSWFN_ITEM ]; + const auto ibswfn = tabdims[ Ix::SwfnTableStart ] - 1; + const auto nsswfn = tabdims[ Ix::SwfnNumSatNodes ]; + const auto ntswfn = tabdims[ Ix::SwfnNumTables ]; const auto ncol = 5; const auto swfn = std::vector { @@ -1589,14 +1589,14 @@ PVDG const auto& tabdims = tables.tabdims(); const auto& tab = tables.tab(); - const auto ibpvtg = tabdims[ TABDIMS_IBPVTG_OFFSET_ITEM ] - 1; - const auto nppvtg = tabdims[ TABDIMS_NPPVTG_ITEM ]; - const auto ntpvtg = tabdims[ TABDIMS_NTPVTG_ITEM ]; + const auto ibpvtg = tabdims[ Ix::PvtgMainStart ] - 1; + const auto nppvtg = tabdims[ Ix::NumPvtgPressNodes ]; + const auto ntpvtg = tabdims[ Ix::NumPvtgTables ]; const auto ncol = 5; // Pg table defaulted - BOOST_CHECK_EQUAL(tabdims[TABDIMS_JBPVTG_OFFSET_ITEM], 1); - BOOST_CHECK_EQUAL(tabdims[TABDIMS_NRPVTG_ITEM], 1); + BOOST_CHECK_EQUAL(tabdims[Ix::PvtgPressStart], 1); + BOOST_CHECK_EQUAL(tabdims[Ix::NumPvtgCompNodes], 1); BOOST_CHECK_EQUAL(nppvtg, 16); BOOST_CHECK_EQUAL(ntpvtg, 2); @@ -1712,14 +1712,14 @@ PVDG const auto& tabdims = tables.tabdims(); const auto& tab = tables.tab(); - const auto ibpvtg = tabdims[ TABDIMS_IBPVTG_OFFSET_ITEM ] - 1; - const auto nppvtg = tabdims[ TABDIMS_NPPVTG_ITEM ]; - const auto ntpvtg = tabdims[ TABDIMS_NTPVTG_ITEM ]; + const auto ibpvtg = tabdims[ Ix::PvtgMainStart ] - 1; + const auto nppvtg = tabdims[ Ix::NumPvtgPressNodes ]; + const auto ntpvtg = tabdims[ Ix::NumPvtgTables ]; const auto ncol = 5; // Pg table defaulted - BOOST_CHECK_EQUAL(tabdims[TABDIMS_JBPVTG_OFFSET_ITEM], 1); - BOOST_CHECK_EQUAL(tabdims[TABDIMS_NRPVTG_ITEM], 1); + BOOST_CHECK_EQUAL(tabdims[Ix::PvtgPressStart], 1); + BOOST_CHECK_EQUAL(tabdims[Ix::NumPvtgCompNodes], 1); BOOST_CHECK_EQUAL(nppvtg, 14); // Table 2 BOOST_CHECK_EQUAL(ntpvtg, 2); @@ -1825,11 +1825,11 @@ PVTG const auto& tabdims = tables.tabdims(); const auto& tab = tables.tab(); - const auto ibpvtg = tabdims[ TABDIMS_IBPVTG_OFFSET_ITEM ] - 1; - const auto jbpvtg = tabdims[ TABDIMS_JBPVTG_OFFSET_ITEM ] - 1; - const auto nppvtg = tabdims[ TABDIMS_NPPVTG_ITEM ]; - const auto nrpvtg = tabdims[ TABDIMS_NRPVTG_ITEM ]; - const auto ntpvtg = tabdims[ TABDIMS_NTPVTG_ITEM ]; + const auto ibpvtg = tabdims[ Ix::PvtgMainStart ] - 1; + const auto jbpvtg = tabdims[ Ix::PvtgPressStart ] - 1; + const auto nppvtg = tabdims[ Ix::NumPvtgPressNodes ]; + const auto nrpvtg = tabdims[ Ix::NumPvtgCompNodes ]; + const auto ntpvtg = tabdims[ Ix::NumPvtgTables ]; const auto ncol = 5; BOOST_CHECK_EQUAL(nppvtg, 7); @@ -1976,11 +1976,11 @@ PVTG const auto& tabdims = tables.tabdims(); const auto& tab = tables.tab(); - const auto ibpvtg = tabdims[ TABDIMS_IBPVTG_OFFSET_ITEM ] - 1; - const auto jbpvtg = tabdims[ TABDIMS_JBPVTG_OFFSET_ITEM ] - 1; - const auto nppvtg = tabdims[ TABDIMS_NPPVTG_ITEM ]; - const auto nrpvtg = tabdims[ TABDIMS_NRPVTG_ITEM ]; - const auto ntpvtg = tabdims[ TABDIMS_NTPVTG_ITEM ]; + const auto ibpvtg = tabdims[ Ix::PvtgMainStart ] - 1; + const auto jbpvtg = tabdims[ Ix::PvtgPressStart ] - 1; + const auto nppvtg = tabdims[ Ix::NumPvtgPressNodes ]; + const auto nrpvtg = tabdims[ Ix::NumPvtgCompNodes ]; + const auto ntpvtg = tabdims[ Ix::NumPvtgTables ]; const auto ncol = 5; BOOST_CHECK_EQUAL(nppvtg, 7); @@ -2122,11 +2122,11 @@ PVTG const auto& tabdims = tables.tabdims(); const auto& tab = tables.tab(); - const auto ibpvtg = tabdims[ TABDIMS_IBPVTG_OFFSET_ITEM ] - 1; - const auto jbpvtg = tabdims[ TABDIMS_JBPVTG_OFFSET_ITEM ] - 1; - const auto nppvtg = tabdims[ TABDIMS_NPPVTG_ITEM ]; - const auto nrpvtg = tabdims[ TABDIMS_NRPVTG_ITEM ]; - const auto ntpvtg = tabdims[ TABDIMS_NTPVTG_ITEM ]; + const auto ibpvtg = tabdims[ Ix::PvtgMainStart ] - 1; + const auto jbpvtg = tabdims[ Ix::PvtgPressStart ] - 1; + const auto nppvtg = tabdims[ Ix::NumPvtgPressNodes ]; + const auto nrpvtg = tabdims[ Ix::NumPvtgCompNodes ]; + const auto ntpvtg = tabdims[ Ix::NumPvtgTables ]; const auto ncol = 5; BOOST_CHECK_EQUAL(nppvtg, 5); // Table 1 @@ -2260,14 +2260,14 @@ PVCDO const auto& tabdims = tables.tabdims(); const auto& tab = tables.tab(); - const auto ibpvto = tabdims[ TABDIMS_IBPVTO_OFFSET_ITEM ] - 1; - const auto nppvto = tabdims[ TABDIMS_NPPVTO_ITEM ]; - const auto ntpvto = tabdims[ TABDIMS_NTPVTO_ITEM ]; + const auto ibpvto = tabdims[ Ix::PvtoMainStart ] - 1; + const auto nppvto = tabdims[ Ix::NumPvtoPressNodes ]; + const auto ntpvto = tabdims[ Ix::NumPvtoTables ]; const auto ncol = 5; // Rs table defaulted - BOOST_CHECK_EQUAL(tabdims[TABDIMS_JBPVTO_OFFSET_ITEM], 1); - BOOST_CHECK_EQUAL(tabdims[TABDIMS_NRPVTO_ITEM], 1); + BOOST_CHECK_EQUAL(tabdims[Ix::PvtoCompStart], 1); + BOOST_CHECK_EQUAL(tabdims[Ix::NumPvtoCompNodes], 1); BOOST_CHECK_EQUAL(nppvto, 4); BOOST_CHECK_EQUAL(ntpvto, 2); @@ -2345,14 +2345,14 @@ PVDO const auto& tabdims = tables.tabdims(); const auto& tab = tables.tab(); - const auto ibpvto = tabdims[ TABDIMS_IBPVTO_OFFSET_ITEM ] - 1; - const auto nppvto = tabdims[ TABDIMS_NPPVTO_ITEM ]; - const auto ntpvto = tabdims[ TABDIMS_NTPVTO_ITEM ]; + const auto ibpvto = tabdims[ Ix::PvtoMainStart ] - 1; + const auto nppvto = tabdims[ Ix::NumPvtoPressNodes ]; + const auto ntpvto = tabdims[ Ix::NumPvtoTables ]; const auto ncol = 5; // Rs table defaulted - BOOST_CHECK_EQUAL(tabdims[TABDIMS_JBPVTO_OFFSET_ITEM], 1); - BOOST_CHECK_EQUAL(tabdims[TABDIMS_NRPVTO_ITEM], 1); + BOOST_CHECK_EQUAL(tabdims[Ix::PvtoCompStart], 1); + BOOST_CHECK_EQUAL(tabdims[Ix::NumPvtoCompNodes], 1); BOOST_CHECK_EQUAL(nppvto, 8); BOOST_CHECK_EQUAL(ntpvto, 2); @@ -2442,14 +2442,14 @@ PVDO const auto& tabdims = tables.tabdims(); const auto& tab = tables.tab(); - const auto ibpvto = tabdims[ TABDIMS_IBPVTO_OFFSET_ITEM ] - 1; - const auto nppvto = tabdims[ TABDIMS_NPPVTO_ITEM ]; - const auto ntpvto = tabdims[ TABDIMS_NTPVTO_ITEM ]; + const auto ibpvto = tabdims[ Ix::PvtoMainStart ] - 1; + const auto nppvto = tabdims[ Ix::NumPvtoPressNodes ]; + const auto ntpvto = tabdims[ Ix::NumPvtoTables ]; const auto ncol = 5; // Rs table defaulted - BOOST_CHECK_EQUAL(tabdims[TABDIMS_JBPVTO_OFFSET_ITEM], 1); - BOOST_CHECK_EQUAL(tabdims[TABDIMS_NRPVTO_ITEM], 1); + BOOST_CHECK_EQUAL(tabdims[Ix::PvtoCompStart], 1); + BOOST_CHECK_EQUAL(tabdims[Ix::NumPvtoCompNodes], 1); BOOST_CHECK_EQUAL(nppvto, 10); // Table 1 BOOST_CHECK_EQUAL(ntpvto, 2); @@ -2541,11 +2541,11 @@ PVTO const auto& tabdims = tables.tabdims(); const auto& tab = tables.tab(); - const auto ibpvto = tabdims[ TABDIMS_IBPVTO_OFFSET_ITEM ] - 1; - const auto jbpvto = tabdims[ TABDIMS_JBPVTO_OFFSET_ITEM ] - 1; - const auto nppvto = tabdims[ TABDIMS_NPPVTO_ITEM ]; - const auto nrpvto = tabdims[ TABDIMS_NRPVTO_ITEM ]; - const auto ntpvto = tabdims[ TABDIMS_NTPVTO_ITEM ]; + const auto ibpvto = tabdims[ Ix::PvtoMainStart ] - 1; + const auto jbpvto = tabdims[ Ix::PvtoCompStart ] - 1; + const auto nppvto = tabdims[ Ix::NumPvtoPressNodes ]; + const auto nrpvto = tabdims[ Ix::NumPvtoCompNodes ]; + const auto ntpvto = tabdims[ Ix::NumPvtoTables ]; const auto ncol = 5; BOOST_CHECK_EQUAL(nppvto, 4); @@ -2690,11 +2690,11 @@ PVTO const auto& tabdims = tables.tabdims(); const auto& tab = tables.tab(); - const auto ibpvto = tabdims[ TABDIMS_IBPVTO_OFFSET_ITEM ] - 1; - const auto jbpvto = tabdims[ TABDIMS_JBPVTO_OFFSET_ITEM ] - 1; - const auto nppvto = tabdims[ TABDIMS_NPPVTO_ITEM ]; - const auto nrpvto = tabdims[ TABDIMS_NRPVTO_ITEM ]; - const auto ntpvto = tabdims[ TABDIMS_NTPVTO_ITEM ]; + const auto ibpvto = tabdims[ Ix::PvtoMainStart ] - 1; + const auto jbpvto = tabdims[ Ix::PvtoCompStart ] - 1; + const auto nppvto = tabdims[ Ix::NumPvtoPressNodes ]; + const auto nrpvto = tabdims[ Ix::NumPvtoCompNodes ]; + const auto ntpvto = tabdims[ Ix::NumPvtoTables ]; const auto ncol = 5; BOOST_CHECK_EQUAL(nppvto, 5); @@ -2848,11 +2848,11 @@ PVTO const auto& tabdims = tables.tabdims(); const auto& tab = tables.tab(); - const auto ibpvto = tabdims[ TABDIMS_IBPVTO_OFFSET_ITEM ] - 1; - const auto jbpvto = tabdims[ TABDIMS_JBPVTO_OFFSET_ITEM ] - 1; - const auto nppvto = tabdims[ TABDIMS_NPPVTO_ITEM ]; - const auto nrpvto = tabdims[ TABDIMS_NRPVTO_ITEM ]; - const auto ntpvto = tabdims[ TABDIMS_NTPVTO_ITEM ]; + const auto ibpvto = tabdims[ Ix::PvtoMainStart ] - 1; + const auto jbpvto = tabdims[ Ix::PvtoCompStart ] - 1; + const auto nppvto = tabdims[ Ix::NumPvtoPressNodes ]; + const auto nrpvto = tabdims[ Ix::NumPvtoCompNodes ]; + const auto ntpvto = tabdims[ Ix::NumPvtoTables ]; const auto ncol = 5; // Verify declared TABDIMS from input @@ -2999,8 +2999,8 @@ PVTW const auto& tabdims = tables.tabdims(); const auto& tab = tables.tab(); - const auto ibpvtw = tabdims[ TABDIMS_IBPVTW_OFFSET_ITEM ] - 1; - const auto ntpvtw = tabdims[ TABDIMS_NTPVTW_ITEM ]; + const auto ibpvtw = tabdims[ Ix::PvtwStart ] - 1; + const auto ntpvtw = tabdims[ Ix::NumPvtwTables ]; const auto ncol = 5; BOOST_CHECK_EQUAL(ntpvtw, 2);