mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add mpi serialization for PvtwsaltTable
This commit is contained in:
committed by
Tor Harald Sandve
parent
b9f8429691
commit
1f8ed78683
@@ -1682,6 +1682,14 @@ std::size_t packSize(const BrineDensityTable& data,
|
||||
return packSize(data.getBrineDensityColumn(), comm);
|
||||
}
|
||||
|
||||
std::size_t packSize(const PvtwsaltTable& data,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
return packSize(data.getReferencePressureValue(), comm) +
|
||||
packSize(data.getReferenceSaltConcentrationValue(), comm) +
|
||||
packSize(data.getTableValues(), comm);
|
||||
}
|
||||
|
||||
std::size_t packSize(const SummaryNode& data,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
@@ -3406,28 +3414,6 @@ void pack(const BrineDensityTable& data,
|
||||
pack(data.getBrineDensityColumn(), buffer, position, comm);
|
||||
}
|
||||
|
||||
void pack(const SummaryNode& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
pack(data.keyword(), buffer, position, comm);
|
||||
pack(data.category(), buffer, position, comm);
|
||||
pack(data.location(), buffer, position, comm) ;
|
||||
pack(data.type(), buffer, position, comm);
|
||||
pack(data.namedEntity(), buffer, position, comm);
|
||||
pack(data.number(), buffer, position, comm);
|
||||
pack(data.isUserDefined(), buffer, position, comm);
|
||||
}
|
||||
|
||||
void pack(const SummaryConfig& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
pack(data.getKwds(), buffer, position, comm);
|
||||
pack(data.getShortKwds(), buffer, position, comm);
|
||||
pack(data.getSmryKwds(), buffer, position, comm);
|
||||
}
|
||||
|
||||
/// unpack routines
|
||||
|
||||
template<class T>
|
||||
@@ -5869,6 +5855,18 @@ void unpack(BrineDensityTable& data, std::vector<char>& buffer, int& position,
|
||||
data = BrineDensityTable(tableValues);
|
||||
}
|
||||
|
||||
void unpack(PvtwsaltTable& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
double refPressValue, refSaltConValue;
|
||||
std::vector<double> tableValues;
|
||||
|
||||
unpack(refPressValue, buffer, position, comm);
|
||||
unpack(refSaltConValue, buffer, position, comm);
|
||||
unpack(tableValues, buffer, position, comm);
|
||||
data = PvtwsaltTable(refPressValue, refSaltConValue, tableValues);
|
||||
}
|
||||
|
||||
void unpack(SummaryNode& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
|
||||
@@ -110,6 +110,7 @@ class PvcdoTable;
|
||||
class PvtgTable;
|
||||
class PvtoTable;
|
||||
class PVTWRecord;
|
||||
class PvtwsaltTable;
|
||||
class PvtwTable;
|
||||
class Regdims;
|
||||
class RestartConfig;
|
||||
@@ -688,6 +689,7 @@ ADD_PACK_PROTOTYPES(PvcdoTable)
|
||||
ADD_PACK_PROTOTYPES(PvtgTable)
|
||||
ADD_PACK_PROTOTYPES(PvtoTable)
|
||||
ADD_PACK_PROTOTYPES(PVTWRecord)
|
||||
ADD_PACK_PROTOTYPES(PvtwsaltTable)
|
||||
ADD_PACK_PROTOTYPES(PvtwTable)
|
||||
ADD_PACK_PROTOTYPES(Regdims)
|
||||
ADD_PACK_PROTOTYPES(RestartConfig)
|
||||
|
||||
@@ -2387,6 +2387,17 @@ BOOST_AUTO_TEST_CASE(SummaryConfig)
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(PvtwsaltTable)
|
||||
{
|
||||
#ifdef HAVE_MPI
|
||||
Opm::PvtwsaltTable val1(1.0, 2.0, {3.0, 4.0, 5.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