From fda49df8a8ee382fc0875ab36bf7afe01c8c2fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Fri, 29 Aug 2014 12:13:38 +0200 Subject: [PATCH] createWellsFromSpecs: Use ref-to-const cart2active This commit tightens the function header of method WellsManager::createWellsFromSpecs() to accept a reference-to-const 'cartesian_to_compressed' map. It used to be a complete, copy-constructed object, so this is a slight performance enhancement as we no longer need to copy a (somewhat) large object on every call to the method. --- opm/core/wells/WellsManager.hpp | 2 +- opm/core/wells/WellsManager_impl.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opm/core/wells/WellsManager.hpp b/opm/core/wells/WellsManager.hpp index 8e7220ff..6b2db1dc 100644 --- a/opm/core/wells/WellsManager.hpp +++ b/opm/core/wells/WellsManager.hpp @@ -166,7 +166,7 @@ namespace Opm std::vector& well_data, std::map & well_names_to_index, const PhaseUsage& phaseUsage, - const std::map cartesian_to_compressed, + const std::map& cartesian_to_compressed, const double* permeability); void addChildGroups(GroupTreeNodeConstPtr parentNode, ScheduleConstPtr schedule, size_t timeStep, const PhaseUsage& phaseUsage); diff --git a/opm/core/wells/WellsManager_impl.hpp b/opm/core/wells/WellsManager_impl.hpp index 3c315034..6ac55b96 100644 --- a/opm/core/wells/WellsManager_impl.hpp +++ b/opm/core/wells/WellsManager_impl.hpp @@ -109,7 +109,7 @@ void WellsManager::createWellsFromSpecs(std::vector& wells, size_t std::vector& well_data, std::map& well_names_to_index, const PhaseUsage& phaseUsage, - std::map cartesian_to_compressed, + const std::map& cartesian_to_compressed, const double* permeability) { std::vector > wellperf_data;