add mpi serialization for BrineDensityTable

This commit is contained in:
Arne Morten Kvarving 2020-01-08 12:38:37 +01:00 committed by Tor Harald Sandve
parent 555de445d3
commit b9f8429691
3 changed files with 33 additions and 0 deletions

View File

@ -1676,6 +1676,12 @@ std::size_t packSize(const Schedule& data,
packSize(data.getWellGroupEvents(), comm);
}
std::size_t packSize(const BrineDensityTable& data,
Dune::MPIHelper::MPICommunicator comm)
{
return packSize(data.getBrineDensityColumn(), comm);
}
std::size_t packSize(const SummaryNode& data,
Dune::MPIHelper::MPICommunicator comm)
{
@ -3393,6 +3399,13 @@ void pack(const Schedule& data,
pack(data.getWellGroupEvents(), buffer, position, comm);
}
void pack(const BrineDensityTable& data,
std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm)
{
pack(data.getBrineDensityColumn(), buffer, position, comm);
}
void pack(const SummaryNode& data,
std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm)
@ -5847,6 +5860,15 @@ void unpack(Schedule& data, std::vector<char>& buffer, int& position,
rftConfig, nupCol, wellGroupEvents);
}
void unpack(BrineDensityTable& data, std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm)
{
std::vector<double> tableValues;
unpack(tableValues, buffer, position, comm);
data = BrineDensityTable(tableValues);
}
void unpack(SummaryNode& data,
std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm)

View File

@ -75,6 +75,7 @@ namespace Action {
}
class Aqudims;
class BrineDensityTable;
class ColumnSchema;
class Connection;
class DeckItem;
@ -633,6 +634,7 @@ ADD_PACK_PROTOTYPES(Action::ASTNode)
ADD_PACK_PROTOTYPES(Action::Condition)
ADD_PACK_PROTOTYPES(Action::Quantity)
ADD_PACK_PROTOTYPES(Aqudims)
ADD_PACK_PROTOTYPES(BrineDensityTable)
ADD_PACK_PROTOTYPES(ColumnSchema)
ADD_PACK_PROTOTYPES(Connection)
ADD_PACK_PROTOTYPES(data::CellData)

View File

@ -2342,6 +2342,15 @@ BOOST_AUTO_TEST_CASE(Schedule)
#endif
}
BOOST_AUTO_TEST_CASE(BrineDensityTable)
{
#ifdef HAVE_MPI
Opm::BrineDensityTable val1({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
}
BOOST_AUTO_TEST_CASE(SummaryNode)
{