diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 058556e38..7ff45a3c5 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -454,6 +454,7 @@ HANDLE_AS_POD(data::CurrentControl) HANDLE_AS_POD(data::Rates) HANDLE_AS_POD(data::Segment) HANDLE_AS_POD(DENSITYRecord) +HANDLE_AS_POD(DenT::entry) HANDLE_AS_POD(Eqldims) HANDLE_AS_POD(MLimits) HANDLE_AS_POD(PVTWRecord) @@ -521,6 +522,11 @@ std::size_t packSize(const ThresholdPressure& data, Dune::MPIHelper::MPICommunic packSize(data.pressureTable(), comm); } +std::size_t packSize(const DenT& data, Dune::MPIHelper::MPICommunicator comm) +{ + return packSize(data.records(), comm); +} + std::size_t packSize(const Aquifetp& data, Dune::MPIHelper::MPICommunicator comm) { return packSize(data.data(), comm); @@ -860,7 +866,11 @@ std::size_t packSize(const TableManager& data, Dune::MPIHelper::MPICommunicator packSize(data.useEnptvd(), comm) + packSize(data.useEqlnum(), comm) + packSize(data.useJFunc(), comm) + - (data.useJFunc() ? packSize(data.getJFunc(), comm) : 0) + + (data.useJFunc() ? packSize(data.getJFunc(), comm) : 0) + + packSize(data.OilDenT(), comm) + + packSize(data.GasDenT(), comm) + + packSize(data.WatDenT(), comm) + + packSize(data.gas_comp_index(), comm) + packSize(data.rtemp(), comm); } @@ -2354,6 +2364,12 @@ void pack(const Aquifetp::AQUFETP_data& data, std::vector& buffer, int& po pack(data.p0, buffer, position, comm); } +void pack(const DenT& data, std::vector& buffer, int& position, + Dune::MPIHelper::MPICommunicator comm) { + pack(data.records(), buffer, position, comm); +} + + void pack(const Aquifetp& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) { pack(data.data(), buffer, position, comm); @@ -2699,6 +2715,10 @@ void pack(const TableManager& data, std::vector& buffer, int& position, pack(data.useJFunc(), buffer, position, comm); if (data.useJFunc()) pack(data.getJFunc(), buffer, position, comm); + pack(data.OilDenT(), buffer, position, comm); + pack(data.GasDenT(), buffer, position, comm); + pack(data.WatDenT(), buffer, position, comm); + pack(data.gas_comp_index(), buffer, position, comm); pack(data.rtemp(), buffer, position, comm); } @@ -4331,6 +4351,15 @@ void unpack(AquiferCT::AQUCT_data& data, std::vector& buffer, int& positio cell_id); } + +void unpack(DenT& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) +{ + std::vector records; + unpack(records, buffer, position, comm); + data = DenT( records ); +} + + void unpack(AquiferCT& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) { std::vector aquiferList; @@ -4814,6 +4843,8 @@ void unpack(TableManager& data, std::vector& buffer, int& position, bool hasImptvd; bool hasEntpvd; bool hasEqlnum; + DenT oilDenT, gasDenT, watDenT; + std::size_t gas_comp_index; std::shared_ptr jfunc; double rtemp; unpack(simpleTables, buffer, position, comm); @@ -4845,13 +4876,19 @@ void unpack(TableManager& data, std::vector& buffer, int& position, jfunc = std::make_shared(); unpack(*jfunc, buffer, position, comm); } + unpack(oilDenT, buffer, position, comm); + unpack(gasDenT, buffer, position, comm); + unpack(watDenT, buffer, position, comm); + unpack(gas_comp_index, buffer, position, comm); unpack(rtemp, buffer, position, comm); + data = TableManager(simpleTables, pvtgTables, pvtoTables, rock2dTables, rock2dtrTables, pvtwTable, pvcdoTable, densityTable, rockTable, viscrefTable, watdentTable, pvtwsaltTables, bdensityTables, plymwinjTables, skprwatTables, skprpolyTables, tabdims, regdims, eqldims, - aqudims, hasImptvd, hasEntpvd, hasEqlnum, jfunc, rtemp); + aqudims, hasImptvd, hasEntpvd, hasEqlnum, jfunc, oilDenT, gasDenT, + watDenT, gas_comp_index, rtemp); } template diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 1247eaa35..adbc73a14 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -86,6 +86,7 @@ class Connection; class DeckItem; class DeckRecord; class DENSITYRecord; +class DenT; class DensityTable; class Dimension; class EclHysterConfig; @@ -699,6 +700,8 @@ ADD_PACK_PROTOTYPES(DeckKeyword) ADD_PACK_PROTOTYPES(DeckRecord) ADD_PACK_PROTOTYPES(DENSITYRecord) ADD_PACK_PROTOTYPES(DensityTable) +ADD_PACK_PROTOTYPES(DenT) +ADD_PACK_PROTOTYPES(DenT::entry) ADD_PACK_PROTOTYPES(Dimension) ADD_PACK_PROTOTYPES(EclHysterConfig) ADD_PACK_PROTOTYPES(EclipseConfig) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index efdd61881..6945f0c8a 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -87,6 +87,7 @@ #include #include #include +#include #include #include #include @@ -229,6 +230,13 @@ Opm::TableColumn getTableColumn() } +Opm::DenT getDenT() { + std::vector records; + records.emplace_back(1,2,3); + records.emplace_back(4,5,6); + return Opm::DenT(records); +} + Opm::SimpleTable getSimpleTable() { Opm::OrderedMap data; @@ -1209,6 +1217,10 @@ BOOST_AUTO_TEST_CASE(TableManager) true, true, jfunc, + getDenT(), + getDenT(), + getDenT(), + 77, 1.0); auto val2 = PackUnpack(val1); DO_CHECKS(TableManager) @@ -2462,6 +2474,14 @@ BOOST_AUTO_TEST_CASE(Fault) #endif } +BOOST_AUTO_TEST_CASE(DenT) +{ +#ifdef HAVE_MPI + Opm::DenT val1 = getDenT(); + auto val2 = PackUnpack(val1); + DO_CHECKS(DenT) +#endif +} BOOST_AUTO_TEST_CASE(FaultCollection) {