From ca3bcb2662251d813e2ed42420d9298a21d5cff8 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Tue, 19 May 2015 19:58:05 +0200 Subject: [PATCH] Use more accurate name for the size of the global components. The new name is num_global_components, which actually is an upper bound for the the number of global components (1 plus the maximum global index). --- opm/core/linalg/ParallelIstlInformation.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/opm/core/linalg/ParallelIstlInformation.hpp b/opm/core/linalg/ParallelIstlInformation.hpp index 9f2c2200c..24e9084d7 100644 --- a/opm/core/linalg/ParallelIstlInformation.hpp +++ b/opm/core/linalg/ParallelIstlInformation.hpp @@ -115,19 +115,20 @@ public: void copyValuesTo(ParallelIndexSet& indexSet, RemoteIndices& remoteIndices, std::size_t local_component_size = 0, std::size_t num_components = 1) const { - ParallelIndexSet::GlobalIndex max_gi = local_component_size; + ParallelIndexSet::GlobalIndex global_component_size = local_component_size; if ( num_components > 1 ) { + ParallelIndexSet::GlobalIndex max_gi = 0; // component the max global index for( auto i = indexSet_->begin(), end = indexSet_->end(); i != end; ++i ) { max_gi = std::max(max_gi, i->global()); } - ++max_gi; - max_gi = communicator_.max(max_gi); + global_component_size = max_gi+1; + global_component_size = communicator_.max(global_component_size); } indexSet.beginResize(); - IndexSetInserter inserter(indexSet, max_gi, + IndexSetInserter inserter(indexSet, global_component_size, local_component_size, num_components); std::for_each(indexSet_->begin(), indexSet_->end(), inserter); indexSet.endResize();