|
dune-istl 2.9.0
|
Loading...
Searching...
No Matches
aggregates.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
208 maxValue_ = min(- std::numeric_limits<real_type>::max(), std::numeric_limits<real_type>::min());
230 inline void SymmetricMatrixDependency<M,N>::examine(G&, const typename G::EdgeIterator& edge, const ColIter&)
467 };
484 };
500 };
1072 AggregateVisitor(const AggregatesMap<Vertex>& aggregates, const AggregateDescriptor& aggregate,
1341 int aggregateNeighbours(const Vertex& vertex, const AggregateDescriptor& aggregate, const AggregatesMap<Vertex>& aggregates) const;
1350 bool admissible(const Vertex& vertex, const AggregateDescriptor& aggregate, const AggregatesMap<Vertex>& aggregates) const;
1393 void growIsolatedAggregate(const Vertex& vertex, const AggregatesMap<Vertex>& aggregates, const C& c);
1411 inline void SymmetricDependency<M,N>::initRow(const Row& row, int index, const std::false_type&)
1417 inline void SymmetricDependency<M,N>::initRow([[maybe_unused]] const Row& row, int index, const std::true_type&)
1420 maxValue_ = min(- std::numeric_limits<typename Matrix::field_type>::max(), std::numeric_limits<typename Matrix::field_type>::min());
1448 inline void SymmetricDependency<M,N>::examine(G& graph, const typename G::EdgeIterator& edge, const ColIter& col)
1489 maxValue_ = min(- std::numeric_limits<real_type>::max(), std::numeric_limits<real_type>::min());
1503 inline void Dependency<M,N>::examine(G& graph, const typename G::EdgeIterator& edge, const ColIter& col)
1741 return breadthFirstSearch<true,reset>(start, aggregate, graph, vlist, aggregateVisitor, dummy, visitedMap);
1882 inline Aggregator<G>::AggregateVisitor<V>::AggregateVisitor(const AggregatesMap<Vertex>& aggregates,
1889 inline void Aggregator<G>::AggregateVisitor<V>::operator()(const typename MatrixGraph::ConstEdgeIterator& edge)
1931 inline void Aggregator<G>::TwoWayCounter::operator()(const typename MatrixGraph::ConstEdgeIterator& edge)
1938 int Aggregator<G>::twoWayConnections(const Vertex& vertex, const AggregateDescriptor& aggregate,
1947 int Aggregator<G>::oneWayConnections(const Vertex& vertex, const AggregateDescriptor& aggregate,
1956 inline void Aggregator<G>::OneWayCounter::operator()(const typename MatrixGraph::ConstEdgeIterator& edge)
1970 inline void Aggregator<G>::ConnectivityCounter::operator()(const typename MatrixGraph::ConstEdgeIterator& edge)
1972 if(connected_.find(aggregates_[edge.target()]) == connected_.end() || aggregates_[edge.target()]==AggregatesMap<Vertex>::UNAGGREGATED)
1982 inline double Aggregator<G>::connectivity(const Vertex& vertex, const AggregatesMap<Vertex>& aggregates) const
1995 inline void Aggregator<G>::DependencyCounter::operator()(const typename MatrixGraph::ConstEdgeIterator& edge)
2004 int Aggregator<G>::unusedNeighbours(const Vertex& vertex, const AggregatesMap<Vertex>& aggregates) const
2017 CombinedFunctor<CounterTuple> visitors(CounterTuple(CounterT(aggregates, AggregatesMap<Vertex>::UNAGGREGATED, unused), CounterT(aggregates, aggregate, aggregated)));
2024 int Aggregator<G>::aggregateNeighbours(const Vertex& vertex, const AggregateDescriptor& aggregate, const AggregatesMap<Vertex>& aggregates) const
2032 std::size_t Aggregator<G>::distance(const Vertex& vertex, const AggregatesMap<Vertex>& aggregates)
2035 typename PropertyMapTypeSelector<VertexVisitedTag,G>::Type visitedMap = get(VertexVisitedTag(), *graph_);
2049 inline void Aggregator<G>::FrontMarker::operator()(const typename MatrixGraph::ConstEdgeIterator& edge)
2060 inline bool Aggregator<G>::admissible(const Vertex& vertex, const AggregateDescriptor& aggregate, const AggregatesMap<Vertex>& aggregates) const
2163 if(aggregates[edge.target()]!=AggregatesMap<Vertex>::UNAGGREGATED && graph_->getVertexProperties(edge.target()).isolated())
2169 inline typename G::VertexDescriptor Aggregator<G>::mergeNeighbour(const Vertex& vertex, const AggregatesMap<Vertex>& aggregates) const
2176 graph_->getVertexProperties(edge.target()).isolated() == graph_->getVertexProperties(edge.source()).isolated()) {
2192 void Aggregator<G>::FrontNeighbourCounter::operator()(const typename MatrixGraph::ConstEdgeIterator& edge)
2231 void Aggregator<G>::growIsolatedAggregate(const Vertex& seed, const AggregatesMap<Vertex>& aggregates, const C& c)
2236 while(aggregate_->size()< c.minAggregateSize() && aggregate_->connectSize() < c.maxConnectivity()) {
2281 void Aggregator<G>::growAggregate(const Vertex& seed, const AggregatesMap<Vertex>& aggregates, const C& c)
2390 std::tuple<int,int,int,int> AggregatesMap<V>::buildAggregates(const M& matrix, G& graph, const C& criterion,
2399 std::tuple<int,int,int,int> Aggregator<G>::build(const M& m, G& graph, AggregatesMap<Vertex>& aggregates, const C& c,
2458 while(!(graph.getVertexProperties(seed).isolated()) && aggregate_->size() < c.maxAggregateSize()) {
2478 //if(aggregateNeighbours(*vertex, aggregate_->id(), aggregates) <= unusedNeighbours(*vertex, aggregates))
2550 : 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:273
std::vector< real_type >::iterator valIter_
Definition aggregates.hh:189
Matrix::ConstColIterator ColIter
Constant column iterator of the matrix.
Definition aggregates.hh:154
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:586
Norm norm_
The functor for calculating the norm.
Definition aggregates.hh:302
MatrixGraph::VertexDescriptor Vertex
The vertex identifier.
Definition aggregates.hh:920
AggregationCriterion()
Constructor.
Definition aggregates.hh:66
const Matrix * matrix_
The matrix we work on.
Definition aggregates.hh:357
auto operator()(const M &m, typename std::enable_if_t< Dune::IsNumber< M >::value > *sfinae=nullptr) const
Compute the norm of a scalar.
Definition aggregates.hh:406
void initRow(const Row &row, int index)
SymmetricMatrixDependency(const Parameters &parms)
Definition aggregates.hh:168
M Matrix
The matrix type we build the dependency of.
Definition aggregates.hh:258
G MatrixGraph
The matrix graph type used.
Definition aggregates.hh:915
Norm norm_
The functor for calculating the norm.
Definition aggregates.hh:363
void operator()(const EdgeIterator &edge) const
Definition aggregates.hh:601
void examine(const ColIter &col)
M Matrix
The matrix type we build the dependency of.
Definition aggregates.hh:319
real_type diagonal_
The norm of the current diagonal.
Definition aggregates.hh:187
N Norm
The norm to use for examining the matrix entries.
Definition aggregates.hh:263
UnSymmetricCriterion(const Parameters &parms)
Definition aggregates.hh:541
void operator()(const typename MatrixGraph::ConstEdgeIterator &edge)
void initRow(const Row &row, int index)
Definition aggregates.hh:201
bool isIsolated()
void examine(const ColIter &col)
Definition aggregates.hh:214
int row_
index of the currently evaluated row.
Definition aggregates.hh:185
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:329
const Matrix * matrix_
The matrix we work on.
Definition aggregates.hh:296
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:334
Matrix::field_type field_type
The current max value.
Definition aggregates.hh:179
Aggregate(MatrixGraph &graph, AggregatesMap< Vertex > &aggregates, VertexSet &connectivity, std::vector< Vertex > &front_)
Constructor.
V Visitor
The type of the adapted visitor.
Definition aggregates.hh:1064
std::size_t * SphereMap
Type of the mapping of aggregate members onto distance spheres.
Definition aggregates.hh:809
AggregationCriterion(const Parameters &parms)
Definition aggregates.hh:70
Matrix::row_type Row
Constant Row iterator of the matrix.
Definition aggregates.hh:268
VertexSet::size_type connectSize()
Get tne number of connections to other aggregates.
std::vector< real_type > vals_
Definition aggregates.hh:188
N Norm
The norm to use for examining the matrix entries.
Definition aggregates.hh:324
void printAggregates2d(const AggregatesMap< V > &aggregates, int n, int m, std::ostream &os)
Definition aggregates.hh:2583
Norm norm_
The functor for calculating the norm.
Definition aggregates.hh:183
void operator()(const typename MatrixGraph::ConstEdgeIterator &edge)
VertexSet::const_iterator const_iterator
Const iterator over a vertex list.
Definition aggregates.hh:804
SymmetricCriterion(const Parameters &parms)
Definition aggregates.hh:521
MatrixGraph::VertexDescriptor AggregateDescriptor
The type of the aggregate descriptor.
Definition aggregates.hh:923
void init(const Matrix *matrix)
Definition aggregates.hh:195
real_type diagonal_
The norm of the current diagonal.
Definition aggregates.hh:367
SymmetricDependency(const Parameters &parms)
Definition aggregates.hh:348
FieldTraits< field_type >::real_type real_type
Definition aggregates.hh:360
void examine(G &graph, const typename G::EdgeIterator &edge, const ColIter &col)
T DependencyPolicy
The policy for calculating the dependency graph.
Definition aggregates.hh:55
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.
FieldTraits< typenameM::field_type >::real_type operator()(const M &m) const
compute the norm of a matrix.
Definition aggregates.hh:506
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:82
V AggregateDescriptor
The aggregate descriptor type.
Definition aggregates.hh:580
static const V ISOLATED
Identifier of isolated vertices.
Definition aggregates.hh:571
int row_
index of the currently evaluated row.
Definition aggregates.hh:365
SymmetricMatrixDependency()
Definition aggregates.hh:171
Vertex pop()
real_type diagonal_
The norm of the current diagonal.
Definition aggregates.hh:306
void setDefaultValuesAnisotropic(std::size_t dim, std::size_t diameter=2)
Sets reasonable default values for an aisotropic problem.
Definition aggregates.hh:105
AggregatesMap(std::size_t noVertices)
Constructs with allocating memory.
Matrix::field_type field_type
The current max value.
Definition aggregates.hh:359
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:592
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:544
void operator()(const typename MatrixGraph::ConstEdgeIterator &edge)
const AggregateDescriptor * const_iterator
Definition aggregates.hh:723
int row_
index of the currently evaluated row.
Definition aggregates.hh:304
Stack(const MatrixGraph &graph, const Aggregator< G > &aggregatesBuilder, const AggregatesMap< Vertex > &aggregates)
FieldTraits< field_type >::real_type real_type
Definition aggregates.hh:180
void initRow(const Row &row, int index)
M Matrix
The matrix type we build the dependency of.
Definition aggregates.hh:139
FieldTraits< field_type >::real_type real_type
Definition aggregates.hh:299
const Matrix * matrix_
The matrix we work on.
Definition aggregates.hh:177
S VertexSet
The type of a single linked list of vertex descriptors.
Definition aggregates.hh:801
FieldTraits< typenameM::field_type >::real_type operator()(const M &m) const
compute the norm of a matrix.
Definition aggregates.hh:490
static const V UNAGGREGATED
Identifier of not yet aggregated vertices.
Definition aggregates.hh:566
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:298
void operator()(const typename MatrixGraph::ConstEdgeIterator &edge)
std::ostream & operator<<(std::ostream &os, const AggregationCriterion< T > &criterion)
Definition aggregates.hh:113
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:144
FieldTraits< typenameM::field_type >::real_type operator()(const M &m) const
compute the norm of a matrix.
Definition aggregates.hh:473
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.
FieldTraits< typenameM::field_type >::real_type operator()(const M &m, typename std::enable_if_t<!Dune::IsNumber< M >::value > *sfinae=nullptr) const
compute the norm of a matrix.
Definition aggregates.hh:390
MatrixGraph::VertexDescriptor Vertex
The vertex descriptor type.
Definition aggregates.hh:789
bool isIsolated()
SymmetricDependency()
Definition aggregates.hh:351
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:575
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:149
PoolAllocator< Vertex, 100 > Allocator
The allocator we use for our lists and the set.
Definition aggregates.hh:795
void operator()(const typename MatrixGraph::ConstEdgeIterator &edge)
int size() const
iterator end()
SLListConstIterator< T, A > const_iterator
void remove()
iterator begin()
void * allocate()
size_type dim() const
static constexpr size_type M()
static constexpr size_type N()
std::ptrdiff_t index() const
#define DUNE_THROW(E, m)
void add(const GlobalIndex &global)
iterator(ParallelIndexSet< TG, TL, N > &indexSet, const Father &father)
DVVerbType dvverb
DVerbType dverb
DInfoType dinfo
void put(const RAPropertyMapHelper< Reference, PropertyMap > &pmap, const Key &key, const Value &value)
Reference get(const RAPropertyMapHelper< Reference, PropertyMap > &pmap, const Key &key)
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:134
Norm that uses only the [N][N] entry of the block to determine couplings.
Definition aggregates.hh:379
Norm that uses only the [0][0] entry of the block to determine couplings.
Definition aggregates.hh:455
Functor using the row sum (infinity) norm to determine strong couplings.
Definition aggregates.hh:463
Definition aggregates.hh:480
Definition aggregates.hh:496
Criterion taking advantage of symmetric matrices.
Definition aggregates.hh:519
Criterion suitable for unsymmetric matrices.
Definition aggregates.hh:539
Class providing information about the mapping of the vertices onto aggregates.
Definition aggregates.hh:560
A Dummy visitor that does nothing for each visited edge.
Definition aggregates.hh:598
A class for temporarily storing the vertices of an aggregate in.
Definition aggregates.hh:778
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