diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 74f4cd604..ad1abf2da 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,6 +866,9 @@ std::size_t packSize(const TableManager& data, Dune::MPIHelper::MPICommunicator packSize(data.useEnptvd(), comm) + packSize(data.useEqlnum(), comm) + packSize(data.useJFunc(), comm) + + packSize(data.OilDenT(), comm) + + packSize(data.GasDenT(), comm) + + packSize(data.WatDenT(), comm) + (data.useJFunc() ? packSize(data.getJFunc(), comm) : 0) + packSize(data.rtemp(), comm); } @@ -2356,6 +2365,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 +2714,9 @@ void pack(const TableManager& data, std::vector& buffer, int& position, pack(data.useEnptvd(), buffer, position, comm); pack(data.useEqlnum(), buffer, position, comm); pack(data.useJFunc(), buffer, position, comm); + pack(data.OilDenT(), buffer, position, comm); + pack(data.GasDenT(), buffer, position, comm); + pack(data.WatDenT(), buffer, position, comm); if (data.useJFunc()) pack(data.getJFunc(), buffer, position, comm); pack(data.rtemp(), buffer, position, comm); @@ -4334,6 +4352,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; @@ -4817,6 +4844,7 @@ void unpack(TableManager& data, std::vector& buffer, int& position, bool hasImptvd; bool hasEntpvd; bool hasEqlnum; + DenT oilDenT, gasDenT, watDenT; std::shared_ptr jfunc; double rtemp; unpack(simpleTables, buffer, position, comm); @@ -4842,6 +4870,9 @@ void unpack(TableManager& data, std::vector& buffer, int& position, unpack(hasImptvd, buffer, position, comm); unpack(hasEntpvd, buffer, position, comm); unpack(hasEqlnum, buffer, position, comm); + unpack(oilDenT, buffer, position, comm); + unpack(gasDenT, buffer, position, comm); + unpack(watDenT, buffer, position, comm); bool hasJf; unpack(hasJf, buffer, position, comm); if (hasJf) { @@ -4854,7 +4885,8 @@ void unpack(TableManager& data, std::vector& buffer, int& position, rockTable, viscrefTable, watdentTable, pvtwsaltTables, bdensityTables, plymwinjTables, skprwatTables, skprpolyTables, tabdims, regdims, eqldims, - aqudims, hasImptvd, hasEntpvd, hasEqlnum, jfunc, rtemp); + aqudims, hasImptvd, hasEntpvd, hasEqlnum, oilDenT, gasDenT, + watDenT, jfunc, 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 cce48ec9c..de5c8ee1e 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; @@ -1208,6 +1216,9 @@ BOOST_AUTO_TEST_CASE(TableManager) true, true, true, + getDent(), + getDenT(), + getDenT(), jfunc, 1.0); auto val2 = PackUnpack(val1); @@ -2463,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) {