dune-istl 3.0-git
renumberer.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_AMG_RENUMBERER_HH
4#define DUNE_AMG_RENUMBERER_HH
5
6#include "aggregates.hh"
7
8namespace Dune
9{
10 namespace Amg
11 {
12 template<class G>
14 {
15 public:
17 typedef typename G::VertexDescriptor Vertex;
18
24
26 operator Vertex() const;
27
28 void operator()(const typename G::ConstEdgeIterator& edge);
29
30 void operator++();
31
32 protected:
35 };
36
37 template<class G>
39 : number_(0), aggregates_(aggregates)
40 {}
41
42 template<class G>
44 {
45 return number_;
46 }
47
48 template<class G>
49 void AggregateRenumberer<G>::operator()(const typename G::ConstEdgeIterator& edge)
50 {
51 aggregates_[edge.target()]=number_;
52 }
53
54 template<class G>
56 {
57 ++number_;
58 }
59
60 template<class G, class I, class V>
61 void renumberAggregates(const G& graph, I index, I endIndex, V& visitedMap,
63 {
65
66 for(I index1=index; index1 != endIndex; ++index1)
68 !get(visitedMap, index1.index())) {
69
70 aggregates.template breadthFirstSearch<false>(index1.index(), aggregates[index1.index()],
71 graph, renumberer, visitedMap);
72 aggregates[index1.index()] = renumberer;
73 ++renumberer;
74 }
75 for(; index != endIndex; ++index)
76 put(visitedMap, index.index(), false);
77 }
78
79 } // namespace AMG
80} // namespace Dune
81#endif
Provides classes for the Coloring process of AMG.
Definition basearray.hh:19
PropertyMapTypeSelector< Amg::VertexVisitedTag, Amg::PropertiesGraph< G, Amg::VertexProperties, EP, VM, EM > >::Type get(const Amg::VertexVisitedTag &tag, Amg::PropertiesGraph< G, Amg::VertexProperties, EP, VM, EM > &graph)
Definition dependency.hh:292
void renumberAggregates(const G &graph, I index, I endIndex, V &visitedMap, AggregatesMap< typename G::VertexDescriptor > &aggregates)
Definition renumberer.hh:61
Statistics about compression achieved in implicit mode.
Definition bcrsmatrix.hh:81
Class providing information about the mapping of the vertices onto aggregates.
Definition aggregates.hh:543
Definition renumberer.hh:14
void operator++()
Definition renumberer.hh:55
G::VertexDescriptor Vertex
The vertex type.
Definition renumberer.hh:17
void operator()(const typename G::ConstEdgeIterator &edge)
Definition renumberer.hh:49
AggregatesMap< Vertex > & aggregates_
Definition renumberer.hh:34
AggregateRenumberer(AggregatesMap< Vertex > &aggregates)
Constructor.
Definition renumberer.hh:38
Vertex number_
Definition renumberer.hh:33