From 964610fc497e888c07e0009019442f41bf5ab934 Mon Sep 17 00:00:00 2001 From: Tobias Meyer Andersen Date: Thu, 11 Dec 2025 09:42:00 +0100 Subject: [PATCH] add fsys ptr getter --- opm/material/fluidstates/BlackOilFluidState.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/opm/material/fluidstates/BlackOilFluidState.hpp b/opm/material/fluidstates/BlackOilFluidState.hpp index 71fe7587ff2..088e5fa0351 100644 --- a/opm/material/fluidstates/BlackOilFluidState.hpp +++ b/opm/material/fluidstates/BlackOilFluidState.hpp @@ -706,6 +706,17 @@ class BlackOilFluidState } } + /// \brief Return a pointer to the fluid system used by this fluid state. + OPM_HOST_DEVICE FluidSystem const* fluidSystemPtr() const + { + if constexpr (fluidSystemIsStatic) { + static FluidSystem instance; + return &instance; + } else { + return fluidSystemPtr_; + } + } + private: OPM_HOST_DEVICE static unsigned storageToCanonicalPhaseIndex_(unsigned storagePhaseIdx, const FluidSystem& fluidSystem) {