mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add mpi serialization for WatdentTable
This commit is contained in:
@@ -472,6 +472,11 @@ std::size_t packSize(const ViscrefTable& data, Dune::MPIHelper::MPICommunicator
|
||||
return packSize(static_cast<const std::vector<VISCREFRecord>&>(data), comm);
|
||||
}
|
||||
|
||||
std::size_t packSize(const WatdentTable& data, Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
return packSize(static_cast<const std::vector<WATDENTRecord>&>(data), comm);
|
||||
}
|
||||
|
||||
////// pack routines
|
||||
|
||||
template<class T>
|
||||
@@ -929,6 +934,12 @@ void pack(const ViscrefTable& data, std::vector<char>& buffer, int& position,
|
||||
pack(static_cast<const std::vector<VISCREFRecord>&>(data), buffer, position, comm);
|
||||
}
|
||||
|
||||
void pack(const WatdentTable& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
pack(static_cast<const std::vector<WATDENTRecord>&>(data), buffer, position, comm);
|
||||
}
|
||||
|
||||
/// unpack routines
|
||||
|
||||
template<class T>
|
||||
@@ -1505,6 +1516,14 @@ void unpack(ViscrefTable& data, std::vector<char>& buffer, int& position,
|
||||
data = ViscrefTable(pdata);
|
||||
}
|
||||
|
||||
void unpack(WatdentTable& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
std::vector<WATDENTRecord> pdata;
|
||||
unpack(pdata, buffer, position, comm);
|
||||
data = WatdentTable(pdata);
|
||||
}
|
||||
|
||||
} // end namespace Mpi
|
||||
RestartValue loadParallelRestart(const EclipseIO* eclIO, SummaryState& summaryState,
|
||||
const std::vector<Opm::RestartKey>& solutionKeys,
|
||||
|
||||
@@ -78,6 +78,7 @@ class UDQParams;
|
||||
class VISCREFRecord;
|
||||
class ViscrefTable;
|
||||
class WATDENTRecord;
|
||||
class WatdentTable;
|
||||
class Welldims;
|
||||
class WellSegmentDims;
|
||||
|
||||
@@ -306,6 +307,7 @@ ADD_PACK_PROTOTYPES(UDQParams)
|
||||
ADD_PACK_PROTOTYPES(VISCREFRecord)
|
||||
ADD_PACK_PROTOTYPES(ViscrefTable)
|
||||
ADD_PACK_PROTOTYPES(WATDENTRecord)
|
||||
ADD_PACK_PROTOTYPES(WatdentTable)
|
||||
ADD_PACK_PROTOTYPES(Welldims)
|
||||
ADD_PACK_PROTOTYPES(WellSegmentDims)
|
||||
|
||||
|
||||
@@ -816,6 +816,17 @@ BOOST_AUTO_TEST_CASE(WATDENTRecord)
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WatdentTable)
|
||||
{
|
||||
#if HAVE_MPI
|
||||
Opm::WatdentTable val1({Opm::WATDENTRecord{1.0, 2.0, 3.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;
|
||||
|
||||
Reference in New Issue
Block a user