From 7241acabacba20194dcad74bbc52a0471d6d38d9 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 5 May 2021 21:22:04 +0200 Subject: [PATCH] changed: make enums enum class and put them outside class defintion to avoid template parameter dependence. --- .../blackoilpvt/GasPvtMultiplexer.hpp | 131 +++++++------- .../blackoilpvt/OilPvtMultiplexer.hpp | 164 +++++++++--------- .../blackoilpvt/WaterPvtMultiplexer.hpp | 91 +++++----- 3 files changed, 193 insertions(+), 193 deletions(-) diff --git a/opm/material/fluidsystems/blackoilpvt/GasPvtMultiplexer.hpp b/opm/material/fluidsystems/blackoilpvt/GasPvtMultiplexer.hpp index e196947a4..6ab33d96c 100644 --- a/opm/material/fluidsystems/blackoilpvt/GasPvtMultiplexer.hpp +++ b/opm/material/fluidsystems/blackoilpvt/GasPvtMultiplexer.hpp @@ -37,32 +37,39 @@ #endif namespace Opm { -#define OPM_GAS_PVT_MULTIPLEXER_CALL(codeToCall) \ - switch (gasPvtApproach_) { \ - case DryGasPvt: { \ - auto& pvtImpl = getRealPvt(); \ - codeToCall; \ - break; \ - } \ - case WetGasPvt: { \ - auto& pvtImpl = getRealPvt(); \ - codeToCall; \ - break; \ - } \ - case ThermalGasPvt: { \ - auto& pvtImpl = getRealPvt(); \ - codeToCall; \ - break; \ - } \ - case Co2GasPvt: { \ - auto& pvtImpl = getRealPvt(); \ - codeToCall; \ - break; \ - } \ - case NoGasPvt: \ +#define OPM_GAS_PVT_MULTIPLEXER_CALL(codeToCall) \ + switch (gasPvtApproach_) { \ + case GasPvtApproach::DryGasPvt: { \ + auto& pvtImpl = getRealPvt(); \ + codeToCall; \ + break; \ + } \ + case GasPvtApproach::WetGasPvt: { \ + auto& pvtImpl = getRealPvt(); \ + codeToCall; \ + break; \ + } \ + case GasPvtApproach::ThermalGasPvt: { \ + auto& pvtImpl = getRealPvt(); \ + codeToCall; \ + break; \ + } \ + case GasPvtApproach::Co2GasPvt: { \ + auto& pvtImpl = getRealPvt(); \ + codeToCall; \ + break; \ + } \ + case GasPvtApproach::NoGasPvt: \ throw std::logic_error("Not implemented: Gas PVT of this deck!"); \ } \ +enum class GasPvtApproach { + NoGasPvt, + DryGasPvt, + WetGasPvt, + ThermalGasPvt, + Co2GasPvt +}; /*! * \brief This class represents the Pressure-Volume-Temperature relations of the gas @@ -80,17 +87,9 @@ class GasPvtMultiplexer public: typedef Opm::GasPvtThermal GasPvtThermal; - enum GasPvtApproach { - NoGasPvt, - DryGasPvt, - WetGasPvt, - ThermalGasPvt, - Co2GasPvt - }; - GasPvtMultiplexer() { - gasPvtApproach_ = NoGasPvt; + gasPvtApproach_ = GasPvtApproach::NoGasPvt; realGasPvt_ = nullptr; } @@ -107,23 +106,23 @@ public: ~GasPvtMultiplexer() { switch (gasPvtApproach_) { - case DryGasPvt: { - delete &getRealPvt(); + case GasPvtApproach::DryGasPvt: { + delete &getRealPvt(); break; } - case WetGasPvt: { - delete &getRealPvt(); + case GasPvtApproach::WetGasPvt: { + delete &getRealPvt(); break; } - case ThermalGasPvt: { - delete &getRealPvt(); + case GasPvtApproach::ThermalGasPvt: { + delete &getRealPvt(); break; } - case Co2GasPvt: { - delete &getRealPvt(); + case GasPvtApproach::Co2GasPvt: { + delete &getRealPvt(); break; } - case NoGasPvt: + case GasPvtApproach::NoGasPvt: break; } } @@ -139,13 +138,13 @@ public: if (!eclState.runspec().phases().active(Phase::GAS)) return; if (eclState.runspec().co2Storage()) - setApproach(Co2GasPvt); + setApproach(GasPvtApproach::Co2GasPvt); else if (enableThermal && eclState.getSimulationConfig().isThermal()) - setApproach(ThermalGasPvt); + setApproach(GasPvtApproach::ThermalGasPvt); else if (!eclState.getTableManager().getPvtgTables().empty()) - setApproach(WetGasPvt); + setApproach(GasPvtApproach::WetGasPvt); else if (eclState.getTableManager().hasTables("PVDG")) - setApproach(DryGasPvt); + setApproach(GasPvtApproach::DryGasPvt); OPM_GAS_PVT_MULTIPLEXER_CALL(pvtImpl.initFromState(eclState, schedule)); } @@ -154,23 +153,23 @@ public: void setApproach(GasPvtApproach gasPvtAppr) { switch (gasPvtAppr) { - case DryGasPvt: + case GasPvtApproach::DryGasPvt: realGasPvt_ = new Opm::DryGasPvt; break; - case WetGasPvt: + case GasPvtApproach::WetGasPvt: realGasPvt_ = new Opm::WetGasPvt; break; - case ThermalGasPvt: + case GasPvtApproach::ThermalGasPvt: realGasPvt_ = new Opm::GasPvtThermal; break; - case Co2GasPvt: + case GasPvtApproach::Co2GasPvt: realGasPvt_ = new Opm::Co2GasPvt; break; - case NoGasPvt: + case GasPvtApproach::NoGasPvt: throw std::logic_error("Not implemented: Gas PVT of this deck!"); } @@ -293,14 +292,14 @@ public: // get the parameter object for the dry gas case template - typename std::enable_if >::type& getRealPvt() + typename std::enable_if >::type& getRealPvt() { assert(gasPvtApproach() == approachV); return *static_cast* >(realGasPvt_); } template - typename std::enable_if >::type& getRealPvt() const + typename std::enable_if >::type& getRealPvt() const { assert(gasPvtApproach() == approachV); return *static_cast* >(realGasPvt_); @@ -308,14 +307,14 @@ public: // get the parameter object for the wet gas case template - typename std::enable_if >::type& getRealPvt() + typename std::enable_if >::type& getRealPvt() { assert(gasPvtApproach() == approachV); return *static_cast* >(realGasPvt_); } template - typename std::enable_if >::type& getRealPvt() const + typename std::enable_if >::type& getRealPvt() const { assert(gasPvtApproach() == approachV); return *static_cast* >(realGasPvt_); @@ -323,28 +322,28 @@ public: // get the parameter object for the thermal gas case template - typename std::enable_if >::type& getRealPvt() + typename std::enable_if >::type& getRealPvt() { assert(gasPvtApproach() == approachV); return *static_cast* >(realGasPvt_); } template - typename std::enable_if >::type& getRealPvt() const + typename std::enable_if >::type& getRealPvt() const { assert(gasPvtApproach() == approachV); return *static_cast* >(realGasPvt_); } template - typename std::enable_if >::type& getRealPvt() + typename std::enable_if >::type& getRealPvt() { assert(gasPvtApproach() == approachV); return *static_cast* >(realGasPvt_); } template - typename std::enable_if >::type& getRealPvt() const + typename std::enable_if >::type& getRealPvt() const { assert(gasPvtApproach() == approachV); return *static_cast* >(realGasPvt_); @@ -358,16 +357,16 @@ public: return false; switch (gasPvtApproach_) { - case DryGasPvt: + case GasPvtApproach::DryGasPvt: return *static_cast*>(realGasPvt_) == *static_cast*>(data.realGasPvt_); - case WetGasPvt: + case GasPvtApproach::WetGasPvt: return *static_cast*>(realGasPvt_) == *static_cast*>(data.realGasPvt_); - case ThermalGasPvt: + case GasPvtApproach::ThermalGasPvt: return *static_cast*>(realGasPvt_) == *static_cast*>(data.realGasPvt_); - case Co2GasPvt: + case GasPvtApproach::Co2GasPvt: return *static_cast*>(realGasPvt_) == *static_cast*>(data.realGasPvt_); default: @@ -379,16 +378,16 @@ public: { gasPvtApproach_ = data.gasPvtApproach_; switch (gasPvtApproach_) { - case DryGasPvt: + case GasPvtApproach::DryGasPvt: realGasPvt_ = new Opm::DryGasPvt(*static_cast*>(data.realGasPvt_)); break; - case WetGasPvt: + case GasPvtApproach::WetGasPvt: realGasPvt_ = new Opm::WetGasPvt(*static_cast*>(data.realGasPvt_)); break; - case ThermalGasPvt: + case GasPvtApproach::ThermalGasPvt: realGasPvt_ = new Opm::GasPvtThermal(*static_cast*>(data.realGasPvt_)); break; - case Co2GasPvt: + case GasPvtApproach::Co2GasPvt: realGasPvt_ = new Opm::Co2GasPvt(*static_cast*>(data.realGasPvt_)); break; default: diff --git a/opm/material/fluidsystems/blackoilpvt/OilPvtMultiplexer.hpp b/opm/material/fluidsystems/blackoilpvt/OilPvtMultiplexer.hpp index 9c88fb909..aa889d36a 100644 --- a/opm/material/fluidsystems/blackoilpvt/OilPvtMultiplexer.hpp +++ b/opm/material/fluidsystems/blackoilpvt/OilPvtMultiplexer.hpp @@ -39,36 +39,45 @@ #endif namespace Opm { -#define OPM_OIL_PVT_MULTIPLEXER_CALL(codeToCall) \ - switch (approach_) { \ - case ConstantCompressibilityOilPvt: { \ - auto& pvtImpl = getRealPvt(); \ - codeToCall; \ - break; \ - } \ - case DeadOilPvt: { \ - auto& pvtImpl = getRealPvt(); \ - codeToCall; \ - break; \ - } \ - case LiveOilPvt: { \ - auto& pvtImpl = getRealPvt(); \ - codeToCall; \ - break; \ - } \ - case ThermalOilPvt: { \ - auto& pvtImpl = getRealPvt(); \ - codeToCall; \ - break; \ - } \ - case BrineCo2Pvt: { \ - auto& pvtImpl = getRealPvt(); \ - codeToCall; \ - break; \ - } \ - case NoOilPvt: \ - throw std::logic_error("Not implemented: Oil PVT of this deck!"); \ - } \ +#define OPM_OIL_PVT_MULTIPLEXER_CALL(codeToCall) \ + switch (approach_) { \ + case OilPvtApproach::ConstantCompressibilityOilPvt: { \ + auto& pvtImpl = getRealPvt(); \ + codeToCall; \ + break; \ + } \ + case OilPvtApproach::DeadOilPvt: { \ + auto& pvtImpl = getRealPvt(); \ + codeToCall; \ + break; \ + } \ + case OilPvtApproach::LiveOilPvt: { \ + auto& pvtImpl = getRealPvt(); \ + codeToCall; \ + break; \ + } \ + case OilPvtApproach::ThermalOilPvt: { \ + auto& pvtImpl = getRealPvt(); \ + codeToCall; \ + break; \ + } \ + case OilPvtApproach::BrineCo2Pvt: { \ + auto& pvtImpl = getRealPvt(); \ + codeToCall; \ + break; \ + } \ + case OilPvtApproach::NoOilPvt: \ + throw std::logic_error("Not implemented: Oil PVT of this deck!"); \ + } \ + +enum class OilPvtApproach { + NoOilPvt, + LiveOilPvt, + DeadOilPvt, + ConstantCompressibilityOilPvt, + ThermalOilPvt, + BrineCo2Pvt +}; /*! * \brief This class represents the Pressure-Volume-Temperature relations of the oil @@ -88,18 +97,9 @@ class OilPvtMultiplexer public: typedef Opm::OilPvtThermal OilPvtThermal; - enum OilPvtApproach { - NoOilPvt, - LiveOilPvt, - DeadOilPvt, - ConstantCompressibilityOilPvt, - ThermalOilPvt, - BrineCo2Pvt - }; - OilPvtMultiplexer() { - approach_ = NoOilPvt; + approach_ = OilPvtApproach::NoOilPvt; realOilPvt_ = nullptr; } @@ -116,28 +116,28 @@ public: ~OilPvtMultiplexer() { switch (approach_) { - case LiveOilPvt: { - delete &getRealPvt(); + case OilPvtApproach::LiveOilPvt: { + delete &getRealPvt(); break; } - case DeadOilPvt: { - delete &getRealPvt(); + case OilPvtApproach::DeadOilPvt: { + delete &getRealPvt(); break; } - case ConstantCompressibilityOilPvt: { - delete &getRealPvt(); + case OilPvtApproach::ConstantCompressibilityOilPvt: { + delete &getRealPvt(); break; } - case ThermalOilPvt: { - delete &getRealPvt(); + case OilPvtApproach::ThermalOilPvt: { + delete &getRealPvt(); break; } - case BrineCo2Pvt: { - delete &getRealPvt(); + case OilPvtApproach::BrineCo2Pvt: { + delete &getRealPvt(); break; } - case NoOilPvt: + case OilPvtApproach::NoOilPvt: break; } } @@ -155,15 +155,15 @@ public: // TODO move the BrineCo2 approach to the waterPvtMultiplexer // when a proper gas-water simulator is supported if (eclState.runspec().co2Storage()) - setApproach(BrineCo2Pvt); + setApproach(OilPvtApproach::BrineCo2Pvt); else if (enableThermal && eclState.getSimulationConfig().isThermal()) - setApproach(ThermalOilPvt); + setApproach(OilPvtApproach::ThermalOilPvt); else if (!eclState.getTableManager().getPvcdoTable().empty()) - setApproach(ConstantCompressibilityOilPvt); + setApproach(OilPvtApproach::ConstantCompressibilityOilPvt); else if (eclState.getTableManager().hasTables("PVDO")) - setApproach(DeadOilPvt); + setApproach(OilPvtApproach::DeadOilPvt); else if (!eclState.getTableManager().getPvtoTables().empty()) - setApproach(LiveOilPvt); + setApproach(OilPvtApproach::LiveOilPvt); OPM_OIL_PVT_MULTIPLEXER_CALL(pvtImpl.initFromState(eclState, schedule)); } @@ -280,27 +280,27 @@ public: void setApproach(OilPvtApproach appr) { switch (appr) { - case LiveOilPvt: + case OilPvtApproach::LiveOilPvt: realOilPvt_ = new Opm::LiveOilPvt; break; - case DeadOilPvt: + case OilPvtApproach::DeadOilPvt: realOilPvt_ = new Opm::DeadOilPvt; break; - case ConstantCompressibilityOilPvt: + case OilPvtApproach::ConstantCompressibilityOilPvt: realOilPvt_ = new Opm::ConstantCompressibilityOilPvt; break; - case ThermalOilPvt: + case OilPvtApproach::ThermalOilPvt: realOilPvt_ = new Opm::OilPvtThermal; break; - case BrineCo2Pvt: + case OilPvtApproach::BrineCo2Pvt: realOilPvt_ = new Opm::BrineCo2Pvt; break; - case NoOilPvt: + case OilPvtApproach::NoOilPvt: throw std::logic_error("Not implemented: Oil PVT of this deck!"); } @@ -317,70 +317,70 @@ public: // get the concrete parameter object for the oil phase template - typename std::enable_if >::type& getRealPvt() + typename std::enable_if >::type& getRealPvt() { assert(approach() == approachV); return *static_cast* >(realOilPvt_); } template - typename std::enable_if >::type& getRealPvt() const + typename std::enable_if >::type& getRealPvt() const { assert(approach() == approachV); return *static_cast* >(realOilPvt_); } template - typename std::enable_if >::type& getRealPvt() + typename std::enable_if >::type& getRealPvt() { assert(approach() == approachV); return *static_cast* >(realOilPvt_); } template - typename std::enable_if >::type& getRealPvt() const + typename std::enable_if >::type& getRealPvt() const { assert(approach() == approachV); return *static_cast* >(realOilPvt_); } template - typename std::enable_if >::type& getRealPvt() + typename std::enable_if >::type& getRealPvt() { assert(approach() == approachV); return *static_cast* >(realOilPvt_); } template - typename std::enable_if >::type& getRealPvt() const + typename std::enable_if >::type& getRealPvt() const { assert(approach() == approachV); return *static_cast* >(realOilPvt_); } template - typename std::enable_if >::type& getRealPvt() + typename std::enable_if >::type& getRealPvt() { assert(approach() == approachV); return *static_cast* >(realOilPvt_); } template - typename std::enable_if >::type& getRealPvt() const + typename std::enable_if >::type& getRealPvt() const { assert(approach() == approachV); return *static_cast* >(realOilPvt_); } template - typename std::enable_if >::type& getRealPvt() + typename std::enable_if >::type& getRealPvt() { assert(approach() == approachV); return *static_cast* >(realOilPvt_); } template - typename std::enable_if >::type& getRealPvt() const + typename std::enable_if >::type& getRealPvt() const { assert(approach() == approachV); return *static_cast* >(realOilPvt_); @@ -394,19 +394,19 @@ public: return false; switch (approach_) { - case ConstantCompressibilityOilPvt: + case OilPvtApproach::ConstantCompressibilityOilPvt: return *static_cast*>(realOilPvt_) == *static_cast*>(data.realOilPvt_); - case DeadOilPvt: + case OilPvtApproach::DeadOilPvt: return *static_cast*>(realOilPvt_) == *static_cast*>(data.realOilPvt_); - case LiveOilPvt: + case OilPvtApproach::LiveOilPvt: return *static_cast*>(realOilPvt_) == *static_cast*>(data.realOilPvt_); - case ThermalOilPvt: + case OilPvtApproach::ThermalOilPvt: return *static_cast*>(realOilPvt_) == *static_cast*>(data.realOilPvt_); - case BrineCo2Pvt: + case OilPvtApproach::BrineCo2Pvt: return *static_cast*>(realOilPvt_) == *static_cast*>(data.realOilPvt_); default: @@ -418,19 +418,19 @@ public: { approach_ = data.approach_; switch (approach_) { - case ConstantCompressibilityOilPvt: + case OilPvtApproach::ConstantCompressibilityOilPvt: realOilPvt_ = new Opm::ConstantCompressibilityOilPvt(*static_cast*>(data.realOilPvt_)); break; - case DeadOilPvt: + case OilPvtApproach::DeadOilPvt: realOilPvt_ = new Opm::DeadOilPvt(*static_cast*>(data.realOilPvt_)); break; - case LiveOilPvt: + case OilPvtApproach::LiveOilPvt: realOilPvt_ = new Opm::LiveOilPvt(*static_cast*>(data.realOilPvt_)); break; - case ThermalOilPvt: + case OilPvtApproach::ThermalOilPvt: realOilPvt_ = new Opm::OilPvtThermal(*static_cast*>(data.realOilPvt_)); break; - case BrineCo2Pvt: + case OilPvtApproach::BrineCo2Pvt: realOilPvt_ = new Opm::BrineCo2Pvt(*static_cast*>(data.realOilPvt_)); break; default: diff --git a/opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp b/opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp index addf68bb5..65e83f5bf 100644 --- a/opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp +++ b/opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp @@ -38,26 +38,34 @@ #define OPM_WATER_PVT_MULTIPLEXER_CALL(codeToCall) \ switch (approach_) { \ - case ConstantCompressibilityWaterPvt: { \ - auto& pvtImpl = getRealPvt(); \ + case WaterPvtApproach::ConstantCompressibilityWaterPvt: { \ + auto& pvtImpl = getRealPvt(); \ codeToCall; \ break; \ } \ - case ConstantCompressibilityBrinePvt: { \ - auto& pvtImpl = getRealPvt(); \ + case WaterPvtApproach::ConstantCompressibilityBrinePvt: { \ + auto& pvtImpl = getRealPvt(); \ codeToCall; \ break; \ } \ - case ThermalWaterPvt: { \ - auto& pvtImpl = getRealPvt(); \ + case WaterPvtApproach::ThermalWaterPvt: { \ + auto& pvtImpl = getRealPvt(); \ codeToCall; \ break; \ } \ - case NoWaterPvt: \ + case WaterPvtApproach::NoWaterPvt: \ throw std::logic_error("Not implemented: Water PVT of this deck!"); \ } namespace Opm { + +enum class WaterPvtApproach { + NoWaterPvt, + ConstantCompressibilityBrinePvt, + ConstantCompressibilityWaterPvt, + ThermalWaterPvt +}; + /*! * \brief This class represents the Pressure-Volume-Temperature relations of the water * phase in the black-oil model. @@ -68,16 +76,9 @@ class WaterPvtMultiplexer public: typedef Opm::WaterPvtThermal WaterPvtThermal; - enum WaterPvtApproach { - NoWaterPvt, - ConstantCompressibilityBrinePvt, - ConstantCompressibilityWaterPvt, - ThermalWaterPvt - }; - WaterPvtMultiplexer() { - approach_ = NoWaterPvt; + approach_ = WaterPvtApproach::NoWaterPvt; realWaterPvt_ = nullptr; } @@ -94,19 +95,19 @@ public: ~WaterPvtMultiplexer() { switch (approach_) { - case ConstantCompressibilityWaterPvt: { - delete &getRealPvt(); + case WaterPvtApproach::ConstantCompressibilityWaterPvt: { + delete &getRealPvt(); break; } - case ConstantCompressibilityBrinePvt: { - delete &getRealPvt(); + case WaterPvtApproach::ConstantCompressibilityBrinePvt: { + delete &getRealPvt(); break; } - case ThermalWaterPvt: { - delete &getRealPvt(); + case WaterPvtApproach::ThermalWaterPvt: { + delete &getRealPvt(); break; } - case NoWaterPvt: + case WaterPvtApproach::NoWaterPvt: break; } } @@ -123,11 +124,11 @@ public: return; if (enableThermal && eclState.getSimulationConfig().isThermal()) - setApproach(ThermalWaterPvt); + setApproach(WaterPvtApproach::ThermalWaterPvt); else if (!eclState.getTableManager().getPvtwTable().empty()) - setApproach(ConstantCompressibilityWaterPvt); + setApproach(WaterPvtApproach::ConstantCompressibilityWaterPvt); else if (enableBrine && !eclState.getTableManager().getPvtwSaltTables().empty()) - setApproach(ConstantCompressibilityBrinePvt); + setApproach(WaterPvtApproach::ConstantCompressibilityBrinePvt); OPM_WATER_PVT_MULTIPLEXER_CALL(pvtImpl.initFromState(eclState, schedule)); } @@ -185,19 +186,19 @@ public: void setApproach(WaterPvtApproach appr) { switch (appr) { - case ConstantCompressibilityWaterPvt: + case WaterPvtApproach::ConstantCompressibilityWaterPvt: realWaterPvt_ = new Opm::ConstantCompressibilityWaterPvt; break; - case ConstantCompressibilityBrinePvt: + case WaterPvtApproach::ConstantCompressibilityBrinePvt: realWaterPvt_ = new Opm::ConstantCompressibilityBrinePvt; break; - case ThermalWaterPvt: + case WaterPvtApproach::ThermalWaterPvt: realWaterPvt_ = new Opm::WaterPvtThermal; break; - case NoWaterPvt: + case WaterPvtApproach::NoWaterPvt: throw std::logic_error("Not implemented: Water PVT of this deck!"); } @@ -214,42 +215,42 @@ public: // get the concrete parameter object for the water phase template - typename std::enable_if >::type& getRealPvt() + typename std::enable_if >::type& getRealPvt() { assert(approach() == approachV); return *static_cast* >(realWaterPvt_); } template - typename std::enable_if >::type& getRealPvt() const + typename std::enable_if >::type& getRealPvt() const { assert(approach() == approachV); return *static_cast* >(realWaterPvt_); } template - typename std::enable_if >::type& getRealPvt() + typename std::enable_if >::type& getRealPvt() { - assert(approach() == approachV); - return *static_cast* >(realWaterPvt_); + assert(approach() == approachV); + return *static_cast* >(realWaterPvt_); } template - typename std::enable_if >::type& getRealPvt() const + typename std::enable_if >::type& getRealPvt() const { - assert(approach() == approachV); - return *static_cast* >(realWaterPvt_); + assert(approach() == approachV); + return *static_cast* >(realWaterPvt_); } template - typename std::enable_if >::type& getRealPvt() + typename std::enable_if >::type& getRealPvt() { assert(approach() == approachV); return *static_cast* >(realWaterPvt_); } template - typename std::enable_if >::type& getRealPvt() const + typename std::enable_if >::type& getRealPvt() const { assert(approach() == approachV); return *static_cast* >(realWaterPvt_); @@ -263,13 +264,13 @@ public: return false; switch (approach_) { - case ConstantCompressibilityWaterPvt: + case WaterPvtApproach::ConstantCompressibilityWaterPvt: return *static_cast*>(realWaterPvt_) == *static_cast*>(data.realWaterPvt_); - case ConstantCompressibilityBrinePvt: + case WaterPvtApproach::ConstantCompressibilityBrinePvt: return *static_cast*>(realWaterPvt_) == *static_cast*>(data.realWaterPvt_); - case ThermalWaterPvt: + case WaterPvtApproach::ThermalWaterPvt: return *static_cast*>(realWaterPvt_) == *static_cast*>(data.realWaterPvt_); default: @@ -281,13 +282,13 @@ public: { approach_ = data.approach_; switch (approach_) { - case ConstantCompressibilityWaterPvt: + case WaterPvtApproach::ConstantCompressibilityWaterPvt: realWaterPvt_ = new Opm::ConstantCompressibilityWaterPvt(*static_cast*>(data.realWaterPvt_)); break; - case ConstantCompressibilityBrinePvt: + case WaterPvtApproach::ConstantCompressibilityBrinePvt: realWaterPvt_ = new Opm::ConstantCompressibilityBrinePvt(*static_cast*>(data.realWaterPvt_)); break; - case ThermalWaterPvt: + case WaterPvtApproach::ThermalWaterPvt: realWaterPvt_ = new Opm::WaterPvtThermal(*static_cast*>(data.realWaterPvt_)); break; default: