diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index d5ae4f10f..d0510e9b9 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -82,6 +82,7 @@ #include #include #include +#include #include #include #include @@ -1848,6 +1849,16 @@ std::size_t packSize(const Stone1exTable& data, Dune::MPIHelper::MPICommunicator return packSize(static_cast&>(data), comm); } +std::size_t packSize(const PlyshlogTable& data, Dune::MPIHelper::MPICommunicator comm) +{ + return packSize(static_cast(data), comm) + + packSize(data.getRefPolymerConcentration(), comm) + + packSize(data.getRefSalinity(), comm) + + packSize(data.getRefTemperature(), comm) + + packSize(data.hasRefSalinity(), comm) + + packSize(data.hasRefTemperature(), comm); +} + ////// pack routines template @@ -3578,6 +3589,17 @@ void pack(const Stone1exTable& data, std::vector& buffer, int& position, pack(static_cast&>(data), buffer, position, comm); } +void pack(const PlyshlogTable& data, std::vector& buffer, int& position, + Dune::MPIHelper::MPICommunicator comm) +{ + pack(static_cast(data), buffer, position, comm); + pack(data.getRefPolymerConcentration(), buffer, position, comm); + pack(data.getRefSalinity(), buffer, position, comm); + pack(data.getRefTemperature(), buffer, position, comm); + pack(data.hasRefSalinity(), buffer, position, comm); + pack(data.hasRefTemperature(), buffer, position, comm); +} + /// unpack routines template @@ -6031,6 +6053,32 @@ void unpack(Stone1exTable& data, std::vector& buffer, int& position, data = Stone1exTable(pdata); } +void unpack(PlyshlogTable& data, std::vector& buffer, int& position, + Dune::MPIHelper::MPICommunicator comm) +{ + TableSchema schema; + OrderedMap columns; + bool jfunc; + double refPolymerConcentration; + double refSalinity; + double refTemperature; + bool hasRefSalinity; + bool hasRefTemperature; + + unpack(schema, buffer, position, comm); + unpack(columns, buffer, position, comm); + unpack(jfunc, buffer, position, comm); + unpack(refPolymerConcentration, buffer, position, comm); + unpack(refSalinity, buffer, position, comm); + unpack(refTemperature, buffer, position, comm); + unpack(hasRefSalinity, buffer, position, comm); + unpack(hasRefTemperature, buffer, position, comm); + + data = PlyshlogTable(schema, columns, jfunc, + refPolymerConcentration, refSalinity, + refTemperature, hasRefSalinity, hasRefTemperature); +} + #define INSTANTIATE_PACK_VECTOR(...) \ template std::size_t packSize(const std::vector<__VA_ARGS__>& data, \ Dune::MPIHelper::MPICommunicator comm); \ diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 3d5781494..86e30c986 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -109,6 +109,7 @@ struct NNCdata; class OilVaporizationProperties; class Phases; class PlymwinjTable; +class PlyshlogTable; class PlyvmhRecord; class PlyvmhTable; class PolyInjTable; @@ -573,6 +574,7 @@ ADD_PACK_PROTOTYPES(Phases) ADD_PACK_PROTOTYPES(PlmixparRecord) ADD_PACK_PROTOTYPES(PlmixparTable) ADD_PACK_PROTOTYPES(PlymwinjTable) +ADD_PACK_PROTOTYPES(PlyshlogTable) ADD_PACK_PROTOTYPES(PlyvmhRecord) ADD_PACK_PROTOTYPES(PlyvmhTable) ADD_PACK_PROTOTYPES(PolyInjTable) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 8d9771490..783ecba10 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -87,6 +87,7 @@ #include #include #include +#include #include #include #include @@ -2387,6 +2388,18 @@ BOOST_AUTO_TEST_CASE(GridDims) } +BOOST_AUTO_TEST_CASE(PlyshlogTable) +{ +#ifdef HAVE_MPI + Opm::OrderedMap data; + data.insert({"test3", getTableColumn()}); + Opm::PlyshlogTable val1(getTableSchema(), data, true, 1.0, 2.0, 3.0, true, true); + auto val2 = PackUnpack(val1); + DO_CHECKS(PlyshlogTable) +#endif +} + + bool init_unit_test_func() { return true;