From 1916c8d35aaafe3d3bcf5de994c87b5289471e3b Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Thu, 29 Oct 2015 15:50:22 +0100 Subject: [PATCH] Prevent copying the porevolume when checking for convergence. As it is just used to compute the tempV value there is no need to copy it to a new vector. With commit we use a reference to geo.poreVolume() instead to prevent the copy. --- opm/autodiff/BlackoilModelBase_impl.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);