1 #ifndef DUNE_GLOBALAGGREGATES_HH
2 #define DUNE_GLOBALAGGREGATES_HH
6 #include <dune/common/parallel/indexset.hh>
13 template<
typename T,
typename TI>
23 typedef typename ParallelIndexSet::LocalIndex
LocalIndex;
28 const GlobalLookupIndexSet<ParallelIndexSet>& indexset)
29 : aggregates_(aggregates), indexset_(indexset)
37 return isolatedMarker;
39 const Dune::IndexPair<GlobalIndex,LocalIndex >* pair = indexset_.pair(aggregate);
41 return pair->global();
50 const Dune::IndexPair<GlobalIndex,LocalIndex >* pair = indexset_.pair(aggregate);
58 Proxy(
const GlobalLookupIndexSet<ParallelIndexSet>& indexset,
Vertex& aggregate)
59 : indexset_(&indexset), aggregate_(&aggregate)
64 if(global==isolatedMarker)
68 *aggregate_ = indexset_->operator[](global).local();
73 const GlobalLookupIndexSet<ParallelIndexSet>* indexset_;
79 return Proxy(indexset_, aggregates_[index]);
84 aggregates_[i]=indexset_[global].local();
90 const GlobalLookupIndexSet<ParallelIndexSet>& indexset_;
94 template<
typename T,
typename TI>
95 const typename TI::GlobalIndex GlobalAggregatesMap<T,TI>::isolatedMarker =
96 std::numeric_limits<typename TI::GlobalIndex>::max();
98 template<
typename T,
typename TI>
115 template<
typename T,
typename O,
typename I>
128 template<
class T1,
class T2>
145 template<
typename T,
typename O,
typename T1,
typename T2>
159 GlobalMap gmap(aggregates, globalLookup);
167 typedef typename ParallelInformation::RemoteIndices::const_iterator Lists;
176 for(Iter i=aggregates.
begin(), end=aggregates.
end(); i!=end; ++i)
177 maxAggregate = std::max(maxAggregate, *i);
180 std::map<Vertex,Vertex> newMapping;
183 typedef typename ParallelInformation::RemoteIndices::RemoteIndexList
184 ::const_iterator RIter;
185 for(RIter ri=lists->second.first->begin(), rend = lists->second.first->end();
187 if(O::contains(ri->localIndexPair().local().attribute()))
188 newMapping.insert(std::make_pair(aggregates[ri->localIndexPair().local()],
191 typedef typename std::map<Vertex,Vertex>::iterator MIter;
192 for(MIter mi=newMapping.begin(), mend=newMapping.end();
194 mi->second=++maxAggregate;
197 for(RIter ri=lists->second.first->begin(), rend = lists->second.first->end();
199 if(O::contains(ri->localIndexPair().local().attribute()))
200 aggregates[ri->localIndexPair().local()] =
201 newMapping[aggregates[ri->localIndexPair().local()]];
207 template<
typename T,
typename O>
224 template<
typename T,
typename TI>
225 struct CommPolicy<Amg::GlobalAggregatesMap<T,TI> >
230 static int getSize(
const Type&,
int)