|
dune-istl 2.8.0
|
Loading...
Searching...
No Matches
matrixhierarchy.hh
Go to the documentation of this file.
49 };
83 using AAllocator = typename std::allocator_traits<Allocator>::template rebind_alloc<AggregatesMap*>;
92 using RILAllocator = typename std::allocator_traits<Allocator>::template rebind_alloc<RedistributeInfoType>;
301 : AggregationCriterion(Dune::Amg::Parameters(maxLevel, coarsenTarget, minCoarsenRate, prolongDamp, accumulate))
393 DUNE_THROW(ISTLError, "MatrixOperator and ParallelInformation must belong to the same category!");
405 static const int noints=(Dune::Amg::MAX_PROCESSES/4096>0) ? (Dune::Amg::MAX_PROCESSES/4096) : 1;
410 MatrixStats<typename M::matrix_type,MINIMAL_DEBUG_LEVEL<=INFO_DEBUG_LEVEL>::stats(mlevel->getmat());
432 std::cout<<"Level "<<level<<" has "<<dunknowns<<" unknowns, "<<dunknowns/infoLevel->communicator().size()
466 std::cout<<"Level "<<level<<" (redistributed) has "<<dunknowns<<" unknowns, "<<dunknowns/redistComm->communicator().size()
511 std::cout<<" Have built "<<noAggregates<<" aggregates totally ("<<isoAggregates<<" isolated aggregates, "<<
565 std::cout << "Building "<<dgnoAggregates<<" aggregates took "<<watch.elapsed()<<" seconds."<<std::endl;
631 std::cout<<"Communicating global aggregate numbers took "<<watch.elapsed()<<" seconds."<<std::endl;
656 productBuilder.calculate(matrix->getmat(), *aggregatesMap, *coarseMatrix, *infoLevel, OverlapFlags());
660 std::cout<<"Calculation entries of Galerkin product took "<<watch.elapsed()<<" seconds."<<std::endl;
684 std::cout<<"Level "<<level<<" has "<<dunknownsLevel<<" unknowns, "<<dunknownsLevel/infoLevel->communicator().size()
695 std::cerr<<"Successive accumulation of data on coarse levels only works with ParMETIS installed."
712 std::cout<<"Level "<<level<<" redistributed has "<<dunknownsRedist<<" unknowns, "<<dunknownsRedist/redistComm->communicator().size()
743 void MatrixHierarchy<M,IS,A>::getCoarsestAggregatesOnFinest(std::vector<std::size_t>& data) const
786 ibpair = used.insert(static_cast<std::size_t>((((double)rand())/(RAND_MAX+1.0))*coarse->size()));
852 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:117
const AggregatesMapList & aggregatesMaps() const
Get the hierarchy of the mappings of the nodes onto aggregates.
Definition matrixhierarchy.hh:812
bool isBuilt() const
Whether the hierarchy was built.
Definition matrixhierarchy.hh:953
std::size_t levels() const
Get the number of levels in the hierarchy.
Definition hierarchy.hh:320
std::size_t levels() const
Get the number of levels in the hierarchy.
Definition matrixhierarchy.hh:934
void addCoarser(Arguments &args)
Add an element on a coarser level.
Definition hierarchy.hh:332
const RedistributeInfoList & redistributeInformation() const
Get the hierarchy of the information about redistributions,.
Definition matrixhierarchy.hh:818
const ParallelInformationHierarchy & parallelInformation() const
Get the hierarchy of the parallel data distribution information.
Definition matrixhierarchy.hh:737
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:311
const ParallelMatrixHierarchy & matrices() const
Get the matrix hierarchy.
Definition matrixhierarchy.hh:730
std::size_t maxlevels() const
Get the max number of levels in the hierarchy of processors.
Definition matrixhierarchy.hh:940
static const V ISOLATED
Identifier of isolated vertices.
Definition aggregates.hh:569
void recalculateGalerkin(const F ©Flags)
Recalculate the galerkin products.
Definition matrixhierarchy.hh:898
const void * Arguments
A type holding all the arguments needed to call the constructor.
Definition construction.hh:42
static std::shared_ptr< T > construct(Arguments &args)
Construct an object with the specified arguments.
Definition construction.hh:50
void coarsenVector(Hierarchy< BlockVector< V, BA >, TA > &hierarchy) const
Coarsen the vector hierarchy according to the matrix hierarchy.
Definition matrixhierarchy.hh:841
const AggregateDescriptor * const_iterator
Definition aggregates.hh:721
MatrixHierarchy(std::shared_ptr< MatrixOperator > fineMatrix, std::shared_ptr< ParallelInformation > pinfo=std::make_shared< ParallelInformation >())
Constructor.
Definition matrixhierarchy.hh:387
AccumulationMode
Identifiers for the different accumulation modes.
Definition parameters.hh:230
Iterator finest()
Get an iterator positioned at the finest level.
Definition hierarchy.hh:375
void build(const T &criterion)
Build the matrix hierarchy using aggregation.
Definition matrixhierarchy.hh:398
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:868
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:743
@ MAX_PROCESSES
Hard limit for the number of processes allowed.
Definition matrixhierarchy.hh:48
@ atOnceAccu
Accumulate data to one process at once.
Definition parameters.hh:242
@ successiveAccu
Successively accumulate to fewer processes.
Definition parameters.hh:246
int size() const
iterator end()
static constexpr size_type M()
#define DUNE_THROW(E, m)
MPI_Comm communicator() const
DVVerbType dvverb
DVerbType dverb
DInfoType dinfo
void printGlobalSparseMatrix(const M &mat, C &ooc, std::ostream &os)
Definition matrixutils.hh:152
void redistributeMatrixEntries(M &origMatrix, M &newMatrix, C &origComm, C &newComm, RedistributeInformation< C > &ri)
Definition matrixredistribute.hh:755
Reference get(const RAPropertyMapHelper< Reference, PropertyMap > &pmap, const Key &key)
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:827
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:1233
MatrixImp::DenseMatrixBase< T, A >::window_type row_type
The type implementing a matrix row.
Definition matrix.hh:572
Definition matrixredistribute.hh:20
void reset() noexcept
double elapsed() const noexcept
Class providing information about the mapping of the vertices onto aggregates.
Definition aggregates.hh:558
Class representing the properties of an ede in the matrix graph.
Definition dependency.hh:37
Class representing a node in the matrix graph.
Definition dependency.hh:124
Definition galerkin.hh:97
Definition galerkin.hh:116
Definition globalaggregates.hh:129
Attaches properties to the edges and vertices of a graph.
Definition graph.hh:976
Graph::VertexDescriptor VertexDescriptor
The vertex descriptor.
Definition graph.hh:986
Definition graphcreator.hh:20
LevelIterator< Hierarchy< MatrixOperator, Allocator >, MatrixOperator > Iterator
Type of the mutable iterator.
Definition hierarchy.hh:214
LevelIterator< const Hierarchy< MatrixOperator, Allocator >, const MatrixOperator > ConstIterator
Type of the const iterator.
Definition hierarchy.hh:217
Definition indicescoarsener.hh:34
The hierarchies build by the coarsening process.
Definition matrixhierarchy.hh:59
typename std::allocator_traits< Allocator >::template rebind_alloc< AggregatesMap * > AAllocator
Allocator for pointers.
Definition matrixhierarchy.hh:83
Dune::Amg::Hierarchy< ParallelInformation, Allocator > ParallelInformationHierarchy
The type of the parallel informarion hierarchy.
Definition matrixhierarchy.hh:80
std::list< AggregatesMap *, AAllocator > AggregatesMapList
The type of the aggregates maps list.
Definition matrixhierarchy.hh:86
PI ParallelInformation
The type of the index set.
Definition matrixhierarchy.hh:68
Dune::Amg::Hierarchy< MatrixOperator, Allocator > ParallelMatrixHierarchy
The type of the parallel matrix hierarchy.
Definition matrixhierarchy.hh:77
A Allocator
The allocator to use.
Definition matrixhierarchy.hh:71
RedistributeInformation< ParallelInformation > RedistributeInfoType
The type of the redistribute information.
Definition matrixhierarchy.hh:89
double getProlongationDampingFactor() const
Definition matrixhierarchy.hh:186
typename std::allocator_traits< Allocator >::template rebind_alloc< RedistributeInfoType > RILAllocator
Allocator for RedistributeInfoType.
Definition matrixhierarchy.hh:92
std::list< RedistributeInfoType, RILAllocator > RedistributeInfoList
The type of the list of redistribute information.
Definition matrixhierarchy.hh:95
Dune::Amg::AggregatesMap< typename MatrixGraph< Matrix >::VertexDescriptor > AggregatesMap
The type of the aggregates map we use.
Definition matrixhierarchy.hh:74
MatrixOperator::matrix_type Matrix
The type of the matrix.
Definition matrixhierarchy.hh:65
M MatrixOperator
The type of the matrix operator.
Definition matrixhierarchy.hh:62
void operator()(const matrix_row &row)
Definition matrixhierarchy.hh:252
Matrix::row_type matrix_row
Definition matrixhierarchy.hh:243
size_type min
Definition matrixhierarchy.hh:259
calc()
Definition matrixhierarchy.hh:245
size_type max
Definition matrixhierarchy.hh:260
size_type sum
Definition matrixhierarchy.hh:261
Matrix::size_type size_type
Definition matrixhierarchy.hh:242
The criterion describing the stop criteria for the coarsening process.
Definition matrixhierarchy.hh:281
CoarsenCriterion(const Dune::Amg::Parameters &parms)
Definition matrixhierarchy.hh:304
T AggregationCriterion
The criterion for tagging connections as strong and nodes as isolated. This might be e....
Definition matrixhierarchy.hh:287
CoarsenCriterion(int maxLevel=100, int coarsenTarget=1000, double minCoarsenRate=1.2, double prolongDamp=1.6, AccumulationMode accumulate=successiveAccu)
Constructor.
Definition matrixhierarchy.hh:299
Definition pinfo.hh:26
Tag idnetifying the visited property of a vertex.
Definition properties.hh:27
The default class for the smoother arguments.
Definition smoother.hh:36
Definition transfer.hh:30
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:32
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)
T tie(T... args)
Legal Statements / Impressum | Hosted by TU Dresden & Uni Heidelberg | Generated by
1.9.8