mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-29 04:23:48 -06:00
add mpi serialization for PolyInjTable
This commit is contained in:
parent
2511121a84
commit
0cadc377ac
@ -36,6 +36,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/ColumnSchema.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/FlatTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/JFunc.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PolyInjTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PvtgTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PvtoTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/Rock2dTable.hpp>
|
||||
@ -477,6 +478,14 @@ std::size_t packSize(const WatdentTable& data, Dune::MPIHelper::MPICommunicator
|
||||
return packSize(static_cast<const std::vector<WATDENTRecord>&>(data), comm);
|
||||
}
|
||||
|
||||
std::size_t packSize(const PolyInjTable& data, Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
return packSize(data.getThroughputs(), comm) +
|
||||
packSize(data.getVelocities(), comm) +
|
||||
packSize(data.getTableNumber(), comm) +
|
||||
packSize(data.getTableData(), comm);
|
||||
}
|
||||
|
||||
////// pack routines
|
||||
|
||||
template<class T>
|
||||
@ -940,6 +949,15 @@ void pack(const WatdentTable& data, std::vector<char>& buffer, int& position,
|
||||
pack(static_cast<const std::vector<WATDENTRecord>&>(data), buffer, position, comm);
|
||||
}
|
||||
|
||||
void pack(const PolyInjTable& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
pack(data.getThroughputs(), buffer, position, comm);
|
||||
pack(data.getVelocities(), buffer, position, comm);
|
||||
pack(data.getTableNumber(), buffer, position, comm);
|
||||
pack(data.getTableData(), buffer, position, comm);
|
||||
}
|
||||
|
||||
/// unpack routines
|
||||
|
||||
template<class T>
|
||||
@ -1524,6 +1542,19 @@ void unpack(WatdentTable& data, std::vector<char>& buffer, int& position,
|
||||
data = WatdentTable(pdata);
|
||||
}
|
||||
|
||||
void unpack(PolyInjTable& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
std::vector<double> throughputs, velocities;
|
||||
int tableNumber;
|
||||
std::vector<std::vector<double>> tableData;
|
||||
unpack(throughputs, buffer, position, comm);
|
||||
unpack(velocities, buffer, position, comm);
|
||||
unpack(tableNumber, buffer, position, comm);
|
||||
unpack(tableData, buffer, position, comm);
|
||||
data = PolyInjTable(throughputs, velocities, tableNumber, tableData);
|
||||
}
|
||||
|
||||
} // end namespace Mpi
|
||||
RestartValue loadParallelRestart(const EclipseIO* eclIO, SummaryState& summaryState,
|
||||
const std::vector<Opm::RestartKey>& solutionKeys,
|
||||
|
@ -56,6 +56,7 @@ class JFunc;
|
||||
class NNC;
|
||||
struct NNCdata;
|
||||
class Phases;
|
||||
class PolyInjTable;
|
||||
class PVCDORecord;
|
||||
class PvcdoTable;
|
||||
class PvtgTable;
|
||||
@ -280,6 +281,7 @@ ADD_PACK_PROTOTYPES(JFunc)
|
||||
ADD_PACK_PROTOTYPES(NNC)
|
||||
ADD_PACK_PROTOTYPES(NNCdata)
|
||||
ADD_PACK_PROTOTYPES(Phases)
|
||||
ADD_PACK_PROTOTYPES(PolyInjTable)
|
||||
ADD_PACK_PROTOTYPES(PVCDORecord)
|
||||
ADD_PACK_PROTOTYPES(PvcdoTable)
|
||||
ADD_PACK_PROTOTYPES(PvtgTable)
|
||||
|
Loading…
Reference in New Issue
Block a user