serialize ShrateTable

This commit is contained in:
Arne Morten Kvarving 2020-03-05 14:19:32 +01:00
parent c18beb40f3
commit 1c90a6bb00
3 changed files with 39 additions and 5 deletions

View File

@ -467,6 +467,7 @@ HANDLE_AS_POD(RockConfig::RockComp)
HANDLE_AS_POD(ROCKRecord)
HANDLE_AS_POD(SatFuncControls)
HANDLE_AS_POD(StandardCond)
HANDLE_AS_POD(ShrateRecord)
HANDLE_AS_POD(Tabdims)
HANDLE_AS_POD(TimeStampUTC::YMD)
HANDLE_AS_POD(TlmixparRecord)
@ -860,6 +861,7 @@ std::size_t packSize(const TableManager& data, Dune::MPIHelper::MPICommunicator
packSize(data.getPlyvmhTable(), comm) +
packSize(data.getRockTable(), comm) +
packSize(data.getPlmixparTable(), comm) +
packSize(data.getShrateTable(), comm) +
packSize(data.getTlmixparTable(), comm) +
packSize(data.getViscrefTable(), comm) +
packSize(data.getWatdentTable(), comm) +
@ -876,6 +878,7 @@ std::size_t packSize(const TableManager& data, Dune::MPIHelper::MPICommunicator
packSize(data.useImptvd(), comm) +
packSize(data.useEnptvd(), comm) +
packSize(data.useEqlnum(), comm) +
packSize(data.useShrate(), comm) +
packSize(data.useJFunc(), comm) +
(data.useJFunc() ? packSize(data.getJFunc(), comm) : 0) +
packSize(data.OilDenT(), comm) +
@ -1818,6 +1821,11 @@ std::size_t packSize(const GridDims& data,
return packSize(data.getNXYZ(), comm);
}
std::size_t packSize(const ShrateTable& data, Dune::MPIHelper::MPICommunicator comm)
{
return packSize(static_cast<const std::vector<ShrateRecord>&>(data), comm);
}
std::size_t packSize(const TlmixparTable& data, Dune::MPIHelper::MPICommunicator comm)
{
return packSize(static_cast<const std::vector<TlmixparRecord>&>(data), comm);
@ -2506,6 +2514,7 @@ void pack(const TableManager& data, std::vector<char>& buffer, int& position,
pack(data.getPlyvmhTable(), buffer, position, comm);
pack(data.getRockTable(), buffer, position, comm);
pack(data.getPlmixparTable(), buffer, position, comm);
pack(data.getShrateTable(), buffer, position, comm);
pack(data.getTlmixparTable(), buffer, position, comm);
pack(data.getViscrefTable(), buffer, position, comm);
pack(data.getWatdentTable(), buffer, position, comm);
@ -2522,6 +2531,7 @@ void pack(const TableManager& data, std::vector<char>& buffer, int& position,
pack(data.useImptvd(), buffer, position, comm);
pack(data.useEnptvd(), buffer, position, comm);
pack(data.useEqlnum(), buffer, position, comm);
pack(data.useShrate(), buffer, position, comm);
pack(data.useJFunc(), buffer, position, comm);
if (data.useJFunc())
pack(data.getJFunc(), buffer, position, comm);
@ -3530,6 +3540,12 @@ void pack(const GridDims& data,
pack(data.getNXYZ(), buffer, position, comm);
}
void pack(const ShrateTable& data, std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm)
{
pack(static_cast<const std::vector<ShrateRecord>&>(data), buffer, position, comm);
}
void pack(const TlmixparTable& data, std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm)
{
@ -4445,6 +4461,7 @@ void unpack(TableManager& data, std::vector<char>& buffer, int& position,
RockTable rockTable;
ViscrefTable viscrefTable;
PlmixparTable plmixparTable;
ShrateTable shrateTable;
TlmixparTable tlmixparTable;
WatdentTable watdentTable;
std::vector<PvtwsaltTable> pvtwsaltTables;
@ -4460,6 +4477,7 @@ void unpack(TableManager& data, std::vector<char>& buffer, int& position,
bool hasImptvd;
bool hasEntpvd;
bool hasEqlnum;
bool hasShrate;
DenT oilDenT, gasDenT, watDenT;
StandardCond stcond;
std::size_t gas_comp_index;
@ -4476,6 +4494,7 @@ void unpack(TableManager& data, std::vector<char>& buffer, int& position,
unpack(plyvmhTable, buffer, position, comm);
unpack(rockTable, buffer, position, comm);
unpack(plmixparTable, buffer, position, comm);
unpack(shrateTable, buffer, position, comm);
unpack(tlmixparTable, buffer, position, comm);
unpack(viscrefTable, buffer, position, comm);
unpack(watdentTable, buffer, position, comm);
@ -4492,6 +4511,7 @@ void unpack(TableManager& data, std::vector<char>& buffer, int& position,
unpack(hasImptvd, buffer, position, comm);
unpack(hasEntpvd, buffer, position, comm);
unpack(hasEqlnum, buffer, position, comm);
unpack(hasShrate, buffer, position, comm);
bool hasJf;
unpack(hasJf, buffer, position, comm);
if (hasJf) {
@ -4507,11 +4527,11 @@ void unpack(TableManager& data, std::vector<char>& buffer, int& position,
data = TableManager(simpleTables, pvtgTables, pvtoTables, rock2dTables,
rock2dtrTables, pvtwTable, pvcdoTable, densityTable,
plyvmhTable, rockTable, plmixparTable, tlmixparTable, viscrefTable,
watdentTable, pvtwsaltTables, bdensityTables, sdensityTables,
plymwinjTables, skprwatTables, skprpolyTables, tabdims,
regdims, eqldims, aqudims, hasImptvd, hasEntpvd, hasEqlnum,
jfunc, oilDenT, gasDenT,
plyvmhTable, rockTable, plmixparTable, shrateTable,
tlmixparTable, viscrefTable, watdentTable, pvtwsaltTables,
bdensityTables, sdensityTables, plymwinjTables, skprwatTables,
skprpolyTables, tabdims, regdims, eqldims, aqudims, hasImptvd,
hasEntpvd, hasEqlnum, hasShrate, jfunc, oilDenT, gasDenT,
watDenT, stcond, gas_comp_index, rtemp);
}
@ -5955,6 +5975,14 @@ void unpack(GridDims& data,
data = GridDims(NXYZ);
}
void unpack(ShrateTable& data, std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm)
{
std::vector<ShrateRecord> pdata;
unpack(pdata, buffer, position, comm);
data = ShrateTable(pdata);
}
void unpack(TlmixparTable& data, std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm)
{

View File

@ -132,6 +132,8 @@ class Rock2dtrTable;
class Runspec;
class Schedule;
class Segment;
class ShrateRecord;
class ShrateTable;
class SimulationConfig;
class SimpleTable;
class SkprpolyTable;
@ -594,6 +596,8 @@ ADD_PACK_PROTOTYPES(Rock2dtrTable)
ADD_PACK_PROTOTYPES(Runspec)
ADD_PACK_PROTOTYPES(Schedule)
ADD_PACK_PROTOTYPES(Segment)
ADD_PACK_PROTOTYPES(ShrateRecord)
ADD_PACK_PROTOTYPES(ShrateTable)
ADD_PACK_PROTOTYPES(SimulationConfig)
ADD_PACK_PROTOTYPES(SimpleTable)
ADD_PACK_PROTOTYPES(SkprpolyTable)

View File

@ -1211,6 +1211,7 @@ BOOST_AUTO_TEST_CASE(TableManager)
Opm::PlyvmhTable({Opm::PlyvmhRecord{1.0, 2.0, 3.0, 4.0}}),
Opm::RockTable({Opm::ROCKRecord{1.0,2.0}}),
Opm::PlmixparTable({Opm::PlmixparRecord{1.0}}),
Opm::ShrateTable({Opm::ShrateRecord{1.0}}),
Opm::TlmixparTable({Opm::TlmixparRecord{1.0, 2.0}}),
Opm::ViscrefTable({Opm::VISCREFRecord{1.0, 2.0}}),
Opm::WatdentTable({Opm::WATDENTRecord{1.0, 2.0, 3.0}}),
@ -1227,6 +1228,7 @@ BOOST_AUTO_TEST_CASE(TableManager)
true,
true,
true,
true,
jfunc,
getDenT(),
getDenT(),