diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index afe16a67f..c50172b02 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -888,16 +888,6 @@ std::size_t packSize(const Tabulated1DFunction& data, packSize(data.yValues(), comm); } -template -std::size_t packSize(const SolventPvt& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.solventReferenceDensity(), comm) + - packSize(data.inverseSolventB(), comm) + - packSize(data.solventMu(), comm) + - packSize(data.inverseSolventBMu(), comm); -} - template std::size_t packSize(const IntervalTabulated2DFunction& data, Dune::MPIHelper::MPICommunicator comm) @@ -923,232 +913,6 @@ std::size_t packSize(const UniformXTabulated2DFunction& data, packSize(data.interpolationGuide(), comm); } -template -std::size_t packSize(const DryGasPvt& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.gasReferenceDensity(), comm) + - packSize(data.inverseGasB(), comm) + - packSize(data.gasMu(), comm) + - packSize(data.inverseGasBMu(), comm); -} - -template -std::size_t packSize(const GasPvtThermal& data, - Dune::MPIHelper::MPICommunicator comm) -{ - std::size_t size = packSize(data.gasvisctCurves(), comm) + - packSize(data.gasdentRefTemp(), comm) + - packSize(data.gasdentCT1(), comm) + - packSize(data.gasdentCT2(), comm) + - packSize(data.internalEnergyCurves(), comm) + - packSize(data.enableThermalDensity(), comm) + - packSize(data.enableThermalViscosity(), comm) + - packSize(data.enableInternalEnergy(), comm); - size += packSize(bool(), comm); - if (data.isoThermalPvt()) - size += packSize(*data.isoThermalPvt(), comm); - - return size; -} - -template -std::size_t packSize(const GasPvtMultiplexer& data, - Dune::MPIHelper::MPICommunicator comm) -{ - std::size_t size = packSize(data.gasPvtApproach(), comm); - const void* realGasPvt = data.realGasPvt(); - using PvtApproach = GasPvtMultiplexer; - if (data.gasPvtApproach() == PvtApproach::DryGasPvt) { - const auto& pvt = *static_cast*>(realGasPvt); - size += packSize(pvt, comm); - } else if (data.gasPvtApproach() == PvtApproach::WetGasPvt) { - const auto& pvt = *static_cast*>(realGasPvt); - size += packSize(pvt, comm); - } else if (data.gasPvtApproach() == PvtApproach::ThermalGasPvt) { - const auto& pvt = *static_cast*>(realGasPvt); - size += packSize(pvt, comm); - } - - return size; -} - -template -std::size_t packSize(const WetGasPvt& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.gasReferenceDensity(), comm) + - packSize(data.oilReferenceDensity(), comm) + - packSize(data.inverseGasB(), comm) + - packSize(data.inverseSaturatedGasB(), comm) + - packSize(data.gasMu(), comm) + - packSize(data.inverseGasBMu(), comm) + - packSize(data.inverseSaturatedGasBMu(), comm) + - packSize(data.saturatedOilVaporizationFactorTable(), comm) + - packSize(data.saturationPressure(), comm) + - packSize(data.vapPar1(), comm); -} - -template -std::size_t packSize(const OilPvtMultiplexer& data, - Dune::MPIHelper::MPICommunicator comm) -{ - std::size_t size = packSize(data.approach(), comm); - const void* realOilPvt = data.realOilPvt(); - using PvtApproach = OilPvtMultiplexer; - if (data.approach() == PvtApproach::ConstantCompressibilityOilPvt) { - const auto& pvt = *static_cast*>(realOilPvt); - size += packSize(pvt, comm); - } else if (data.approach() == PvtApproach::DeadOilPvt) { - const auto& pvt = *static_cast*>(realOilPvt); - size += packSize(pvt, comm); - } else if (data.approach() == PvtApproach::LiveOilPvt) { - const auto& pvt = *static_cast*>(realOilPvt); - size += packSize(pvt, comm); - } else if (data.approach() == PvtApproach::ThermalOilPvt) { - const auto& pvt = *static_cast*>(realOilPvt); - size += packSize(pvt, comm); - } - - return size; -} - -template -std::size_t packSize(const ConstantCompressibilityOilPvt& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.oilReferenceDensity(), comm) + - packSize(data.oilReferencePressure(), comm) + - packSize(data.oilReferenceFormationVolumeFactor(), comm) + - packSize(data.oilCompressibility(), comm) + - packSize(data.oilViscosity(), comm) + - packSize(data.oilViscosibility(), comm); -} - -template -std::size_t packSize(const DeadOilPvt& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.oilReferenceDensity(), comm) + - packSize(data.inverseOilB(), comm) + - packSize(data.oilMu(), comm) + - packSize(data.inverseOilBMu(), comm); -} - -template -std::size_t packSize(const LiveOilPvt& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.gasReferenceDensity(), comm) + - packSize(data.oilReferenceDensity(), comm) + - packSize(data.inverseOilBTable(), comm) + - packSize(data.oilMuTable(), comm) + - packSize(data.inverseOilBMuTable(), comm) + - packSize(data.saturatedOilMuTable(), comm) + - packSize(data.inverseSaturatedOilBTable(), comm) + - packSize(data.inverseSaturatedOilBMuTable(), comm) + - packSize(data.saturatedGasDissolutionFactorTable(), comm) + - packSize(data.saturationPressure(), comm) + - packSize(data.vapPar2(), comm); -} - -template -std::size_t packSize(const OilPvtThermal& data, - Dune::MPIHelper::MPICommunicator comm) -{ - std::size_t size = packSize(data.oilvisctCurves(), comm) + - packSize(data.viscrefPress(), comm) + - packSize(data.viscrefRs(), comm) + - packSize(data.viscRef(), comm) + - packSize(data.oildentRefTemp(), comm) + - packSize(data.oildentCT1(), comm) + - packSize(data.oildentCT2(), comm) + - packSize(data.internalEnergyCurves(), comm) + - packSize(data.enableThermalDensity(), comm) + - packSize(data.enableThermalViscosity(), comm) + - packSize(data.enableInternalEnergy(), comm); - size += packSize(bool(), comm); - if (data.isoThermalPvt()) - size += packSize(*data.isoThermalPvt(), comm); - - return size; -} - -template -std::size_t packSize(const WaterPvtMultiplexer& data, - Dune::MPIHelper::MPICommunicator comm) -{ - std::size_t size = packSize(data.approach(), comm); - const void* realWaterPvt = data.realWaterPvt(); - using PvtApproach = WaterPvtMultiplexer; - if (data.approach() == PvtApproach::ConstantCompressibilityWaterPvt) { - const auto& pvt = *static_cast*>(realWaterPvt); - size += packSize(pvt, comm); - } else if (data.approach() == PvtApproach::ThermalWaterPvt) { - const auto& pvt = *static_cast*>(realWaterPvt); - size += packSize(pvt, comm); - } else if (data.approach() == PvtApproach::ConstantCompressibilityBrinePvt) { - const auto& pvt = *static_cast*>(realWaterPvt); - size += packSize(pvt, comm); - } - - return size; -} - -template -std::size_t packSize(const ConstantCompressibilityWaterPvt& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.waterReferenceDensity(), comm) + - packSize(data.waterReferencePressure(), comm) + - packSize(data.waterReferenceFormationVolumeFactor(), comm) + - packSize(data.waterCompressibility(), comm) + - packSize(data.waterViscosity(), comm) + - packSize(data.waterViscosibility(), comm); -} - -template -std::size_t packSize(const WaterPvtThermal& data, - Dune::MPIHelper::MPICommunicator comm) -{ - std::size_t size = packSize(data.viscrefPress(), comm) + - packSize(data.watdentRefTemp(), comm) + - packSize(data.watdentCT1(), comm) + - packSize(data.watdentCT2(), comm) + - packSize(data.pvtwRefPress(), comm) + - packSize(data.pvtwRefB(), comm) + - packSize(data.pvtwCompressibility(), comm) + - packSize(data.pvtwViscosity(), comm) + - packSize(data.pvtwViscosibility(), comm) + - packSize(data.watvisctCurves(), comm) + - packSize(data.internalEnergyCurves(), comm) + - packSize(data.enableThermalDensity(), comm) + - packSize(data.enableThermalViscosity(), comm) + - packSize(data.enableInternalEnergy(), comm); - size += packSize(bool(), comm); - if (data.isoThermalPvt()) - size += packSize(data.isoThermalPvt()->approach(), comm); - - using PvtApproach = WaterPvtThermal; - if (data.isoThermalPvt()->approach() != PvtApproach::IsothermalPvt::NoWaterPvt) { - size += packSize(*data.isoThermalPvt(), comm); - } - - return size; -} - -template -std::size_t packSize(const ConstantCompressibilityBrinePvt& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.waterReferenceDensity(), comm) + - packSize(data.referencePressure(), comm) + - packSize(data.formationVolumeTables(), comm) + - packSize(data.compressibilityTables(), comm) + - packSize(data.viscosityTables(), comm) + - packSize(data.viscosibilityTables(), comm); -} - template std::size_t packSize(const EclEpsScalingPointsInfo& data, Dune::MPIHelper::MPICommunicator comm) @@ -2778,241 +2542,6 @@ void pack(const UniformXTabulated2DFunction& data, std::vector& bu pack(data.interpolationGuide(), buffer, position, comm); } -template -void pack(const SolventPvt& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.solventReferenceDensity(), buffer, position, comm); - pack(data.inverseSolventB(), buffer, position, comm); - pack(data.solventMu(), buffer, position, comm); - pack(data.inverseSolventBMu(), buffer, position, comm); -} - -template -void pack(const GasPvtMultiplexer& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.gasPvtApproach(), buffer, position, comm); - const void* realGasPvt = data.realGasPvt(); - using PvtApproach = GasPvtMultiplexer; - if (data.gasPvtApproach() == PvtApproach::DryGasPvt) { - const auto& pvt = *static_cast*>(realGasPvt); - pack(pvt, buffer, position, comm); - } else if (data.gasPvtApproach() == PvtApproach::WetGasPvt) { - const auto& pvt = *static_cast*>(realGasPvt); - pack(pvt, buffer, position, comm); - } else if (data.gasPvtApproach() == PvtApproach::ThermalGasPvt) { - const auto& pvt = *static_cast*>(realGasPvt); - pack(pvt, buffer, position, comm); - } -} - -template -void pack(const DryGasPvt& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.gasReferenceDensity(), buffer, position, comm); - pack(data.inverseGasB(), buffer, position, comm); - pack(data.gasMu(), buffer, position, comm); - pack(data.inverseGasBMu(), buffer, position, comm); -} - -template -void pack(const GasPvtThermal& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.gasvisctCurves(), buffer, position, comm); - pack(data.gasdentRefTemp(), buffer, position, comm); - pack(data.gasdentCT1(), buffer, position, comm); - pack(data.gasdentCT2(), buffer, position, comm); - pack(data.internalEnergyCurves(), buffer, position, comm); - pack(data.enableThermalDensity(), buffer, position, comm); - pack(data.enableThermalViscosity(), buffer, position, comm); - pack(data.enableInternalEnergy(), buffer, position, comm); - pack(data.isoThermalPvt() != nullptr, buffer, position, comm); - if (data.isoThermalPvt()) - pack(*data.isoThermalPvt(), buffer, position, comm); -} - -template -void pack(const WetGasPvt& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.gasReferenceDensity(), buffer, position, comm); - pack(data.oilReferenceDensity(), buffer, position, comm); - pack(data.inverseGasB(), buffer, position, comm); - pack(data.inverseSaturatedGasB(), buffer, position, comm); - pack(data.gasMu(), buffer, position, comm); - pack(data.inverseGasBMu(), buffer, position, comm); - pack(data.inverseSaturatedGasBMu(), buffer, position, comm); - pack(data.saturatedOilVaporizationFactorTable(), buffer, position, comm); - pack(data.saturationPressure(), buffer, position, comm); - pack(data.vapPar1(), buffer, position, comm); -} - -template -void pack(const OilPvtMultiplexer& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.approach(), buffer, position, comm); - const void* realOilPvt = data.realOilPvt(); - using PvtApproach = OilPvtMultiplexer; - if (data.approach() == PvtApproach::ConstantCompressibilityOilPvt) { - const auto& pvt = *static_cast*>(realOilPvt); - pack(pvt, buffer, position, comm); - } else if (data.approach() == PvtApproach::DeadOilPvt) { - const auto& pvt = *static_cast*>(realOilPvt); - pack(pvt, buffer, position, comm); - } else if (data.approach() == PvtApproach::LiveOilPvt) { - const auto& pvt = *static_cast*>(realOilPvt); - pack(pvt, buffer, position, comm); - } else if (data.approach() == PvtApproach::ThermalOilPvt) { - const auto& pvt = *static_cast*>(realOilPvt); - pack(pvt, buffer, position, comm); - } -} - -template -void pack(const ConstantCompressibilityOilPvt& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.oilReferenceDensity(), buffer, position, comm); - pack(data.oilReferencePressure(), buffer, position, comm); - pack(data.oilReferenceFormationVolumeFactor(), buffer, position, comm); - pack(data.oilCompressibility(), buffer, position, comm); - pack(data.oilViscosity(), buffer, position, comm); - pack(data.oilViscosibility(), buffer, position, comm); -} - -template -void pack(const DeadOilPvt& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.oilReferenceDensity(), buffer, position, comm); - pack(data.inverseOilB(), buffer, position, comm); - pack(data.oilMu(), buffer, position, comm); - pack(data.inverseOilBMu(), buffer, position, comm); -} - -template -void pack(const LiveOilPvt& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.gasReferenceDensity(), buffer, position, comm); - pack(data.oilReferenceDensity(), buffer, position, comm); - pack(data.inverseOilBTable(), buffer, position, comm); - pack(data.oilMuTable(), buffer, position, comm); - pack(data.inverseOilBMuTable(), buffer, position, comm); - pack(data.saturatedOilMuTable(), buffer, position, comm); - pack(data.inverseSaturatedOilBTable(), buffer, position, comm); - pack(data.inverseSaturatedOilBMuTable(), buffer, position, comm); - pack(data.saturatedGasDissolutionFactorTable(), buffer, position, comm); - pack(data.saturationPressure(), buffer, position, comm); - pack(data.vapPar2(), buffer, position, comm); -} - -template -void pack(const OilPvtThermal& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.oilvisctCurves(), buffer, position, comm); - pack(data.viscrefPress(), buffer, position, comm); - pack(data.viscrefRs(), buffer, position, comm); - pack(data.viscRef(), buffer, position, comm); - pack(data.oildentRefTemp(), buffer, position, comm); - pack(data.oildentCT1(), buffer, position, comm); - pack(data.oildentCT2(), buffer, position, comm); - pack(data.internalEnergyCurves(), buffer, position, comm); - pack(data.enableThermalDensity(), buffer, position, comm); - pack(data.enableThermalViscosity(), buffer, position, comm); - pack(data.enableInternalEnergy(), buffer, position, comm); - pack(data.isoThermalPvt() != nullptr, buffer, position, comm); - if (data.isoThermalPvt()) - pack(*data.isoThermalPvt(), buffer, position, comm); -} - -template -void pack(const WaterPvtMultiplexer& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.approach(), buffer, position, comm); - const void* realWaterPvt = data.realWaterPvt(); - using PvtApproach = WaterPvtMultiplexer; - if (data.approach() == PvtApproach::ConstantCompressibilityWaterPvt) { - const auto& pvt = *static_cast*>(realWaterPvt); - pack(pvt, buffer, position, comm); - } else if (data.approach() == PvtApproach::ThermalWaterPvt) { - const auto& pvt = *static_cast*>(realWaterPvt); - pack(pvt, buffer, position, comm); - } else if (data.approach() == PvtApproach::ConstantCompressibilityBrinePvt) { - const auto& pvt = *static_cast*>(realWaterPvt); - pack(pvt, buffer, position, comm); - } -} - -template -void pack(const ConstantCompressibilityWaterPvt& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.waterReferenceDensity(), buffer, position, comm); - pack(data.waterReferencePressure(), buffer, position, comm); - pack(data.waterReferenceFormationVolumeFactor(), buffer, position, comm); - pack(data.waterCompressibility(), buffer, position, comm); - pack(data.waterViscosity(), buffer, position, comm); - pack(data.waterViscosibility(), buffer, position, comm); -} - -template -void pack(const ConstantCompressibilityBrinePvt& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.waterReferenceDensity(), buffer, position, comm); - pack(data.referencePressure(), buffer, position, comm); - pack(data.formationVolumeTables(), buffer, position, comm); - pack(data.compressibilityTables(), buffer, position, comm); - pack(data.viscosityTables(), buffer, position, comm); - pack(data.viscosibilityTables(), buffer, position, comm); -} - -template -void pack(const WaterPvtThermal& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.viscrefPress(), buffer, position, comm); - pack(data.watdentRefTemp(), buffer, position, comm); - pack(data.watdentCT1(), buffer, position, comm); - pack(data.watdentCT2(), buffer, position, comm); - pack(data.pvtwRefPress(), buffer, position, comm); - pack(data.pvtwRefB(), buffer, position, comm); - pack(data.pvtwCompressibility(), buffer, position, comm); - pack(data.pvtwViscosity(), buffer, position, comm); - pack(data.pvtwViscosibility(), buffer, position, comm); - pack(data.watvisctCurves(), buffer, position, comm); - pack(data.internalEnergyCurves(), buffer, position, comm); - pack(data.enableThermalDensity(), buffer, position, comm); - pack(data.enableThermalViscosity(), buffer, position, comm); - pack(data.enableInternalEnergy(), buffer, position, comm); - pack(data.isoThermalPvt() != nullptr, buffer, position, comm); - - using PvtApproach = WaterPvtThermal; - if (data.isoThermalPvt()) - pack(data.isoThermalPvt()->approach(), buffer, position, comm); - if (data.isoThermalPvt()->approach() != PvtApproach::IsothermalPvt::NoWaterPvt) { - pack(*data.isoThermalPvt(), buffer, position, comm); - } -} - void pack(const OilVaporizationProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -4986,389 +4515,6 @@ void unpack(UniformXTabulated2DFunction& data, std::vector& buffer interpolationGuide); } -template -void unpack(SolventPvt& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector solventReferenceDensity; - std::vector::TabulatedOneDFunction> inverseSolventB; - std::vector::TabulatedOneDFunction> solventMu; - std::vector::TabulatedOneDFunction> inverseSolventBMu; - unpack(solventReferenceDensity, buffer, position, comm); - unpack(inverseSolventB, buffer, position, comm); - unpack(solventMu, buffer, position, comm); - unpack(inverseSolventBMu, buffer, position, comm); - data = SolventPvt(solventReferenceDensity, inverseSolventB, - solventMu, inverseSolventBMu); -} - -template -void unpack(GasPvtMultiplexer& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - typename GasPvtMultiplexer::GasPvtApproach approach; - unpack(approach, buffer, position, comm); - using PvtApproach = GasPvtMultiplexer; - void* pvt = nullptr; - if (approach == PvtApproach::DryGasPvt) { - DryGasPvt* realPvt = new DryGasPvt; - unpack(*realPvt, buffer, position, comm); - pvt = realPvt; - } else if (approach == PvtApproach::WetGasPvt) { - WetGasPvt* realPvt = new WetGasPvt; - unpack(*realPvt, buffer, position, comm); - pvt = realPvt; - } else if (approach == PvtApproach::ThermalGasPvt) { - GasPvtThermal* realPvt = new GasPvtThermal; - unpack(*realPvt, buffer, position, comm); - pvt = realPvt; - } - data = GasPvtMultiplexer(approach, pvt); -} - -template -void unpack(DryGasPvt& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector gasReferenceDensity; - std::vector::TabulatedOneDFunction> inverseGasB; - std::vector::TabulatedOneDFunction> gasMu; - std::vector::TabulatedOneDFunction> inverseGasBMu; - unpack(gasReferenceDensity, buffer, position, comm); - unpack(inverseGasB, buffer, position, comm); - unpack(gasMu, buffer, position, comm); - unpack(inverseGasBMu, buffer, position, comm); - data = DryGasPvt(gasReferenceDensity, inverseGasB, - gasMu, inverseGasBMu); -} - -template -void unpack(GasPvtThermal& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector::TabulatedOneDFunction> gasvisctCurves; - std::vector gasdentRefTemp, gasdentCT1, gasdentCT2; - std::vector::TabulatedOneDFunction> internalEnergyCurves; - bool enableThermalDensity, enableThermalViscosity, enableInternalEnergy; - unpack(gasvisctCurves, buffer, position, comm); - unpack(gasdentRefTemp, buffer, position, comm); - unpack(gasdentCT1, buffer, position, comm); - unpack(gasdentCT2, buffer, position, comm); - unpack(internalEnergyCurves, buffer, position, comm); - unpack(enableThermalDensity, buffer, position, comm); - unpack(enableThermalViscosity, buffer, position, comm); - unpack(enableInternalEnergy, buffer, position, comm); - bool isothermal; - unpack(isothermal, buffer, position, comm); - typename GasPvtThermal::IsothermalPvt* pvt = nullptr; - if (isothermal) { - pvt = new typename GasPvtThermal::IsothermalPvt; - unpack(*pvt, buffer, position, comm); - } - data = GasPvtThermal(pvt, gasvisctCurves, gasdentRefTemp, - gasdentCT1, gasdentCT2, - internalEnergyCurves, - enableThermalDensity, - enableThermalViscosity, - enableInternalEnergy); -} - -template -void unpack(WetGasPvt& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector gasReferenceDensity, oilReferenceDensity; - std::vector::TabulatedTwoDFunction> inverseGasB; - std::vector::TabulatedOneDFunction> inverseSaturatedGasB; - std::vector::TabulatedTwoDFunction> gasMu; - std::vector::TabulatedTwoDFunction> inverseGasBMu; - std::vector::TabulatedOneDFunction> inverseSaturatedGasBMu; - std::vector::TabulatedOneDFunction> satOilVapFacTable; - std::vector::TabulatedOneDFunction> saturationPressure; - Scalar vapPar1; - unpack(gasReferenceDensity, buffer, position, comm); - unpack(oilReferenceDensity, buffer, position, comm); - unpack(inverseGasB, buffer, position, comm); - unpack(inverseSaturatedGasB, buffer, position, comm); - unpack(gasMu, buffer, position, comm); - unpack(inverseGasBMu, buffer, position, comm); - unpack(inverseSaturatedGasBMu, buffer, position, comm); - unpack(satOilVapFacTable, buffer, position, comm); - unpack(saturationPressure, buffer, position, comm); - unpack(vapPar1, buffer, position, comm); - data = WetGasPvt(gasReferenceDensity, oilReferenceDensity, inverseGasB, - inverseSaturatedGasB, gasMu, inverseGasBMu, - inverseSaturatedGasBMu, satOilVapFacTable, - saturationPressure, vapPar1); -} - -template -void unpack(OilPvtMultiplexer& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - typename OilPvtMultiplexer::OilPvtApproach approach; - unpack(approach, buffer, position, comm); - using PvtApproach = OilPvtMultiplexer; - void* pvt = nullptr; - if (approach == PvtApproach::ConstantCompressibilityOilPvt) { - auto* realPvt = new ConstantCompressibilityOilPvt; - unpack(*realPvt, buffer, position, comm); - pvt = realPvt; - } else if (approach == PvtApproach::DeadOilPvt) { - auto* realPvt = new DeadOilPvt; - unpack(*realPvt, buffer, position, comm); - pvt = realPvt; - } else if (approach == PvtApproach::LiveOilPvt) { - auto* realPvt = new LiveOilPvt; - unpack(*realPvt, buffer, position, comm); - pvt = realPvt; - } else if (approach == PvtApproach::ThermalOilPvt) { - auto* realPvt = new OilPvtThermal; - unpack(*realPvt, buffer, position, comm); - pvt = realPvt; - } - data = OilPvtMultiplexer(approach, pvt); -} - -template -void unpack(ConstantCompressibilityOilPvt& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector oilReferenceDensity, oilReferencePressure, - oilReferenceFormationVolumeFactor, - oilCompressibility, oilViscosity, oilViscosibility; - - unpack(oilReferenceDensity, buffer, position, comm); - unpack(oilReferencePressure, buffer, position, comm); - unpack(oilReferenceFormationVolumeFactor, buffer, position, comm); - unpack(oilCompressibility, buffer, position, comm); - unpack(oilViscosity, buffer, position, comm); - unpack(oilViscosibility, buffer, position, comm); - data = ConstantCompressibilityOilPvt(oilReferenceDensity, - oilReferencePressure, - oilReferenceFormationVolumeFactor, - oilCompressibility, - oilViscosity, - oilViscosibility); -} - -template -void unpack(DeadOilPvt& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector oilReferenceDensity; - using FuncVec = std::vector::TabulatedOneDFunction>; - FuncVec inverseOilB, oilMu, inverseOilBMu; - - unpack(oilReferenceDensity, buffer, position, comm); - unpack(inverseOilB, buffer, position, comm); - unpack(oilMu, buffer, position, comm); - unpack(inverseOilBMu, buffer, position, comm); - data = DeadOilPvt(oilReferenceDensity, inverseOilB, - oilMu, inverseOilBMu); -} - -template -void unpack(LiveOilPvt& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector gasReferenceDensity, oilReferenceDensity; - using FuncVec = std::vector::TabulatedOneDFunction>; - using FuncVec2 = std::vector::TabulatedTwoDFunction>; - FuncVec2 inverseOilBTable, oilMuTable, inverseOilBMuTable; - FuncVec saturatedOilMuTable, inverseSaturatedOilBTable, - inverseSaturatedOilBMuTable, - saturatedGasDissolutionFactorTable, saturationPressure; - Scalar vapPar2; - - unpack(gasReferenceDensity, buffer, position, comm); - unpack(oilReferenceDensity, buffer, position, comm); - unpack(inverseOilBTable, buffer, position, comm); - unpack(oilMuTable, buffer, position, comm); - unpack(inverseOilBMuTable, buffer, position, comm); - unpack(saturatedOilMuTable, buffer, position, comm); - unpack(inverseSaturatedOilBTable, buffer, position, comm); - unpack(inverseSaturatedOilBMuTable, buffer, position, comm); - unpack(saturatedGasDissolutionFactorTable, buffer, position, comm); - unpack(saturationPressure, buffer, position, comm); - unpack(vapPar2, buffer, position, comm); - data = LiveOilPvt(gasReferenceDensity, - oilReferenceDensity, - inverseOilBTable, - oilMuTable, - inverseOilBMuTable, - saturatedOilMuTable, - inverseSaturatedOilBTable, - inverseSaturatedOilBMuTable, - saturatedGasDissolutionFactorTable, - saturationPressure, - vapPar2); -} - -template -void unpack(OilPvtThermal& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector::TabulatedOneDFunction> oilvisctCurves; - std::vector oildentRefTemp, oildentCT1, oildentCT2, viscrefPress, viscrefRs, viscRef; - std::vector::TabulatedOneDFunction> internalEnergyCurves; - bool enableThermalDensity, enableThermalViscosity, enableInternalEnergy; - unpack(oilvisctCurves, buffer, position, comm); - unpack(viscrefPress, buffer, position, comm); - unpack(viscrefRs, buffer, position, comm); - unpack(viscRef, buffer, position, comm); - unpack(oildentRefTemp, buffer, position, comm); - unpack(oildentCT1, buffer, position, comm); - unpack(oildentCT2, buffer, position, comm); - unpack(internalEnergyCurves, buffer, position, comm); - unpack(enableThermalDensity, buffer, position, comm); - unpack(enableThermalViscosity, buffer, position, comm); - unpack(enableInternalEnergy, buffer, position, comm); - bool isothermal; - unpack(isothermal, buffer, position, comm); - typename OilPvtThermal::IsothermalPvt* pvt = nullptr; - if (isothermal) { - pvt = new typename OilPvtThermal::IsothermalPvt; - unpack(*pvt, buffer, position, comm); - } - data = OilPvtThermal(pvt, oilvisctCurves, - viscrefPress, viscrefRs, viscRef, - oildentRefTemp, - oildentCT1, oildentCT2, - internalEnergyCurves, - enableThermalDensity, - enableThermalViscosity, - enableInternalEnergy); -} - -template -void unpack(WaterPvtMultiplexer& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - typename WaterPvtMultiplexer::WaterPvtApproach approach; - unpack(approach, buffer, position, comm); - using PvtApproach = WaterPvtMultiplexer; - void* pvt = nullptr; - if (approach == PvtApproach::ConstantCompressibilityWaterPvt) { - auto* realPvt = new ConstantCompressibilityWaterPvt; - unpack(*realPvt, buffer, position, comm); - pvt = realPvt; - } else if (approach == PvtApproach::ThermalWaterPvt) { - auto* realPvt = new WaterPvtThermal; - unpack(*realPvt, buffer, position, comm); - pvt = realPvt; - } else if (approach == PvtApproach::ConstantCompressibilityBrinePvt) { - auto* realPvt = new ConstantCompressibilityBrinePvt; - unpack(*realPvt, buffer, position, comm); - pvt = realPvt; - } - data = WaterPvtMultiplexer(approach, pvt); -} - -template -void unpack(ConstantCompressibilityWaterPvt& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector waterReferenceDensity, waterReferencePressure, - waterReferenceFormationVolumeFactor, - waterCompressibility, waterViscosity, waterViscosibility; - - unpack(waterReferenceDensity, buffer, position, comm); - unpack(waterReferencePressure, buffer, position, comm); - unpack(waterReferenceFormationVolumeFactor, buffer, position, comm); - unpack(waterCompressibility, buffer, position, comm); - unpack(waterViscosity, buffer, position, comm); - unpack(waterViscosibility, buffer, position, comm); - data = ConstantCompressibilityWaterPvt(waterReferenceDensity, - waterReferencePressure, - waterReferenceFormationVolumeFactor, - waterCompressibility, - waterViscosity, - waterViscosibility); -} - -template -void unpack(ConstantCompressibilityBrinePvt& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - using TabulatedFunction = typename ConstantCompressibilityBrinePvt::TabulatedFunction; - std::vector waterReferenceDensity, referencePressure; - std::vector formationVolumeTables, compressibilityTables, - viscosityTables, viscosibilityTables; - - unpack(waterReferenceDensity, buffer, position, comm); - unpack(referencePressure, buffer, position, comm); - unpack(formationVolumeTables, buffer, position, comm); - unpack(compressibilityTables, buffer, position, comm); - unpack(viscosityTables, buffer, position, comm); - unpack(viscosibilityTables, buffer, position, comm); - data = ConstantCompressibilityBrinePvt(waterReferenceDensity, - referencePressure, - formationVolumeTables, - compressibilityTables, - viscosityTables, - viscosibilityTables); -} - -template -void unpack(WaterPvtThermal& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector viscrefPress, watdentRefTemp, watdentCT1, watdentCT2, - pvtwRefPress, pvtwRefB, pvtwCompressibility, - pvtwViscosity, pvtwViscosibility; - std::vector::TabulatedOneDFunction> watvisctCurves; - std::vector::TabulatedOneDFunction> internalEnergyCurves; - bool enableThermalDensity, enableThermalViscosity, enableInternalEnergy; - unpack(viscrefPress, buffer, position, comm); - unpack(watdentRefTemp, buffer, position, comm); - unpack(watdentCT1, buffer, position, comm); - unpack(watdentCT2, buffer, position, comm); - unpack(pvtwRefPress, buffer, position, comm); - unpack(pvtwRefB, buffer, position, comm); - unpack(pvtwCompressibility, buffer, position, comm); - unpack(pvtwViscosity, buffer, position, comm); - unpack(pvtwViscosibility, buffer, position, comm); - unpack(watvisctCurves, buffer, position, comm); - unpack(internalEnergyCurves, buffer, position, comm); - unpack(enableThermalDensity, buffer, position, comm); - unpack(enableThermalViscosity, buffer, position, comm); - unpack(enableInternalEnergy, buffer, position, comm); - bool isothermal; - unpack(isothermal, buffer, position, comm); - typename WaterPvtThermal::IsothermalPvt* pvt = nullptr; - if (isothermal) { - pvt = new typename WaterPvtThermal::IsothermalPvt; - using PvtApproach = WaterPvtThermal; - typename PvtApproach::IsothermalPvt::WaterPvtApproach approach; - unpack(approach, buffer, position, comm); - if (approach != PvtApproach::IsothermalPvt::NoWaterPvt) - unpack(*pvt, buffer, position, comm); - } - data = WaterPvtThermal(pvt, viscrefPress, watdentRefTemp, - watdentCT1, watdentCT2, - pvtwRefPress, pvtwRefB, - pvtwCompressibility, - pvtwViscosity, - pvtwViscosibility, - watvisctCurves, - internalEnergyCurves, - enableThermalDensity, - enableThermalViscosity, - enableInternalEnergy); -} - void unpack(OilVaporizationProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -6807,9 +5953,6 @@ template void unpack(std::shared_ptr<__VA_ARGS__>& data, \ std::vector& buffer, int& position, \ Dune::MPIHelper::MPICommunicator comm); -INSTANTIATE_PACK_SHARED_PTR(Opm::GasPvtMultiplexer) -INSTANTIATE_PACK_SHARED_PTR(Opm::OilPvtMultiplexer) -INSTANTIATE_PACK_SHARED_PTR(Opm::WaterPvtMultiplexer) INSTANTIATE_PACK_SHARED_PTR(SpiralICD) #undef INSTANTIATE_PACK_SHARED_PTR @@ -6837,23 +5980,6 @@ INSTANTIATE_PACK(Tabulated1DFunction) INSTANTIATE_PACK(IntervalTabulated2DFunction) INSTANTIATE_PACK(UniformXTabulated2DFunction) INSTANTIATE_PACK(std::map>) -INSTANTIATE_PACK(SolventPvt) -INSTANTIATE_PACK(GasPvtMultiplexer) -INSTANTIATE_PACK(GasPvtMultiplexer) -INSTANTIATE_PACK(DryGasPvt) -INSTANTIATE_PACK(GasPvtThermal) -INSTANTIATE_PACK(WetGasPvt) -INSTANTIATE_PACK(OilPvtMultiplexer) -INSTANTIATE_PACK(OilPvtMultiplexer) -INSTANTIATE_PACK(ConstantCompressibilityOilPvt) -INSTANTIATE_PACK(DeadOilPvt) -INSTANTIATE_PACK(LiveOilPvt) -INSTANTIATE_PACK(OilPvtThermal) -INSTANTIATE_PACK(WaterPvtMultiplexer) -INSTANTIATE_PACK(WaterPvtMultiplexer) -INSTANTIATE_PACK(ConstantCompressibilityWaterPvt) -INSTANTIATE_PACK(WaterPvtThermal) -INSTANTIATE_PACK(ConstantCompressibilityBrinePvt) #undef INSTANTIATE_PACK } // end namespace Mpi diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 47f959276..6946ef2e1 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -26,17 +26,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include @@ -55,6 +44,9 @@ #include #include #include +#include +#include +#include #include #include @@ -86,7 +78,6 @@ class Connection; class DeckItem; class DeckRecord; class DENSITYRecord; -class DenT; class DensityTable; class Dimension; class EclHysterConfig; @@ -130,7 +121,6 @@ class Regdims; class RestartConfig; class RestartSchedule; class RFTConfig; -class RockConfig; class ROCKRecord; class RockTable; class Rock2dTable; @@ -266,56 +256,6 @@ std::size_t packSize(const IntervalTabulated2DFunction& data, Dune::MPIH template std::size_t packSize(const UniformXTabulated2DFunction& data, Dune::MPIHelper::MPICommunicator comm); -template -std::size_t packSize(const SolventPvt& data, Dune::MPIHelper::MPICommunicator comm); - -template -std::size_t packSize(const GasPvtMultiplexer& data, - Dune::MPIHelper::MPICommunicator comm); - -template -std::size_t packSize(const DryGasPvt& data, Dune::MPIHelper::MPICommunicator comm); - -template -std::size_t packSize(const GasPvtThermal& data, Dune::MPIHelper::MPICommunicator comm); - -template -std::size_t packSize(const WetGasPvt& data, Dune::MPIHelper::MPICommunicator comm); - -template -std::size_t packSize(const OilPvtMultiplexer& data, - Dune::MPIHelper::MPICommunicator comm); - -template -std::size_t packSize(const ConstantCompressibilityOilPvt& data, - Dune::MPIHelper::MPICommunicator comm); - -template -std::size_t packSize(const DeadOilPvt& data, - Dune::MPIHelper::MPICommunicator comm); - -template -std::size_t packSize(const LiveOilPvt& data, - Dune::MPIHelper::MPICommunicator comm); - -template -std::size_t packSize(const OilPvtThermal& data, Dune::MPIHelper::MPICommunicator comm); - -template -std::size_t packSize(const WaterPvtMultiplexer& data, - Dune::MPIHelper::MPICommunicator comm); - -template -std::size_t packSize(const ConstantCompressibilityWaterPvt& data, - Dune::MPIHelper::MPICommunicator comm); - -template -std::size_t packSize(const ConstantCompressibilityBrinePvt& data, - Dune::MPIHelper::MPICommunicator comm); - -template -std::size_t packSize(const WaterPvtThermal& data, Dune::MPIHelper::MPICommunicator comm); - template std::size_t packSize(const IOrderSet& data, Dune::MPIHelper::MPICommunicator comm); @@ -420,70 +360,6 @@ template void pack(const UniformXTabulated2DFunction& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); -template -void pack(const SolventPvt& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void pack(const GasPvtMultiplexer& data, - const std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - -template -void pack(const DryGasPvt& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void pack(const GasPvtThermal& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void pack(const WetGasPvt& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void pack(const OilPvtMultiplexer& data, - const std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - -template -void pack(const ConstantCompressibilityOilPvt& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - -template -void pack(const DeadOilPvt& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - -template -void pack(const LiveOilPvt& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - -template -void pack(const OilPvtThermal& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void pack(const WaterPvtMultiplexer& data, - const std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - -template -void pack(const ConstantCompressibilityWaterPvt& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - -template -void pack(const ConstantCompressibilityBrinePvt& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - -template -void pack(const WaterPvtThermal& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - template void pack(const IOrderSet& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); @@ -592,65 +468,6 @@ template void unpack(UniformXTabulated2DFunction& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); -template -void unpack(SolventPvt& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void unpack(GasPvtMultiplexer& data, - const std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - -template -void unpack(DryGasPvt& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void unpack(GasPvtThermal& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void unpack(WetGasPvt& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void unpack(OilPvtMultiplexer& data, - const std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - -template -void unpack(ConstantCompressibilityOilPvt& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void unpack(DeadOilPvt& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void unpack(LiveOilPvt& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void unpack(OilPvtThermal& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void unpack(WaterPvtMultiplexer& data, - const std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - -template -void unpack(WaterPvtThermal& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void unpack(ConstantCompressibilityWaterPvt& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void unpack(ConstantCompressibilityBrinePvt& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - template void unpack(IOrderSet& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 281d47f4c..0dc20c537 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -26,9 +26,6 @@ #include #include -#include -#include -#include #include #include #include @@ -1271,163 +1268,6 @@ BOOST_AUTO_TEST_CASE(UniformXTabulatedTwoDFunction) } -BOOST_AUTO_TEST_CASE(SolventPvt) -{ -#ifdef HAVE_MPI - Opm::Tabulated1DFunction func(2, std::vector{1.0, 2.0}, - std::vector{3.0, 4.0}); - Opm::SolventPvt val1({1.0, 2.0}, {func}, {func}, {func}); - auto val2 = PackUnpack(val1); - DO_CHECKS(SolventPvt) -#endif -} - - -BOOST_AUTO_TEST_CASE(DryGasPvt) -{ -#ifdef HAVE_MPI - Opm::Tabulated1DFunction func(2, std::vector{1.0, 2.0}, - std::vector{3.0, 4.0}); - Opm::DryGasPvt val1({1.0, 2.0}, {func}, {func}, {func}); - auto val2 = PackUnpack(val1); - DO_CHECKS(DryGasPvt) -#endif -} - - -BOOST_AUTO_TEST_CASE(GasPvtThermal) -{ -#ifdef HAVE_MPI - Opm::Tabulated1DFunction func(2, std::vector{1.0, 2.0}, - std::vector{3.0, 4.0}); - Opm::GasPvtThermal::IsothermalPvt* pvt = new Opm::GasPvtThermal::IsothermalPvt; - Opm::GasPvtThermal val1(pvt, {func}, {1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}, - {func}, true, true, false); - auto val2 = PackUnpack(val1); - DO_CHECKS(GasPvtThermal) -#endif -} - - -BOOST_AUTO_TEST_CASE(WetGasPvt) -{ -#ifdef HAVE_MPI - Opm::Tabulated1DFunction func(2, std::vector{1.0, 2.0}, - std::vector{3.0, 4.0}); - std::vector xPos{1.0, 2.0}; - std::vector yPos{3.0, 4.0}; - using FFuncType = Opm::UniformXTabulated2DFunction; - using Samples = std::vector>; - Samples samples({{std::make_tuple(1.0, 2.0, 3.0), std::make_tuple(3.0, 4.0, 5.0)}}); - FFuncType func2(xPos, yPos, samples, FFuncType::Vertical); - Opm::WetGasPvt val1({1.0, 2.0}, {3.0, 4.0}, - {func2}, {func}, {func2}, - {func2}, {func}, {func}, {func}, 5.0); - auto val2 = PackUnpack(val1); - DO_CHECKS(WetGasPvt) -#endif -} - - -BOOST_AUTO_TEST_CASE(ConstantCompressibilityOilPvt) -{ -#ifdef HAVE_MPI - Opm::ConstantCompressibilityOilPvt val1({1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}, - {7.0, 8.0}, {9.0, 10.0}, {11.0, 12.0}); - auto val2 = PackUnpack(val1); - DO_CHECKS(ConstantCompressibilityOilPvt) -#endif -} - - -BOOST_AUTO_TEST_CASE(DeadOilPvt) -{ -#ifdef HAVE_MPI - Opm::Tabulated1DFunction func(2, std::vector{1.0, 2.0}, - std::vector{3.0, 4.0}); - Opm::DeadOilPvt val1({1.0, 2.0}, {func}, {func}, {func}); - auto val2 = PackUnpack(val1); - DO_CHECKS(DeadOilPvt) -#endif -} - - -BOOST_AUTO_TEST_CASE(LiveOilPvt) -{ -#ifdef HAVE_MPI - Opm::Tabulated1DFunction func(2, std::vector{1.0, 2.0}, - std::vector{3.0, 4.0}); - std::vector xPos{1.0, 2.0}; - std::vector yPos{3.0, 4.0}; - using FFuncType = Opm::UniformXTabulated2DFunction; - using Samples = std::vector>; - Samples samples({{std::make_tuple(1.0, 2.0, 3.0), std::make_tuple(3.0, 4.0, 5.0)}}); - FFuncType func2(xPos, yPos, samples, FFuncType::Vertical); - Opm::LiveOilPvt val1({1.0, 2.0}, {3.0, 4.0}, - {func2}, {func2}, {func2}, - {func}, {func}, {func}, {func}, {func}, 5.0); - auto val2 = PackUnpack(val1); - DO_CHECKS(LiveOilPvt) -#endif -} - - -BOOST_AUTO_TEST_CASE(OilPvtThermal) -{ -#ifdef HAVE_MPI - Opm::Tabulated1DFunction func(2, std::vector{1.0, 2.0}, - std::vector{3.0, 4.0}); - Opm::OilPvtThermal::IsothermalPvt* pvt = new Opm::OilPvtThermal::IsothermalPvt; - Opm::OilPvtThermal val1(pvt, {func}, {1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}, - {7.0, 8.0}, {9.0, 10.0}, {11.0, 12.0}, - {func}, true, true, false); - auto val2 = PackUnpack(val1); - DO_CHECKS(OilPvtThermal) -#endif -} - - -BOOST_AUTO_TEST_CASE(ConstantCompressibilityWaterPvt) -{ -#ifdef HAVE_MPI - Opm::ConstantCompressibilityWaterPvt val1({1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}, - {7.0, 8.0}, {9.0, 10.0}, {11.0, 12.0}); - auto val2 = PackUnpack(val1); - DO_CHECKS(ConstantCompressibilityWaterPvt) -#endif -} - - -BOOST_AUTO_TEST_CASE(ConstantCompressibilityBrinePvt) -{ -#ifdef HAVE_MPI - Opm::Tabulated1DFunction func(2, std::vector{1.0, 2.0}, - std::vector{3.0, 4.0}); - Opm::ConstantCompressibilityBrinePvt val1({1.0, 2.0}, {3.0, 4.0}, {func}, - {func}, {func}, {func}); - auto val2 = PackUnpack(val1); - BOOST_CHECK(std::get<1>(val2) == std::get<2>(val2)); - BOOST_CHECK(val1 == std::get<0>(val2)); -#endif -} - - -BOOST_AUTO_TEST_CASE(WaterPvtThermal) -{ -#ifdef HAVE_MPI - Opm::Tabulated1DFunction func(2, std::vector{1.0, 2.0}, - std::vector{3.0, 4.0}); - Opm::WaterPvtThermal::IsothermalPvt* pvt = new Opm::WaterPvtThermal::IsothermalPvt; - Opm::WaterPvtThermal val1(pvt, {1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}, - {7.0, 8.0}, {9.0, 10.0}, {11.0, 12.0}, - {13.0, 14.0}, {15.0, 16.0}, {17.0, 18.0}, - {func}, {func}, true, true, false); - auto val2 = PackUnpack(val1); - DO_CHECKS(WaterPvtThermal) -#endif -} - - BOOST_AUTO_TEST_CASE(OilVaporizationProperties) { #ifdef HAVE_MPI