mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add mpi serialization for Rock2dTable
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/NNC.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Edit/EDITNNC.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/Rock2dTable.hpp>
|
||||
#include <dune/common/parallel/mpitraits.hh>
|
||||
|
||||
namespace Opm
|
||||
@@ -226,6 +227,12 @@ std::size_t packSize(const EDITNNC& data, Dune::MPIHelper::MPICommunicator comm)
|
||||
return packSize(data.data(), comm);
|
||||
}
|
||||
|
||||
std::size_t packSize(const Rock2dTable& data, Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
return packSize(data.pvmultValues(), comm) +
|
||||
packSize(data.pressureValues(), comm);
|
||||
}
|
||||
|
||||
////// pack routines
|
||||
|
||||
template<class T>
|
||||
@@ -458,6 +465,13 @@ void pack(const EDITNNC& data, std::vector<char>& buffer, int& position,
|
||||
pack(data.data(), buffer, position, comm);
|
||||
}
|
||||
|
||||
void pack(const Rock2dTable& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
pack(data.pvmultValues(), buffer, position, comm);
|
||||
pack(data.pressureValues(), buffer, position, comm);
|
||||
}
|
||||
|
||||
/// unpack routines
|
||||
|
||||
template<class T>
|
||||
@@ -706,6 +720,16 @@ void unpack(EDITNNC& data, std::vector<char>& buffer, int& position,
|
||||
data = EDITNNC(res);
|
||||
}
|
||||
|
||||
void unpack(Rock2dTable& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
std::vector<std::vector<double>> pvmultValues;
|
||||
std::vector<double> pressureValues;
|
||||
unpack(pvmultValues, buffer, position, comm);
|
||||
unpack(pressureValues, buffer, position, comm);
|
||||
data = Rock2dTable(pvmultValues, pressureValues);
|
||||
}
|
||||
|
||||
} // end namespace Mpi
|
||||
RestartValue loadParallelRestart(const EclipseIO* eclIO, SummaryState& summaryState,
|
||||
const std::vector<Opm::RestartKey>& solutionKeys,
|
||||
|
||||
Reference in New Issue
Block a user