mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add mpi serialization for Actdims
This commit is contained in:
@@ -200,6 +200,7 @@ std::size_t packSize(const std::unordered_map<T1,T2,H,P,A>& data, Dune::MPIHelpe
|
||||
return totalSize;
|
||||
}
|
||||
|
||||
HANDLE_AS_POD(Actdims)
|
||||
HANDLE_AS_POD(data::Connection)
|
||||
HANDLE_AS_POD(data::Rates)
|
||||
HANDLE_AS_POD(data::Segment)
|
||||
@@ -806,6 +807,16 @@ void pack(const UDQParams& data, std::vector<char>& buffer, int& position,
|
||||
pack(data.cmpEpsilon(), buffer, position, comm);
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
void pack(const EclHysterConfig& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
pack(data.active(), buffer, position, comm);
|
||||
pack(data.pcHysteresisModel(), buffer, position, comm);
|
||||
pack(data.krHysteresisModel(), buffer, position, comm);
|
||||
}
|
||||
|
||||
/// unpack routines
|
||||
|
||||
template<class T>
|
||||
@@ -1296,6 +1307,19 @@ void unpack(UDQParams& data, std::vector<char>& buffer, int& position,
|
||||
data = UDQParams(reseed, rand_seed, range, undefVal, cmp_eps);
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
void unpack(EclHysterConfig& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
bool active;
|
||||
int pc, kr;
|
||||
unpack(active, buffer, position, comm);
|
||||
unpack(pc, buffer, position, comm);
|
||||
unpack(kr, buffer, position, comm);
|
||||
data = EclHysterConfig(active, pc, kr);
|
||||
}
|
||||
|
||||
} // end namespace Mpi
|
||||
RestartValue loadParallelRestart(const EclipseIO* eclIO, SummaryState& summaryState,
|
||||
const std::vector<Opm::RestartKey>& solutionKeys,
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
class Actdims;
|
||||
class ColumnSchema;
|
||||
class EclHysterConfig;
|
||||
class EDITNNC;
|
||||
@@ -241,6 +242,7 @@ void unpack(char* str, std::size_t length, std::vector<char>& buffer, int& posit
|
||||
void unpack(T& data, std::vector<char>& buffer, int& position, \
|
||||
Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
ADD_PACK_PROTOTYPES(Actdims)
|
||||
ADD_PACK_PROTOTYPES(ColumnSchema)
|
||||
ADD_PACK_PROTOTYPES(data::CellData)
|
||||
ADD_PACK_PROTOTYPES(data::Connection)
|
||||
|
||||
@@ -626,6 +626,17 @@ BOOST_AUTO_TEST_CASE(EclHysterConfig)
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Actdims)
|
||||
{
|
||||
#if HAVE_MPI
|
||||
Opm::Actdims val1(1,2,3,4);
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user