From 7006799b7fdf2a167914a920147a6fd10e807122 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 11 Mar 2025 08:58:21 +0100 Subject: [PATCH] fixed: capture as optional unconditional deref while creating (unused) extractor will trigger asserts in debug iterator builds --- opm/simulators/flow/OutputBlackoilModule.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opm/simulators/flow/OutputBlackoilModule.hpp b/opm/simulators/flow/OutputBlackoilModule.hpp index 74389b87a3..1e2b3106f9 100644 --- a/opm/simulators/flow/OutputBlackoilModule.hpp +++ b/opm/simulators/flow/OutputBlackoilModule.hpp @@ -1861,7 +1861,7 @@ private: Entry{PhaseEntry{std::array{"BPPW"sv, "BPPO"sv, "BPPG"sv}, [&simConfig = this->eclState_.getSimulationConfig(), &grav = this->simulator_.problem().gravity(), - ®ionAvgDensity = *this->regionAvgDensity_, + ®ionAvgDensity = this->regionAvgDensity_, &problem = this->simulator_.problem(), ®ions = this->regions_](const unsigned phaseIdx, const Context& ectx) { @@ -1882,7 +1882,7 @@ private: ectx.elemCtx.primaryVars(ectx.dofIdx, /*timeIdx=*/0).pvtRegionIndex() + 1 }; - const auto density = regionAvgDensity.value("PVTNUM", phase, region); + const auto density = regionAvgDensity->value("PVTNUM", phase, region); const auto press = getValue(ectx.fs.pressure(phase.ix)); const auto dz = problem.dofCenterDepth(ectx.globalDofIdx) - datum;