mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add mpi serialization for BrineDensityTable
This commit is contained in:
parent
555de445d3
commit
b9f8429691
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user