|
dune-istl 2.12-git
|
Loading...
Searching...
No Matches
matrixhierarchy.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
51 };
85 using AAllocator = typename std::allocator_traits<Allocator>::template rebind_alloc<AggregatesMap*>;
94 using RILAllocator = typename std::allocator_traits<Allocator>::template rebind_alloc<RedistributeInfoType>;
306 : AggregationCriterion(Dune::Amg::Parameters(maxLevel, coarsenTarget, minCoarsenRate, prolongDamp, accumulate, useFixedOrder))
398 DUNE_THROW(ISTLError, "MatrixOperator and ParallelInformation must belong to the same category!");
410 static const int noints=(Dune::Amg::MAX_PROCESSES/4096>0) ? (Dune::Amg::MAX_PROCESSES/4096) : 1;
415 MatrixStats<typename M::matrix_type,MINIMAL_DEBUG_LEVEL<=INFO_DEBUG_LEVEL>::stats(mlevel->getmat());
437 std::cout<<"Level "<<level<<" has "<<dunknowns<<" unknowns, "<<dunknowns/infoLevel->communicator().size()
471 std::cout<<"Level "<<level<<" (redistributed) has "<<dunknowns<<" unknowns, "<<dunknowns/redistComm->communicator().size()
514 std::cout<<" Have built "<<noAggregates<<" aggregates totally ("<<isoAggregates<<" isolated aggregates, "<<
568 std::cout << "Building "<<dgnoAggregates<<" aggregates took "<<watch.elapsed()<<" seconds."<<std::endl;
635 std::cout<<"Communicating global aggregate numbers took "<<watch.elapsed()<<" seconds."<<std::endl;
660 productBuilder.calculate(matrix->getmat(), *aggregatesMap, *coarseMatrix, *infoLevel, OverlapFlags());
664 std::cout<<"Calculation entries of Galerkin product took "<<watch.elapsed()<<" seconds."<<std::endl;
688 std::cout<<"Level "<<level<<" has "<<dunknownsLevel<<" unknowns, "<<dunknownsLevel/infoLevel->communicator().size()
699 std::cerr<<"Successive accumulation of data on coarse levels only works with ParMETIS installed."
716 std::cout<<"Level "<<level<<" redistributed has "<<dunknownsRedist<<" unknowns, "<<dunknownsRedist/redistComm->communicator().size()
747 void MatrixHierarchy<M,IS,A>::getCoarsestAggregatesOnFinest(std::vector<std::size_t>& data) const
790 ibpair = used.insert(static_cast<std::size_t>((((double)rand())/(RAND_MAX+1.0))*coarse->size()));
856 Dune::dvverb<<"Level "<<level<<" has "<<matrices_.finest()->getmat().N()<<" unknowns!"<<std::endl;
Provides a class for building the index set and remote indices on the coarse level.
Provides classes for the Coloring process of AMG.
Provides classes for building the matrix graph.
Provides a classes representing the hierarchies in AMG.
Prolongation and restriction for amg.
Helper classes for the construction of classes without empty constructor.
Provides a class for building the galerkin product based on a aggregation scheme.
Classes for the generic construction and application of the smoothers.
Provdes class for identifying aggregates globally.
Provides classes for initializing the link attributes of a matrix graph.
Some handy generic functions for ISTL matrices.
This file implements a vector space as a tensor product of a given vector space. The number of compon...
Functionality for redistributing a sparse matrix.
auto countNonZeros(const M &, typename std::enable_if_t< Dune::IsNumber< M >::value > *sfinae=nullptr)
Get the number of nonzero fields in the matrix.
Definition matrixutils.hh:119
const AggregatesMapList & aggregatesMaps() const
Get the hierarchy of the mappings of the nodes onto aggregates.
Definition matrixhierarchy.hh:816
bool isBuilt() const
Whether the hierarchy was built.
Definition matrixhierarchy.hh:957
static std::shared_ptr< T > construct(Arguments &)
Construct an object with the specified arguments.
Definition construction.hh:52
std::size_t levels() const
Get the number of levels in the hierarchy.
Definition hierarchy.hh:326
std::size_t levels() const
Get the number of levels in the hierarchy.
Definition matrixhierarchy.hh:938
void addCoarser(Arguments &args)
Add an element on a coarser level.
Definition hierarchy.hh:338
const RedistributeInfoList & redistributeInformation() const
Get the hierarchy of the information about redistributions,.
Definition matrixhierarchy.hh:822
const ParallelInformationHierarchy & parallelInformation() const
Get the hierarchy of the parallel data distribution information.
Definition matrixhierarchy.hh:741
bool repartitionAndDistributeMatrix(const M &origMatrix, std::shared_ptr< M > newMatrix, SequentialInformation &origComm, std::shared_ptr< SequentialInformation > &newComm, RedistributeInformation< SequentialInformation > &ri, int nparts, C1 &criterion)
Definition matrixhierarchy.hh:316
const ParallelMatrixHierarchy & matrices() const
Get the matrix hierarchy.
Definition matrixhierarchy.hh:734
std::size_t maxlevels() const
Get the max number of levels in the hierarchy of processors.
Definition matrixhierarchy.hh:944
static const V ISOLATED
Identifier of isolated vertices.
Definition aggregates.hh:564
void recalculateGalerkin(const F ©Flags)
Recalculate the galerkin products.
Definition matrixhierarchy.hh:902
const void * Arguments
A type holding all the arguments needed to call the constructor.
Definition construction.hh:44
void coarsenVector(Hierarchy< BlockVector< V, BA >, TA > &hierarchy) const
Coarsen the vector hierarchy according to the matrix hierarchy.
Definition matrixhierarchy.hh:845
const AggregateDescriptor * const_iterator
Definition aggregates.hh:716
MatrixHierarchy(std::shared_ptr< MatrixOperator > fineMatrix, std::shared_ptr< ParallelInformation > pinfo=std::make_shared< ParallelInformation >())
Constructor.
Definition matrixhierarchy.hh:392
AccumulationMode
Identifiers for the different accumulation modes.
Definition parameters.hh:231
Iterator finest()
Get an iterator positioned at the finest level.
Definition hierarchy.hh:381
void build(const T &criterion)
Build the matrix hierarchy using aggregation.
Definition matrixhierarchy.hh:403
void coarsenSmoother(Hierarchy< S, TA > &smoothers, const typename SmootherTraits< S >::Arguments &args) const
Coarsen the smoother hierarchy according to the matrix hierarchy.
Definition matrixhierarchy.hh:872
void buildDependency(G &graph, const typename C::Matrix &matrix, C criterion, bool finestLevel)
Build the dependency of the matrix graph.
std::tuple< int, int, int, int > buildAggregates(const M &matrix, G &graph, const C &criterion, bool finestLevel)
Build the aggregates.
void calculate(const M &fine, const AggregatesMap< V > &aggregates, M &coarse, const I &pinfo, const O ©)
Calculate the galerkin product.
void getCoarsestAggregatesOnFinest(std::vector< std::size_t > &data) const
Get the mapping of fine level unknowns to coarse level aggregates.
Definition matrixhierarchy.hh:747
@ MAX_PROCESSES
Hard limit for the number of processes allowed.
Definition matrixhierarchy.hh:50
@ atOnceAccu
Accumulate data to one process at once.
Definition parameters.hh:243
@ successiveAccu
Successively accumulate to fewer processes.
Definition parameters.hh:247
int size() const
iterator end()
static constexpr size_type M()
#define DUNE_THROW(E,...)
MPI_Comm communicator() const
DVVerbType dvverb
DVerbType dverb
DInfoType dinfo
void printGlobalSparseMatrix(const M &mat, C &ooc, std::ostream &os)
Definition matrixutils.hh:154
void redistributeMatrixEntries(M &origMatrix, M &newMatrix, C &origComm, C &newComm, RedistributeInformation< C > &ri)
Definition matrixredistribute.hh:757
bool commGraphRepartition(const M &mat, Dune::OwnerOverlapCopyCommunication< T1, T2 > &oocomm, Metis::idx_t nparts, std::shared_ptr< Dune::OwnerOverlapCopyCommunication< T1, T2 > > &outcomm, RedistributeInterface &redistInf, bool verbose=false)
Definition repartition.hh:822
void redistributeMatrix(M &origMatrix, M &newMatrix, C &origComm, C &newComm, RedistributeInformation< C > &ri)
Redistribute a matrix according to given domain decompositions.
Definition matrixredistribute.hh:818
bool graphRepartition(const G &graph, Dune::OwnerOverlapCopyCommunication< T1, T2 > &oocomm, Metis::idx_t nparts, std::shared_ptr< Dune::OwnerOverlapCopyCommunication< T1, T2 > > &outcomm, RedistributeInterface &redistInf, bool verbose=false)
execute a graph repartition for a giving graph and indexset.
Definition repartition.hh:1228
constexpr auto get(std::integer_sequence< T, II... >, std::integral_constant< std::size_t, pos >={})
MatrixImp::DenseMatrixBase< T, A >::window_type row_type
The type implementing a matrix row.
Definition matrix.hh:574
Definition matrixredistribute.hh:22
void reset() noexcept
double elapsed() const noexcept
Class providing information about the mapping of the vertices onto aggregates.
Definition aggregates.hh:553
Class representing the properties of an edge in the matrix graph.
Definition dependency.hh:39
Class representing a node in the matrix graph.
Definition dependency.hh:126
Definition galerkin.hh:99
Definition galerkin.hh:118
Definition globalaggregates.hh:131
Attaches properties to the edges and vertices of a graph.
Definition graph.hh:978
Graph::VertexDescriptor VertexDescriptor
The vertex descriptor.
Definition graph.hh:988
Definition graphcreator.hh:22
LevelIterator< Hierarchy< MatrixOperator, Allocator >, MatrixOperator > Iterator
Type of the mutable iterator.
Definition hierarchy.hh:220
LevelIterator< const Hierarchy< MatrixOperator, Allocator >, const MatrixOperator > ConstIterator
Type of the const iterator.
Definition hierarchy.hh:223
Definition indicescoarsener.hh:36
The hierarchies build by the coarsening process.
Definition matrixhierarchy.hh:61
typename std::allocator_traits< Allocator >::template rebind_alloc< AggregatesMap * > AAllocator
Allocator for pointers.
Definition matrixhierarchy.hh:85
Dune::Amg::Hierarchy< ParallelInformation, Allocator > ParallelInformationHierarchy
The type of the parallel informarion hierarchy.
Definition matrixhierarchy.hh:82
std::list< AggregatesMap *, AAllocator > AggregatesMapList
The type of the aggregates maps list.
Definition matrixhierarchy.hh:88
PI ParallelInformation
The type of the index set.
Definition matrixhierarchy.hh:70
Dune::Amg::Hierarchy< MatrixOperator, Allocator > ParallelMatrixHierarchy
The type of the parallel matrix hierarchy.
Definition matrixhierarchy.hh:79
A Allocator
The allocator to use.
Definition matrixhierarchy.hh:73
RedistributeInformation< ParallelInformation > RedistributeInfoType
The type of the redistribute information.
Definition matrixhierarchy.hh:91
double getProlongationDampingFactor() const
Definition matrixhierarchy.hh:188
typename std::allocator_traits< Allocator >::template rebind_alloc< RedistributeInfoType > RILAllocator
Allocator for RedistributeInfoType.
Definition matrixhierarchy.hh:94
std::list< RedistributeInfoType, RILAllocator > RedistributeInfoList
The type of the list of redistribute information.
Definition matrixhierarchy.hh:97
Dune::Amg::AggregatesMap< typename MatrixGraph< Matrix >::VertexDescriptor > AggregatesMap
The type of the aggregates map we use.
Definition matrixhierarchy.hh:76
MatrixOperator::matrix_type Matrix
The type of the matrix.
Definition matrixhierarchy.hh:67
M MatrixOperator
The type of the matrix operator.
Definition matrixhierarchy.hh:64
void operator()(const matrix_row &row)
Definition matrixhierarchy.hh:254
Matrix::row_type matrix_row
Definition matrixhierarchy.hh:245
size_type min
Definition matrixhierarchy.hh:261
calc()
Definition matrixhierarchy.hh:247
size_type max
Definition matrixhierarchy.hh:262
size_type sum
Definition matrixhierarchy.hh:263
Matrix::size_type size_type
Definition matrixhierarchy.hh:244
The criterion describing the stop criteria for the coarsening process.
Definition matrixhierarchy.hh:283
CoarsenCriterion(const Dune::Amg::Parameters &parms)
Definition matrixhierarchy.hh:309
T AggregationCriterion
The criterion for tagging connections as strong and nodes as isolated. This might be e....
Definition matrixhierarchy.hh:289
CoarsenCriterion(int maxLevel=100, int coarsenTarget=1000, double minCoarsenRate=1.2, double prolongDamp=1.6, AccumulationMode accumulate=successiveAccu, bool useFixedOrder=false)
Constructor.
Definition matrixhierarchy.hh:304
Definition pinfo.hh:28
Tag idnetifying the visited property of a vertex.
Definition properties.hh:29
The default class for the smoother arguments.
Definition smoother.hh:39
Definition transfer.hh:32
static Category category(const OP &op, decltype(op.category()) *=nullptr)
Helperfunction to extract the solver category either from an enum, or from the newly introduced virtu...
Definition solvercategory.hh:34
T assign(T... args)
T begin(T... args)
T ceil(T... args)
T clock(T... args)
T end(T... args)
T endl(T... args)
T insert(T... args)
T max(T... args)
T min(T... args)
T rbegin(T... args)
T reserve(T... args)
T resize(T... args)
T size(T... args)
T swap(T... args)
Legal Statements / Impressum | Hosted by TU Dresden & Uni Heidelberg | Generated by
1.9.8