diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 86cae2ccb..8ec6d7817 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -472,6 +472,11 @@ std::size_t packSize(const ViscrefTable& data, Dune::MPIHelper::MPICommunicator return packSize(static_cast&>(data), comm); } +std::size_t packSize(const WatdentTable& data, Dune::MPIHelper::MPICommunicator comm) +{ + return packSize(static_cast&>(data), comm); +} + ////// pack routines template @@ -929,6 +934,12 @@ void pack(const ViscrefTable& data, std::vector& buffer, int& position, pack(static_cast&>(data), buffer, position, comm); } +void pack(const WatdentTable& data, std::vector& buffer, int& position, + Dune::MPIHelper::MPICommunicator comm) +{ + pack(static_cast&>(data), buffer, position, comm); +} + /// unpack routines template @@ -1505,6 +1516,14 @@ void unpack(ViscrefTable& data, std::vector& buffer, int& position, data = ViscrefTable(pdata); } +void unpack(WatdentTable& data, std::vector& buffer, int& position, + Dune::MPIHelper::MPICommunicator comm) +{ + std::vector pdata; + unpack(pdata, buffer, position, comm); + data = WatdentTable(pdata); +} + } // end namespace Mpi RestartValue loadParallelRestart(const EclipseIO* eclIO, SummaryState& summaryState, const std::vector& solutionKeys, diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 2797b4594..267024e31 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -78,6 +78,7 @@ class UDQParams; class VISCREFRecord; class ViscrefTable; class WATDENTRecord; +class WatdentTable; class Welldims; class WellSegmentDims; @@ -306,6 +307,7 @@ ADD_PACK_PROTOTYPES(UDQParams) ADD_PACK_PROTOTYPES(VISCREFRecord) ADD_PACK_PROTOTYPES(ViscrefTable) ADD_PACK_PROTOTYPES(WATDENTRecord) +ADD_PACK_PROTOTYPES(WatdentTable) ADD_PACK_PROTOTYPES(Welldims) ADD_PACK_PROTOTYPES(WellSegmentDims) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index d67a02f51..f9339cc2e 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -816,6 +816,17 @@ BOOST_AUTO_TEST_CASE(WATDENTRecord) } +BOOST_AUTO_TEST_CASE(WatdentTable) +{ +#if HAVE_MPI + Opm::WatdentTable val1({Opm::WATDENTRecord{1.0, 2.0, 3.0}}); + auto val2 = PackUnpack(val1); + BOOST_CHECK(std::get<1>(val2) == std::get<2>(val2)); + BOOST_CHECK(val1 == std::get<0>(val2)); +#endif +} + + bool init_unit_test_func() { return true;