diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index b90bfe998..4a6d95fbc 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -1990,6 +1990,13 @@ std::size_t packSize(const TransMult& data, packSize(data.getScanner(), comm); } +std::size_t packSize(const FaultFace& data, + Dune::MPIHelper::MPICommunicator comm) +{ + return packSize(data.getIndices(), comm) + + packSize(data.getDir(), comm); +} + ////// pack routines template @@ -3887,6 +3894,14 @@ void pack(const TransMult& data, pack(data.getScanner(), buffer, position, comm); } +void pack(const FaultFace& data, + std::vector& buffer, int& position, + Dune::MPIHelper::MPICommunicator comm) +{ + pack(data.getIndices(), buffer, position, comm); + pack(data.getDir(), buffer, position, comm); +} + /// unpack routines template @@ -6601,6 +6616,18 @@ void unpack(TransMult& data, data = TransMult(size, trans, names, scanner); } +void unpack(FaultFace& data, + std::vector& buffer, int& position, + Dune::MPIHelper::MPICommunicator comm) +{ + std::vector indices; + FaceDir::DirEnum dir; + + unpack(indices, buffer, position, comm); + unpack(dir, buffer, position, comm); + data = FaultFace(indices, dir); +} + #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 ca5e37c7b..108a82963 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -91,6 +91,7 @@ class EndpointScaling; class Equil; class EquilRecord; class Events; +class FaultFace; class FoamConfig; class FoamData; class InitConfig; @@ -665,6 +666,7 @@ ADD_PACK_PROTOTYPES(Equil) ADD_PACK_PROTOTYPES(Eqldims) ADD_PACK_PROTOTYPES(EquilRecord) ADD_PACK_PROTOTYPES(Events) +ADD_PACK_PROTOTYPES(FaultFace) ADD_PACK_PROTOTYPES(FoamConfig) ADD_PACK_PROTOTYPES(FoamData) ADD_PACK_PROTOTYPES(GConSale) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 960fcb854..2e30a0edd 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -2490,6 +2490,17 @@ BOOST_AUTO_TEST_CASE(TransMult) } +BOOST_AUTO_TEST_CASE(FaultFace) +{ +#ifdef HAVE_MPI + Opm::FaultFace val1({1,2,3,4,5,6}, Opm::FaceDir::YPlus); + 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;