From 3e8381be203f74a678d34e6299a5f2e9f7e76712 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Wed, 28 Oct 2015 13:09:12 +0100 Subject: [PATCH] Renamed well_index to well_index_on_proc and added comment. This should prevent misunderstandings about what the well_index_on_proc is. It is not the well_index according to the eclipse state (on open wells count) but the index of the wells that are stored on this process' domain. --- opm/core/wells/WellsManager_impl.hpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/opm/core/wells/WellsManager_impl.hpp b/opm/core/wells/WellsManager_impl.hpp index 8d5e205be..a9e9b907f 100644 --- a/opm/core/wells/WellsManager_impl.hpp +++ b/opm/core/wells/WellsManager_impl.hpp @@ -128,7 +128,11 @@ void WellsManager::createWellsFromSpecs(std::vector& wells, size_t wellperf_data.resize(wells.size()); wells_on_proc.resize(wells.size(), 1); - int well_index = 0; + // The well index on the current process. + // Note that some wells are deactivated as they live on the interior + // domain of another proccess. Therefore this might different from + // the index of the well according to the eclipse state + int well_index_on_proc = 0; for (auto wellIter= wells.begin(); wellIter != wells.end(); ++wellIter) { WellConstPtr well = (*wellIter); @@ -198,7 +202,7 @@ void WellsManager::createWellsFromSpecs(std::vector& wells, size_t } pd.well_index *= wellPi; } - wellperf_data[well_index].push_back(pd); + wellperf_data[well_index_on_proc].push_back(pd); } } else { ++shut_completions_number; @@ -231,14 +235,14 @@ void WellsManager::createWellsFromSpecs(std::vector& wells, size_t << "process. Therefore we deactivate it here." << std::endl; // Mark well as not existent on this process wells_on_proc[wellIter-wells.begin()] = 0; - wellperf_data[well_index].clear(); + wellperf_data[well_index_on_proc].clear(); continue; } } } } { // WELSPECS handling - well_names_to_index[well->name()] = well_index; + well_names_to_index[well->name()] = well_index_on_proc; well_names.push_back(well->name()); { WellData wd; @@ -254,7 +258,7 @@ void WellsManager::createWellsFromSpecs(std::vector& wells, size_t } } - well_index++; + well_index_on_proc++; } // Set up reference depths that were defaulted. Count perfs.