From f367e4fb7b43e1e17ce9f9f78cf2588249ba53ac Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Mon, 31 Oct 2022 10:35:52 +0100 Subject: [PATCH] changed: use return value no reason to pass a reference here, just use return --- opm/simulators/wells/BlackoilWellModel_impl.hpp | 4 +--- opm/simulators/wells/StandardWellGeneric.cpp | 6 +++--- opm/simulators/wells/StandardWellGeneric.hpp | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 1e9e249e4..ff0fdfaac 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -1202,9 +1202,7 @@ namespace Opm { auto& well = well_container_[i]; std::shared_ptr > derived = std::dynamic_pointer_cast >(well); if (derived) { - unsigned int numBlocks; - derived->getNumBlocks(numBlocks); - wellContribs.addNumBlocks(numBlocks); + wellContribs.addNumBlocks(derived->getNumBlocks()); } } diff --git a/opm/simulators/wells/StandardWellGeneric.cpp b/opm/simulators/wells/StandardWellGeneric.cpp index 4afc0eb85..7159a6438 100644 --- a/opm/simulators/wells/StandardWellGeneric.cpp +++ b/opm/simulators/wells/StandardWellGeneric.cpp @@ -392,11 +392,11 @@ computeBhpAtThpLimitInj(const std::function(const double)>& } template -void +unsigned int StandardWellGeneric:: -getNumBlocks(unsigned int& numBlocks) const +getNumBlocks() const { - numBlocks = duneB_.nonzeroes(); + return duneB_.nonzeroes(); } template class StandardWellGeneric; diff --git a/opm/simulators/wells/StandardWellGeneric.hpp b/opm/simulators/wells/StandardWellGeneric.hpp index 5b4ea3098..e55c988c6 100644 --- a/opm/simulators/wells/StandardWellGeneric.hpp +++ b/opm/simulators/wells/StandardWellGeneric.hpp @@ -66,7 +66,7 @@ protected: public: /// get the number of blocks of the C and B matrices, used to allocate memory in a WellContributions object - void getNumBlocks(unsigned int& _nnzs) const; + unsigned int getNumBlocks() const; protected: StandardWellGeneric(const WellInterfaceGeneric& baseif);