mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add mpi serialization for PolyInjTable
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
#include <opm/parser/eclipse/EclipseState/Tables/ColumnSchema.hpp>
|
#include <opm/parser/eclipse/EclipseState/Tables/ColumnSchema.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/Tables/FlatTable.hpp>
|
#include <opm/parser/eclipse/EclipseState/Tables/FlatTable.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/Tables/JFunc.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/PvtgTable.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/Tables/PvtoTable.hpp>
|
#include <opm/parser/eclipse/EclipseState/Tables/PvtoTable.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/Tables/Rock2dTable.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);
|
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
|
////// pack routines
|
||||||
|
|
||||||
template<class T>
|
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);
|
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
|
/// unpack routines
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
@@ -1524,6 +1542,19 @@ void unpack(WatdentTable& data, std::vector<char>& buffer, int& position,
|
|||||||
data = WatdentTable(pdata);
|
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
|
} // end namespace Mpi
|
||||||
RestartValue loadParallelRestart(const EclipseIO* eclIO, SummaryState& summaryState,
|
RestartValue loadParallelRestart(const EclipseIO* eclIO, SummaryState& summaryState,
|
||||||
const std::vector<Opm::RestartKey>& solutionKeys,
|
const std::vector<Opm::RestartKey>& solutionKeys,
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ class JFunc;
|
|||||||
class NNC;
|
class NNC;
|
||||||
struct NNCdata;
|
struct NNCdata;
|
||||||
class Phases;
|
class Phases;
|
||||||
|
class PolyInjTable;
|
||||||
class PVCDORecord;
|
class PVCDORecord;
|
||||||
class PvcdoTable;
|
class PvcdoTable;
|
||||||
class PvtgTable;
|
class PvtgTable;
|
||||||
@@ -280,6 +281,7 @@ ADD_PACK_PROTOTYPES(JFunc)
|
|||||||
ADD_PACK_PROTOTYPES(NNC)
|
ADD_PACK_PROTOTYPES(NNC)
|
||||||
ADD_PACK_PROTOTYPES(NNCdata)
|
ADD_PACK_PROTOTYPES(NNCdata)
|
||||||
ADD_PACK_PROTOTYPES(Phases)
|
ADD_PACK_PROTOTYPES(Phases)
|
||||||
|
ADD_PACK_PROTOTYPES(PolyInjTable)
|
||||||
ADD_PACK_PROTOTYPES(PVCDORecord)
|
ADD_PACK_PROTOTYPES(PVCDORecord)
|
||||||
ADD_PACK_PROTOTYPES(PvcdoTable)
|
ADD_PACK_PROTOTYPES(PvcdoTable)
|
||||||
ADD_PACK_PROTOTYPES(PvtgTable)
|
ADD_PACK_PROTOTYPES(PvtgTable)
|
||||||
|
|||||||
Reference in New Issue
Block a user