mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-16 20:24:48 -06:00
remove old serialization support for TableManager
This commit is contained in:
parent
258fed1bd5
commit
f12c83bd8e
@ -52,8 +52,6 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WList.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/FlatTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/TableManager.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Util/IOrderSet.hpp>
|
||||
#include <dune/common/parallel/mpitraits.hh>
|
||||
|
||||
@ -354,96 +352,6 @@ std::size_t packSize(const RestartConfig& data, Dune::MPIHelper::MPICommunicator
|
||||
packSize(data.saveKeywords(), comm);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
struct SplitSimpleTables {
|
||||
size_t plyshMax = 0;
|
||||
size_t rockMax = 0;
|
||||
std::map<size_t, std::shared_ptr<PlyshlogTable>> plyshMap;
|
||||
std::map<size_t, std::shared_ptr<RocktabTable>> rockMap;
|
||||
};
|
||||
|
||||
SplitSimpleTables
|
||||
splitSimpleTable(std::map<std::string, TableContainer>& simpleTables)
|
||||
{
|
||||
SplitSimpleTables result;
|
||||
|
||||
// PlyshlogTable need special treatment
|
||||
auto it = simpleTables.find("PLYSHLOG");
|
||||
if (it != simpleTables.end()) {
|
||||
result.plyshMax = it->second.max();
|
||||
for (const auto& mapIt : it->second.tables()) {
|
||||
auto ptr = std::static_pointer_cast<PlyshlogTable>(mapIt.second);
|
||||
result.plyshMap.insert(std::make_pair(mapIt.first, ptr));
|
||||
}
|
||||
simpleTables.erase(it);
|
||||
}
|
||||
|
||||
// RocktabTable need special treatment
|
||||
it = simpleTables.find("ROCKMAP");
|
||||
if (it != simpleTables.end()) {
|
||||
result.rockMax = it->second.max();
|
||||
for (const auto& mapIt : it->second.tables()) {
|
||||
auto ptr = std::static_pointer_cast<RocktabTable>(mapIt.second);
|
||||
result.rockMap.insert(std::make_pair(mapIt.first, ptr));
|
||||
}
|
||||
simpleTables.erase(it);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::size_t packSize(const TableManager& data, Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
auto simpleTables = data.getSimpleTables();
|
||||
auto splitTab = splitSimpleTable(simpleTables);
|
||||
|
||||
return packSize(simpleTables, comm) +
|
||||
packSize(splitTab.plyshMax, comm) +
|
||||
packSize(splitTab.plyshMap, comm) +
|
||||
packSize(splitTab.rockMax, comm) +
|
||||
packSize(splitTab.rockMap, comm) +
|
||||
packSize(data.getPvtgTables(), comm) +
|
||||
packSize(data.getPvtoTables(), comm) +
|
||||
packSize(data.getRock2dTables(), comm) +
|
||||
packSize(data.getRock2dtrTables(), comm) +
|
||||
packSize(data.getPvtwTable(), comm) +
|
||||
packSize(data.getPvcdoTable(), comm) +
|
||||
packSize(data.getDensityTable(), comm) +
|
||||
packSize(data.getPlyvmhTable(), comm) +
|
||||
packSize(data.getRockTable(), comm) +
|
||||
packSize(data.getPlmixparTable(), comm) +
|
||||
packSize(data.getShrateTable(), comm) +
|
||||
packSize(data.getStone1exTable(), comm) +
|
||||
packSize(data.getTlmixparTable(), comm) +
|
||||
packSize(data.getViscrefTable(), comm) +
|
||||
packSize(data.getWatdentTable(), comm) +
|
||||
packSize(data.getPvtwSaltTables(), comm) +
|
||||
packSize(data.getBrineDensityTables(), comm) +
|
||||
packSize(data.getSolventDensityTables(), comm) +
|
||||
packSize(data.getPlymwinjTables(), comm) +
|
||||
packSize(data.getSkprwatTables(), comm) +
|
||||
packSize(data.getSkprpolyTables(), comm) +
|
||||
packSize(data.getTabdims(), comm) +
|
||||
packSize(data.getRegdims(), comm) +
|
||||
packSize(data.getEqldims(), comm) +
|
||||
packSize(data.getAqudims(), comm) +
|
||||
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) +
|
||||
packSize(data.GasDenT(), comm) +
|
||||
packSize(data.WatDenT(), comm) +
|
||||
packSize(data.stCond(), comm) +
|
||||
packSize(data.gas_comp_index(), comm) +
|
||||
packSize(data.rtemp(), comm);
|
||||
}
|
||||
|
||||
template
|
||||
std::size_t packSize(const std::map<Phase,Group::GroupInjectionProperties>& data,
|
||||
Dune::MPIHelper::MPICommunicator comm);
|
||||
@ -1336,57 +1244,6 @@ void pack(const RestartConfig& data, std::vector<char>& buffer, int& position,
|
||||
pack(data.saveKeywords(), buffer, position, comm);
|
||||
}
|
||||
|
||||
void pack(const TableManager& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
auto simpleTables = data.getSimpleTables();
|
||||
auto splitTab = splitSimpleTable(simpleTables);
|
||||
|
||||
pack(simpleTables, buffer, position, comm);
|
||||
pack(splitTab.plyshMax, buffer, position, comm);
|
||||
pack(splitTab.plyshMap, buffer, position, comm);
|
||||
pack(splitTab.rockMax, buffer, position, comm);
|
||||
pack(splitTab.rockMap, buffer, position, comm);
|
||||
pack(data.getPvtgTables(), buffer, position, comm);
|
||||
pack(data.getPvtoTables(), buffer, position, comm);
|
||||
pack(data.getRock2dTables(), buffer, position, comm);
|
||||
pack(data.getRock2dtrTables(), buffer, position, comm);
|
||||
pack(data.getPvtwTable(), buffer, position, comm);
|
||||
pack(data.getPvcdoTable(), buffer, position, comm);
|
||||
pack(data.getDensityTable(), buffer, position, comm);
|
||||
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.getStone1exTable(), buffer, position, comm);
|
||||
pack(data.getTlmixparTable(), buffer, position, comm);
|
||||
pack(data.getViscrefTable(), buffer, position, comm);
|
||||
pack(data.getWatdentTable(), buffer, position, comm);
|
||||
pack(data.getPvtwSaltTables(), buffer, position, comm);
|
||||
pack(data.getBrineDensityTables(), buffer, position, comm);
|
||||
pack(data.getSolventDensityTables(), buffer, position, comm);
|
||||
pack(data.getPlymwinjTables(), buffer, position, comm);
|
||||
pack(data.getSkprwatTables(), buffer, position, comm);
|
||||
pack(data.getSkprpolyTables(), buffer, position, comm);
|
||||
pack(data.getTabdims(), buffer, position, comm);
|
||||
pack(data.getRegdims(), buffer, position, comm);
|
||||
pack(data.getEqldims(), buffer, position, comm);
|
||||
pack(data.getAqudims(), buffer, position, comm);
|
||||
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);
|
||||
pack(data.OilDenT(), buffer, position, comm);
|
||||
pack(data.GasDenT(), buffer, position, comm);
|
||||
pack(data.WatDenT(), buffer, position, comm);
|
||||
pack(data.stCond(), buffer, position, comm);
|
||||
pack(data.gas_comp_index(), buffer, position, comm);
|
||||
pack(data.rtemp(), buffer, position, comm);
|
||||
}
|
||||
|
||||
void pack(const OilVaporizationProperties& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
@ -2351,118 +2208,6 @@ void unpack(RestartConfig& data, std::vector<char>& buffer, int& position,
|
||||
restart_keyw, save_keyw);
|
||||
}
|
||||
|
||||
void unpack(TableManager& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
std::map<std::string, TableContainer> simpleTables;
|
||||
SplitSimpleTables split;
|
||||
std::vector<PvtgTable> pvtgTables;
|
||||
std::vector<PvtoTable> pvtoTables;
|
||||
std::vector<Rock2dTable> rock2dTables;
|
||||
std::vector<Rock2dtrTable> rock2dtrTables;
|
||||
PvtwTable pvtwTable;
|
||||
PvcdoTable pvcdoTable;
|
||||
DensityTable densityTable;
|
||||
PlyvmhTable plyvmhTable;
|
||||
RockTable rockTable;
|
||||
ViscrefTable viscrefTable;
|
||||
PlmixparTable plmixparTable;
|
||||
ShrateTable shrateTable;
|
||||
Stone1exTable stone1exTable;
|
||||
TlmixparTable tlmixparTable;
|
||||
WatdentTable watdentTable;
|
||||
std::vector<PvtwsaltTable> pvtwsaltTables;
|
||||
std::vector<BrineDensityTable> bdensityTables;
|
||||
std::vector<SolventDensityTable> sdensityTables;
|
||||
std::map<int, PlymwinjTable> plymwinjTables;
|
||||
std::map<int, SkprwatTable> skprwatTables;
|
||||
std::map<int, SkprpolyTable> skprpolyTables;
|
||||
Tabdims tabdims;
|
||||
Regdims regdims;
|
||||
Eqldims eqldims;
|
||||
Aqudims aqudims;
|
||||
bool hasImptvd;
|
||||
bool hasEntpvd;
|
||||
bool hasEqlnum;
|
||||
bool hasShrate;
|
||||
DenT oilDenT, gasDenT, watDenT;
|
||||
StandardCond stcond;
|
||||
std::size_t gas_comp_index;
|
||||
std::shared_ptr<JFunc> jfunc;
|
||||
double rtemp;
|
||||
|
||||
unpack(simpleTables, buffer, position, comm);
|
||||
unpack(split.plyshMax, buffer, position, comm);
|
||||
unpack(split.plyshMap, buffer, position, comm);
|
||||
unpack(split.rockMax, buffer, position, comm);
|
||||
unpack(split.rockMap, buffer, position, comm);
|
||||
unpack(pvtgTables, buffer, position, comm);
|
||||
unpack(pvtoTables, buffer, position, comm);
|
||||
unpack(rock2dTables, buffer, position, comm);
|
||||
unpack(rock2dtrTables, buffer, position, comm);
|
||||
unpack(pvtwTable, buffer, position, comm);
|
||||
unpack(pvcdoTable, buffer, position, comm);
|
||||
unpack(densityTable, buffer, position, comm);
|
||||
unpack(plyvmhTable, buffer, position, comm);
|
||||
unpack(rockTable, buffer, position, comm);
|
||||
unpack(plmixparTable, buffer, position, comm);
|
||||
unpack(shrateTable, buffer, position, comm);
|
||||
unpack(stone1exTable, buffer, position, comm);
|
||||
unpack(tlmixparTable, buffer, position, comm);
|
||||
unpack(viscrefTable, buffer, position, comm);
|
||||
unpack(watdentTable, buffer, position, comm);
|
||||
unpack(pvtwsaltTables, buffer, position, comm);
|
||||
unpack(bdensityTables, buffer, position, comm);
|
||||
unpack(sdensityTables, buffer, position, comm);
|
||||
unpack(plymwinjTables, buffer, position, comm);
|
||||
unpack(skprwatTables, buffer, position, comm);
|
||||
unpack(skprpolyTables, buffer, position, comm);
|
||||
unpack(tabdims, buffer, position, comm);
|
||||
unpack(regdims, buffer, position, comm);
|
||||
unpack(eqldims, buffer, position, comm);
|
||||
unpack(aqudims, buffer, position, comm);
|
||||
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) {
|
||||
jfunc = std::make_shared<JFunc>();
|
||||
unpack(*jfunc, buffer, position, comm);
|
||||
}
|
||||
unpack(oilDenT, buffer, position, comm);
|
||||
unpack(gasDenT, buffer, position, comm);
|
||||
unpack(watDenT, buffer, position, comm);
|
||||
unpack(stcond, buffer, position, comm);
|
||||
unpack(gas_comp_index, buffer, position, comm);
|
||||
unpack(rtemp, buffer, position, comm);
|
||||
|
||||
if (split.plyshMax > 0) {
|
||||
TableContainer container(split.plyshMax);
|
||||
for (const auto& it : split.plyshMap) {
|
||||
container.addTable(it.first, it.second);
|
||||
}
|
||||
simpleTables.insert(std::make_pair("PLYSHLOG", container));
|
||||
}
|
||||
if (split.rockMax > 0) {
|
||||
TableContainer container(split.rockMax);
|
||||
for (const auto& it : split.rockMap) {
|
||||
container.addTable(it.first, it.second);
|
||||
}
|
||||
simpleTables.insert(std::make_pair("ROCKTAB", container));
|
||||
}
|
||||
|
||||
data = TableManager(simpleTables, pvtgTables, pvtoTables, rock2dTables,
|
||||
rock2dtrTables, pvtwTable, pvcdoTable, densityTable,
|
||||
plyvmhTable, rockTable, plmixparTable, shrateTable, stone1exTable,
|
||||
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);
|
||||
}
|
||||
|
||||
void unpack(OilVaporizationProperties& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
|
@ -72,7 +72,6 @@ class RestartSchedule;
|
||||
class RFTConfig;
|
||||
class Segment;
|
||||
class SpiralICD;
|
||||
class TableManager;
|
||||
class TimeStampUTC;
|
||||
class Tuning;
|
||||
class UDAValue;
|
||||
@ -452,7 +451,6 @@ ADD_PACK_PROTOTYPES(RFTConfig)
|
||||
ADD_PACK_PROTOTYPES(Segment)
|
||||
ADD_PACK_PROTOTYPES(SpiralICD)
|
||||
ADD_PACK_PROTOTYPES(std::string)
|
||||
ADD_PACK_PROTOTYPES(TableManager)
|
||||
ADD_PACK_PROTOTYPES(TimeMap)
|
||||
ADD_PACK_PROTOTYPES(TimeStampUTC)
|
||||
ADD_PACK_PROTOTYPES(Tuning)
|
||||
|
@ -1261,7 +1261,7 @@ BOOST_AUTO_TEST_CASE(TableManager)
|
||||
{7.0, 8.0},
|
||||
77,
|
||||
1.0);
|
||||
auto val2 = PackUnpack(val1);
|
||||
auto val2 = PackUnpack2(val1);
|
||||
DO_CHECKS(TableManager)
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user