|
dune-istl 2.12-git
|
Loading...
Searching...
No Matches
aggregates.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
210 maxValue_ = min(- std::numeric_limits<real_type>::max(), std::numeric_limits<real_type>::min());
232 inline void SymmetricMatrixDependency<M,N>::examine(G&, const typename G::EdgeIterator& edge, const ColIter&)
385 };
460 };
477 };
493 };
1070 AggregateVisitor(const AggregatesMap<Vertex>& aggregates, const AggregateDescriptor& aggregate,
1338 int aggregateNeighbours(const Vertex& vertex, const AggregateDescriptor& aggregate, const AggregatesMap<Vertex>& aggregates) const;
1347 bool admissible(const Vertex& vertex, const AggregateDescriptor& aggregate, const AggregatesMap<Vertex>& aggregates) const;
1390 void growIsolatedAggregate(const Vertex& vertex, const AggregatesMap<Vertex>& aggregates, const C& c);
1408 inline void SymmetricDependency<M,N>::initRow(const Row& /*row*/, int /*index*/, const std::false_type&)
1414 inline void SymmetricDependency<M,N>::initRow(const Row& /*row*/, int index, const std::true_type&)
1417 maxValue_ = min(- std::numeric_limits<typename Matrix::field_type>::max(), std::numeric_limits<typename Matrix::field_type>::min());
1445 inline void SymmetricDependency<M,N>::examine(G& graph, const typename G::EdgeIterator& edge, const ColIter& col)
1486 maxValue_ = min(- std::numeric_limits<real_type>::max(), std::numeric_limits<real_type>::min());
1500 inline void Dependency<M,N>::examine(G& graph, const typename G::EdgeIterator& edge, const ColIter& col)
1738 return breadthFirstSearch<true,reset>(start, aggregate, graph, vlist, aggregateVisitor, dummy, visitedMap);
1879 inline Aggregator<G>::AggregateVisitor<V>::AggregateVisitor(const AggregatesMap<Vertex>& aggregates,
1886 inline void Aggregator<G>::AggregateVisitor<V>::operator()(const typename MatrixGraph::ConstEdgeIterator& edge)
1928 inline void Aggregator<G>::TwoWayCounter::operator()(const typename MatrixGraph::ConstEdgeIterator& edge)
1935 int Aggregator<G>::twoWayConnections(const Vertex& vertex, const AggregateDescriptor& aggregate,
1944 int Aggregator<G>::oneWayConnections(const Vertex& vertex, const AggregateDescriptor& aggregate,
1953 inline void Aggregator<G>::OneWayCounter::operator()(const typename MatrixGraph::ConstEdgeIterator& edge)
1967 inline void Aggregator<G>::ConnectivityCounter::operator()(const typename MatrixGraph::ConstEdgeIterator& edge)
1969 if(connected_.find(aggregates_[edge.target()]) == connected_.end() || aggregates_[edge.target()]==AggregatesMap<Vertex>::UNAGGREGATED)
1979 inline double Aggregator<G>::connectivity(const Vertex& vertex, const AggregatesMap<Vertex>& aggregates) const
1992 inline void Aggregator<G>::DependencyCounter::operator()(const typename MatrixGraph::ConstEdgeIterator& edge)
2001 int Aggregator<G>::unusedNeighbours(const Vertex& vertex, const AggregatesMap<Vertex>& aggregates) const
2014 CombinedFunctor<CounterTuple> visitors(CounterTuple(CounterT(aggregates, AggregatesMap<Vertex>::UNAGGREGATED, unused), CounterT(aggregates, aggregate, aggregated)));
2021 int Aggregator<G>::aggregateNeighbours(const Vertex& vertex, const AggregateDescriptor& aggregate, const AggregatesMap<Vertex>& aggregates) const
2029 std::size_t Aggregator<G>::distance(const Vertex& vertex, const AggregatesMap<Vertex>& aggregates)
2032 typename PropertyMapTypeSelector<VertexVisitedTag,G>::Type visitedMap = get(VertexVisitedTag(), *graph_);
2046 inline void Aggregator<G>::FrontMarker::operator()(const typename MatrixGraph::ConstEdgeIterator& edge)
2057 inline bool Aggregator<G>::admissible(const Vertex& vertex, const AggregateDescriptor& aggregate, const AggregatesMap<Vertex>& aggregates) const
2160 if(aggregates[edge.target()]!=AggregatesMap<Vertex>::UNAGGREGATED && graph_->getVertexProperties(edge.target()).isolated())
2166 inline typename G::VertexDescriptor Aggregator<G>::mergeNeighbour(const Vertex& vertex, const AggregatesMap<Vertex>& aggregates) const
2173 graph_->getVertexProperties(edge.target()).isolated() == graph_->getVertexProperties(edge.source()).isolated()) {
2189 void Aggregator<G>::FrontNeighbourCounter::operator()(const typename MatrixGraph::ConstEdgeIterator& edge)
2228 void Aggregator<G>::growIsolatedAggregate(const Vertex& seed, const AggregatesMap<Vertex>& aggregates, const C& c)
2233 while(aggregate_->size()< c.minAggregateSize() && aggregate_->connectSize() < c.maxConnectivity()) {
2278 void Aggregator<G>::growAggregate(const Vertex& seed, const AggregatesMap<Vertex>& aggregates, const C& c)
2387 std::tuple<int,int,int,int> AggregatesMap<V>::buildAggregates(const M& matrix, G& graph, const C& criterion,
2396 std::tuple<int,int,int,int> Aggregator<G>::build(const M& m, G& graph, AggregatesMap<Vertex>& aggregates, const C& c,
2455 while(!(graph.getVertexProperties(seed).isolated()) && aggregate_->size() < c.maxAggregateSize()) {
2475 //if(aggregateNeighbours(*vertex, aggregate_->id(), aggregates) <= unusedNeighbours(*vertex, aggregates))
2547 : graph_(graph), aggregatesBuilder_(aggregatesBuilder), aggregates_(aggregates), begin_(graph.begin()), end_(graph.end())
Provides classes for building the matrix graph.
Parameter classes for customizing AMG.
Provides classes for handling internal properties in a graph.
Matrix::ConstColIterator ColIter
Constant column iterator of the matrix.
Definition aggregates.hh:275
std::vector< real_type >::iterator valIter_
Definition aggregates.hh:191
Matrix::ConstColIterator ColIter
Constant column iterator of the matrix.
Definition aggregates.hh:156
std::size_t breadthFirstSearch(const VertexDescriptor &start, const AggregateDescriptor &aggregate, const G &graph, L &visited, F1 &aggregateVisitor, F2 &nonAggregateVisitor, VM &visitedMap) const
Breadth first search within an aggregate.
PoolAllocator< VertexDescriptor, 100 > Allocator
The allocator we use for our lists and the set.
Definition aggregates.hh:579
FieldTraits< M >::real_type operator()(const M &m) const
compute the norm of a matrix.
Definition aggregates.hh:392
Norm norm_
The functor for calculating the norm.
Definition aggregates.hh:304
MatrixGraph::VertexDescriptor Vertex
The vertex identifier.
Definition aggregates.hh:918
AggregationCriterion()
Constructor.
Definition aggregates.hh:68
const Matrix * matrix_
The matrix we work on.
Definition aggregates.hh:359
FieldTraits< M >::real_type operator()(const M &m) const
compute the norm of a matrix.
Definition aggregates.hh:483
void initRow(const Row &row, int index)
SymmetricMatrixDependency(const Parameters &parms)
Definition aggregates.hh:170
M Matrix
The matrix type we build the dependency of.
Definition aggregates.hh:260
G MatrixGraph
The matrix graph type used.
Definition aggregates.hh:913
Norm norm_
The functor for calculating the norm.
Definition aggregates.hh:365
FieldTraits< M >::real_type operator()(const M &) const
compute the norm of a matrix.
Definition aggregates.hh:499
void operator()(const EdgeIterator &edge) const
Definition aggregates.hh:594
typename VertexSet::size_type size_type
Type of size used by allocator of sllist.
Definition aggregates.hh:799
void examine(const ColIter &col)
M Matrix
The matrix type we build the dependency of.
Definition aggregates.hh:321
real_type diagonal_
The norm of the current diagonal.
Definition aggregates.hh:189
N Norm
The norm to use for examining the matrix entries.
Definition aggregates.hh:265
UnSymmetricCriterion(const Parameters &parms)
Definition aggregates.hh:534
void operator()(const typename MatrixGraph::ConstEdgeIterator &edge)
void initRow(const Row &row, int index)
Definition aggregates.hh:203
bool isIsolated()
void examine(const ColIter &col)
Definition aggregates.hh:216
int row_
index of the currently evaluated row.
Definition aggregates.hh:187
void operator()(const typename MatrixGraph::ConstEdgeIterator &edge)
std::tuple< int, int, int, int > build(const M &m, G &graph, AggregatesMap< Vertex > &aggregates, const C &c, bool finestLevel)
Build the aggregates.
FrontNeighbourCounter(const MatrixGraph &front)
Constructor.
Matrix::row_type Row
Constant Row iterator of the matrix.
Definition aggregates.hh:331
const Matrix * matrix_
The matrix we work on.
Definition aggregates.hh:298
size_type connectSize()
Get the number of connections to other aggregates.
const AggregateDescriptor & operator[](const VertexDescriptor &v) const
Get the aggregate a vertex belongs to.
void examine(G &graph, const typename G::EdgeIterator &edge, const ColIter &col)
AggregateVisitor(const AggregatesMap< Vertex > &aggregates, const AggregateDescriptor &aggregate, Visitor &visitor)
Constructor.
Matrix::ConstColIterator ColIter
Constant column iterator of the matrix.
Definition aggregates.hh:336
Matrix::field_type field_type
The current max value.
Definition aggregates.hh:181
Aggregate(MatrixGraph &graph, AggregatesMap< Vertex > &aggregates, VertexSet &connectivity, std::vector< Vertex > &front_)
Constructor.
V Visitor
The type of the adapted visitor.
Definition aggregates.hh:1062
std::size_t * SphereMap
Type of the mapping of aggregate members onto distance spheres.
Definition aggregates.hh:807
AggregationCriterion(const Parameters &parms)
Definition aggregates.hh:72
Matrix::row_type Row
Constant Row iterator of the matrix.
Definition aggregates.hh:270
std::vector< real_type > vals_
Definition aggregates.hh:190
N Norm
The norm to use for examining the matrix entries.
Definition aggregates.hh:326
void printAggregates2d(const AggregatesMap< V > &aggregates, int n, int m, std::ostream &os)
Definition aggregates.hh:2580
Norm norm_
The functor for calculating the norm.
Definition aggregates.hh:185
void operator()(const typename MatrixGraph::ConstEdgeIterator &edge)
VertexSet::const_iterator const_iterator
Const iterator over a vertex list.
Definition aggregates.hh:802
SymmetricCriterion(const Parameters &parms)
Definition aggregates.hh:514
MatrixGraph::VertexDescriptor AggregateDescriptor
The type of the aggregate descriptor.
Definition aggregates.hh:921
void init(const Matrix *matrix)
Definition aggregates.hh:197
real_type diagonal_
The norm of the current diagonal.
Definition aggregates.hh:369
SymmetricDependency(const Parameters &parms)
Definition aggregates.hh:350
FieldTraits< field_type >::real_type real_type
Definition aggregates.hh:362
void examine(G &graph, const typename G::EdgeIterator &edge, const ColIter &col)
T DependencyPolicy
The policy for calculating the dependency graph.
Definition aggregates.hh:57
void add(std::vector< Vertex > &vertex)
void examine(const ColIter &col)
void operator()(const typename MatrixGraph::ConstEdgeIterator &edge)
Examine an edge.
FrontMarker(std::vector< Vertex > &front, MatrixGraph &graph)
Constructor.
void init(const Matrix *matrix)
int visitNeighbours(const G &graph, const typename G::VertexDescriptor &vertex, V &visitor)
Visit all neighbour vertices of a vertex in a graph.
void setDefaultValuesIsotropic(std::size_t dim, std::size_t diameter=2)
Sets reasonable default values for an isotropic problem.
Definition aggregates.hh:84
V AggregateDescriptor
The aggregate descriptor type.
Definition aggregates.hh:573
static const V ISOLATED
Identifier of isolated vertices.
Definition aggregates.hh:564
int row_
index of the currently evaluated row.
Definition aggregates.hh:367
SymmetricMatrixDependency()
Definition aggregates.hh:173
Vertex pop()
real_type diagonal_
The norm of the current diagonal.
Definition aggregates.hh:308
void setDefaultValuesAnisotropic(std::size_t dim, std::size_t diameter=2)
Sets reasonable default values for an aisotropic problem.
Definition aggregates.hh:107
AggregatesMap(std::size_t noVertices)
Constructs with allocating memory.
Matrix::field_type field_type
The current max value.
Definition aggregates.hh:361
AggregateDescriptor & operator[](const VertexDescriptor &v)
Get the aggregate a vertex belongs to.
SLList< VertexDescriptor, Allocator > VertexList
The type of a single linked list of vertex descriptors.
Definition aggregates.hh:585
ConnectivityCounter(const VertexSet &connected, const AggregatesMap< Vertex > &aggregates)
Constructor.
const_iterator end() const
get an iterator over the vertices of the aggregate.
void init(const Matrix *matrix)
UnSymmetricCriterion()
Definition aggregates.hh:537
void operator()(const typename MatrixGraph::ConstEdgeIterator &edge)
const AggregateDescriptor * const_iterator
Definition aggregates.hh:716
int row_
index of the currently evaluated row.
Definition aggregates.hh:306
Stack(const MatrixGraph &graph, const Aggregator< G > &aggregatesBuilder, const AggregatesMap< Vertex > &aggregates)
FieldTraits< field_type >::real_type real_type
Definition aggregates.hh:182
void initRow(const Row &row, int index)
M Matrix
The matrix type we build the dependency of.
Definition aggregates.hh:141
FieldTraits< field_type >::real_type real_type
Definition aggregates.hh:301
const Matrix * matrix_
The matrix we work on.
Definition aggregates.hh:179
S VertexSet
The type of a single linked list of vertex descriptors.
Definition aggregates.hh:794
static const V UNAGGREGATED
Identifier of not yet aggregated vertices.
Definition aggregates.hh:559
std::size_t breadthFirstSearch(const VertexDescriptor &start, const AggregateDescriptor &aggregate, const G &graph, F &aggregateVisitor, VM &visitedMap) const
Breadth first search within an aggregate.
Matrix::field_type field_type
The current max value.
Definition aggregates.hh:300
void operator()(const typename MatrixGraph::ConstEdgeIterator &edge)
std::ostream & operator<<(std::ostream &os, const AggregationCriterion< T > &criterion)
Definition aggregates.hh:115
void allocate(std::size_t noVertices)
Allocate memory for holding the information.
N Norm
The norm to use for examining the matrix entries.
Definition aggregates.hh:146
void reconstruct(const Vertex &vertex)
Reconstruct the aggregat from an seed node.
const_iterator begin() const
get an iterator over the vertices of the aggregate.
MatrixGraph::VertexDescriptor Vertex
The vertex descriptor type.
Definition aggregates.hh:782
bool isIsolated()
SymmetricDependency()
Definition aggregates.hh:353
void buildDependency(G &graph, const typename C::Matrix &matrix, C criterion, bool finestLevel)
Build the dependency of the matrix graph.
V VertexDescriptor
The vertex descriptor type.
Definition aggregates.hh:568
std::tuple< int, int, int, int > buildAggregates(const M &matrix, G &graph, const C &criterion, bool finestLevel)
Build the aggregates.
Matrix::row_type Row
Constant Row iterator of the matrix.
Definition aggregates.hh:151
FieldTraits< M >::real_type operator()(const M &m) const
compute the norm of a matrix.
Definition aggregates.hh:466
PoolAllocator< Vertex, 100 > Allocator
The allocator we use for our lists and the set.
Definition aggregates.hh:788
void operator()(const typename MatrixGraph::ConstEdgeIterator &edge)
int size() const
iterator end()
SLListConstIterator< T, A > const_iterator
void remove()
iterator begin()
void * allocate()
constexpr auto max
constexpr auto min
size_type dim() const
static constexpr size_type M()
static constexpr size_type N()
std::ptrdiff_t index() const
#define DUNE_THROW(E,...)
void add(const GlobalIndex &global)
int neighbours() const
iterator(ParallelIndexSet< TG, TL, N > &indexSet, const Father &father)
const_iterator find(int proc) const
DVVerbType dvverb
DVerbType dverb
DInfoType dinfo
void put(const RAPropertyMapHelper< Reference, PropertyMap > &pmap, const Key &key, const Value &value)
constexpr std::integral_constant< T, I0 > front(std::integer_sequence< T, I0, II... >)
constexpr auto get(std::integer_sequence< T, II... >, std::integral_constant< std::size_t, pos >={})
T field_type
T real_type
typename Imp::BlockTraits< T >::field_type field_type
Export the type representing the underlying field.
Definition matrix.hh:565
row_type::const_iterator ConstColIterator
Const iterator for the entries of each row.
Definition matrix.hh:589
MatrixImp::DenseMatrixBase< T, A >::window_type row_type
The type implementing a matrix row.
Definition matrix.hh:574
Dependency policy for symmetric matrices.
Definition aggregates.hh:136
Norm that uses only the [N][N] entry of the block to determine couplings.
Definition aggregates.hh:381
Norm that uses only the [0][0] entry of the block to determine couplings.
Definition aggregates.hh:448
Functor using the row sum (infinity) norm to determine strong couplings.
Definition aggregates.hh:456
Definition aggregates.hh:473
Definition aggregates.hh:489
Criterion taking advantage of symmetric matrices.
Definition aggregates.hh:512
Criterion suitable for unsymmetric matrices.
Definition aggregates.hh:532
Class providing information about the mapping of the vertices onto aggregates.
Definition aggregates.hh:553
A Dummy visitor that does nothing for each visited edge.
Definition aggregates.hh:591
A class for temporarily storing the vertices of an aggregate in.
Definition aggregates.hh:771
M::size_type VertexDescriptor
The vertex descriptor.
Definition graph.hh:73
EdgeIteratorT< const MatrixGraph< Matrix > > ConstEdgeIterator
The constant edge iterator type.
Definition graph.hh:298
Iterator over all edges starting from a vertex.
Definition graph.hh:95
The vertex iterator type of the graph.
Definition graph.hh:209
T assign(T... args)
T back_inserter(T... args)
T begin(T... args)
T beta(T... args)
T capacity(T... args)
T clear(T... args)
T end(T... args)
T endl(T... args)
T erase(T... args)
T find(T... args)
T flags(T... args)
T imag(T... args)
T insert(T... args)
T lower_bound(T... args)
T make_pair(T... args)
T make_tuple(T... args)
T max(T... args)
T min(T... args)
T push_back(T... args)
T real(T... args)
T reserve(T... args)
T resize(T... args)
T set_difference(T... args)
T setf(T... args)
T size(T... args)
T sort(T... args)
T width(T... args)
Legal Statements / Impressum | Hosted by TU Dresden & Uni Heidelberg | Generated by
1.9.8