From 96ec2b0e96f6d127b31e6675b94ddb6ccf441046 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 26 Oct 2022 10:59:43 +0200 Subject: [PATCH 1/2] comment out unused private variable (causes a warning) --- opm/simulators/flow/python/PyBlackOilSimulator.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/simulators/flow/python/PyBlackOilSimulator.hpp b/opm/simulators/flow/python/PyBlackOilSimulator.hpp index 0f36173f1..2d4959830 100644 --- a/opm/simulators/flow/python/PyBlackOilSimulator.hpp +++ b/opm/simulators/flow/python/PyBlackOilSimulator.hpp @@ -59,7 +59,7 @@ private: const std::string deckFilename_; bool hasRunInit_ = false; bool hasRunCleanup_ = false; - bool debug_ = false; + //bool debug_ = false; // This *must* be declared before other pointers // to simulator objects. This in order to deinitialize // MPI at the correct time (ie after the other objects). From b9ee7eae6f59d7719849c8a3bfa3f6ed012a86bd Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 26 Oct 2022 10:59:58 +0200 Subject: [PATCH 2/2] use if constexpr --- opm/simulators/wells/WellInterface_impl.hpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/opm/simulators/wells/WellInterface_impl.hpp b/opm/simulators/wells/WellInterface_impl.hpp index b553d4cfe..755a59467 100644 --- a/opm/simulators/wells/WellInterface_impl.hpp +++ b/opm/simulators/wells/WellInterface_impl.hpp @@ -1181,16 +1181,12 @@ namespace Opm typename WellInterface::Eval WellInterface::getPerfCellPressure(const typename WellInterface::FluidState& fs) const { - Eval pressure; - if (Indices::oilEnabled) { - pressure = fs.pressure(FluidSystem::oilPhaseIdx); + if constexpr (Indices::oilEnabled) { + return fs.pressure(FluidSystem::oilPhaseIdx); + } else if constexpr (Indices::waterEnabled) { + return fs.pressure(FluidSystem::waterPhaseIdx); } else { - if (Indices::waterEnabled) { - pressure = fs.pressure(FluidSystem::waterPhaseIdx); - } else { - pressure = fs.pressure(FluidSystem::gasPhaseIdx); - } + return fs.pressure(FluidSystem::gasPhaseIdx); } - return pressure; } } // namespace Opm