diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 625dfae5f..d49b9cb9a 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -951,6 +952,12 @@ std::size_t packSize(const WellTestConfig& data, return packSize(data.getWells(), comm); } +std::size_t packSize(const WellTracerProperties& data, + Dune::MPIHelper::MPICommunicator comm) +{ + return packSize(data.getConcentrations(), comm); +} + ////// pack routines template @@ -1910,6 +1917,13 @@ void pack(const WellTestConfig& data, pack(data.getWells(), buffer, position, comm); } +void pack(const WellTracerProperties& data, + std::vector& buffer, int& position, + Dune::MPIHelper::MPICommunicator comm) +{ + pack(data.getConcentrations(), buffer, position, comm); +} + /// unpack routines template @@ -3214,6 +3228,15 @@ void unpack(WellTestConfig& data, data = WellTestConfig(ddata); } +void unpack(WellTracerProperties& data, + std::vector& buffer, int& position, + Dune::MPIHelper::MPICommunicator comm) +{ + WellTracerProperties::ConcentrationMap ddata; + unpack(ddata, buffer, position, comm); + data = WellTracerProperties(ddata); +} + #define INSTANTIATE_PACK_VECTOR(T) \ template std::size_t packSize(const std::vector& data, \ Dune::MPIHelper::MPICommunicator comm); \ diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 164bcfa8c..45d409c8d 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -115,6 +115,7 @@ class Welldims; class WellFoamProperties; class WellPolymerProperties; class WellSegmentDims; +class WellTracerProperties; namespace Mpi { @@ -579,6 +580,7 @@ ADD_PACK_PROTOTYPES(WellPolymerProperties) ADD_PACK_PROTOTYPES(WellSegmentDims) ADD_PACK_PROTOTYPES(WellTestConfig) ADD_PACK_PROTOTYPES(WellTestConfig::WTESTWell) +ADD_PACK_PROTOTYPES(WellTracerProperties) } // end namespace Mpi RestartValue loadParallelRestart(const EclipseIO* eclIO, SummaryState& summaryState, diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index c64053eb7..37099289c 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -1336,6 +1337,17 @@ BOOST_AUTO_TEST_CASE(WellFoamProperties) } +BOOST_AUTO_TEST_CASE(WellTracerProperties) +{ +#ifdef HAVE_MPI + Opm::WellTracerProperties val1({{"test", 1.0}, {"test2", 2.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;