diff --git a/opm/autodiff/BlackoilModelBase_impl.hpp b/opm/autodiff/BlackoilModelBase_impl.hpp index ba47927dc..af3d85f3c 100644 --- a/opm/autodiff/BlackoilModelBase_impl.hpp +++ b/opm/autodiff/BlackoilModelBase_impl.hpp @@ -2445,7 +2445,7 @@ namespace detail { const int nm = asImpl().numMaterials(); assert(int(rq_.size()) == nm); - const V pv = geo_.poreVolume(); + const V& pv = geo_.poreVolume(); std::vector R_sum(nm); std::vector B_avg(nm); @@ -2564,7 +2564,7 @@ namespace detail { const int np = asImpl().numPhases(); const int nm = asImpl().numMaterials(); - const V pv = geo_.poreVolume(); + const V& pv = geo_.poreVolume(); std::vector R_sum(nm); std::vector B_avg(nm); std::vector maxCoeff(nm);