add mpi serialization for FaultCollection

This commit is contained in:
Arne Morten Kvarving
2020-01-21 15:00:34 +01:00
parent d00ee94561
commit 468c220bca
3 changed files with 39 additions and 0 deletions
+23
View File
@@ -2005,6 +2005,12 @@ std::size_t packSize(const Fault& data,
packSize(data.getFaceList(), comm);
}
std::size_t packSize(const FaultCollection& data,
Dune::MPIHelper::MPICommunicator comm)
{
return packSize(data.getFaults(), comm);
}
////// pack routines
template<class T>
@@ -3919,6 +3925,13 @@ void pack(const Fault& data,
pack(data.getFaceList(), buffer, position, comm);
}
void pack(const FaultCollection& data,
std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm)
{
pack(data.getFaults(), buffer, position, comm);
}
/// unpack routines
template<class T>
@@ -6659,6 +6672,16 @@ void unpack(Fault& data,
data = Fault(name, transMult, faceList);
}
void unpack(FaultCollection& data,
std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm)
{
OrderedMap<std::string, Fault> faults;
unpack(faults, buffer, position, comm);
data = FaultCollection(faults);
}
#define INSTANTIATE_PACK_VECTOR(...) \
template std::size_t packSize(const std::vector<__VA_ARGS__>& data, \
Dune::MPIHelper::MPICommunicator comm); \
+2
View File
@@ -92,6 +92,7 @@ class Equil;
class EquilRecord;
class Events;
class Fault;
class FaultCollection;
class FaultFace;
class FoamConfig;
class FoamData;
@@ -668,6 +669,7 @@ ADD_PACK_PROTOTYPES(Eqldims)
ADD_PACK_PROTOTYPES(EquilRecord)
ADD_PACK_PROTOTYPES(Events)
ADD_PACK_PROTOTYPES(Fault)
ADD_PACK_PROTOTYPES(FaultCollection)
ADD_PACK_PROTOTYPES(FaultFace)
ADD_PACK_PROTOTYPES(FoamConfig)
ADD_PACK_PROTOTYPES(FoamData)