mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
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).
This commit is contained in:
@@ -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<ParallelIndexSet> inserter(indexSet, max_gi,
|
||||
IndexSetInserter<ParallelIndexSet> inserter(indexSet, global_component_size,
|
||||
local_component_size, num_components);
|
||||
std::for_each(indexSet_->begin(), indexSet_->end(), inserter);
|
||||
indexSet.endResize();
|
||||
|
||||
Reference in New Issue
Block a user