5#ifndef DUNE_AMG_MATRIXHIERARCHY_HH
6#define DUNE_AMG_MATRIXHIERARCHY_HH
17#include <dune/common/parallel/indexset.hh>
59 template<
class M,
class PI,
class A=std::allocator<M> >
67 typedef typename MatrixOperator::matrix_type
Matrix;
85 using AAllocator =
typename std::allocator_traits<Allocator>::template rebind_alloc<AggregatesMap*>;
94 using RILAllocator =
typename std::allocator_traits<Allocator>::template rebind_alloc<RedistributeInfoType>;
105 std::shared_ptr<ParallelInformation> pinfo = std::make_shared<ParallelInformation>());
114 template<
typename O,
typename T>
115 void build(
const T& criterion);
131 template<
class V,
class BA,
class TA>
139 template<
class S,
class TA>
147 std::size_t
levels()
const;
228 template<
class Matrix,
bool pr
int>
235 static void stats([[maybe_unused]]
const Matrix& matrix)
239 template<
class Matrix>
240 struct MatrixStats<
Matrix,true>
249 min=std::numeric_limits<size_type>::max();
256 min=std::min(min, row.size());
257 max=std::max(max, row.size());
268 static void stats(
const Matrix& matrix)
270 calc c= for_each(matrix.begin(), matrix.end(),
calc());
271 dinfo<<
"Matrix row: min="<<c.
min<<
" max="<<c.
max
272 <<
" average="<<
static_cast<double>(c.
sum)/matrix.N()
315 template<
typename M,
typename C1>
317 [[maybe_unused]] std::shared_ptr<M> newMatrix,
319 [[maybe_unused]] std::shared_ptr<SequentialInformation>& newComm,
321 [[maybe_unused]]
int nparts,
322 [[maybe_unused]] C1& criterion)
324 DUNE_THROW(NotImplemented,
"Redistribution does not make sense in sequential code!");
328 template<
typename M,
typename C,
typename C1>
330 std::shared_ptr<M> newMatrix,
332 std::shared_ptr<C>& newComm,
334 int nparts, C1& criterion)
337#ifdef AMG_REPART_ON_COMM_GRAPH
341 criterion.debugLevel()>1);
355 if(origComm.communicator().rank()==0)
356 std::cout<<
"Original matrix"<<std::endl;
357 origComm.communicator().barrier();
361 newComm, ri.getInterface(),
362 criterion.debugLevel()>1);
365 if(origComm.communicator().rank()==0 && criterion.debugLevel()>1)
366 std::cout<<
"Repartitioning took "<<time.elapsed()<<
" seconds."<<std::endl;
371 ri.checkInterface(origComm.indexSet(), newComm->indexSet(), origComm.communicator());
377 if(origComm.communicator().rank()==0)
378 std::cout<<
"Original matrix"<<std::endl;
379 origComm.communicator().barrier();
380 if(newComm->communicator().size()>0)
382 origComm.communicator().barrier();
385 if(origComm.communicator().rank()==0 && criterion.debugLevel()>1)
386 std::cout<<
"Redistributing matrix took "<<time.elapsed()<<
" seconds."<<std::endl;
387 return existentOnRedist;
391 template<
class M,
class IS,
class A>
393 std::shared_ptr<ParallelInformation> pinfo)
394 : matrices_(fineMatrix),
395 parallelInformation_(pinfo)
398 DUNE_THROW(
ISTLError,
"MatrixOperator and ParallelInformation must belong to the same category!");
401 template<
class M,
class IS,
class A>
402 template<
typename O,
typename T>
405 prolongDamp_ = criterion.getProlongationDampingFactor();
406 typedef O OverlapFlags;
412 typedef bigunsignedint<
sizeof(int)*8*noints> BIGINT;
414 MatIterator mlevel = matrices_.finest();
415 MatrixStats<typename M::matrix_type,MINIMAL_DEBUG_LEVEL<=INFO_DEBUG_LEVEL>::stats(mlevel->getmat());
417 PInfoIterator infoLevel = parallelInformation_.finest();
419 finenonzeros = infoLevel->communicator().sum(finenonzeros);
420 BIGINT allnonzeros = finenonzeros;
426 BIGINT unknowns = mlevel->getmat().N();
428 unknowns = infoLevel->communicator().sum(unknowns);
429 double dunknowns=unknowns.todouble();
430 infoLevel->buildGlobalLookup(mlevel->getmat().N());
433 for(; level < criterion.maxLevel(); ++level, ++mlevel) {
434 assert(matrices_.levels()==redistributes_.size());
435 rank = infoLevel->communicator().rank();
436 if(rank==0 && criterion.debugLevel()>1)
437 std::cout<<
"Level "<<level<<
" has "<<dunknowns<<
" unknowns, "<<dunknowns/infoLevel->communicator().size()
438 <<
" unknowns per proc (procs="<<infoLevel->communicator().size()<<
")"<<std::endl;
450 && dunknowns < 30*infoLevel->communicator().size()))
451 && infoLevel->communicator().size()>1 &&
452 dunknowns/infoLevel->communicator().size() <= criterion.coarsenTarget())
455 std::shared_ptr<Matrix> redistMat = std::make_shared<Matrix>();
456 std::shared_ptr<ParallelInformation> redistComm;
457 std::size_t nodomains = (std::size_t)std::ceil(dunknowns/(criterion.minAggregateSize()
458 *criterion.coarsenTarget()));
459 if( nodomains<=criterion.minAggregateSize()/2 ||
460 dunknowns <= criterion.coarsenTarget() )
463 bool existentOnNextLevel =
465 redistComm, redistributes_.back(), nodomains,
467 BIGINT unknownsRedist = redistMat->N();
468 unknownsRedist = infoLevel->communicator().sum(unknownsRedist);
469 dunknowns= unknownsRedist.todouble();
470 if(redistComm->communicator().rank()==0 && criterion.debugLevel()>1)
471 std::cout<<
"Level "<<level<<
" (redistributed) has "<<dunknowns<<
" unknowns, "<<dunknowns/redistComm->communicator().size()
472 <<
" unknowns per proc (procs="<<redistComm->communicator().size()<<
")"<<std::endl;
473 MatrixArgs args(redistMat, *redistComm);
475 assert(mlevel.isRedistributed());
476 infoLevel.addRedistributed(redistComm);
477 infoLevel->freeGlobalLookup();
479 if(!existentOnNextLevel)
484 matrix = &(mlevel.getRedistributed());
485 info = &(infoLevel.getRedistributed());
486 info->buildGlobalLookup(matrix->getmat().N());
489 rank = info->communicator().rank();
490 if(dunknowns <= criterion.coarsenTarget())
496 typedef typename GraphCreator::GraphTuple GraphTuple;
500 std::vector<bool> excluded(matrix->getmat().N(),
false);
502 GraphTuple graphs = GraphCreator::create(*matrix, excluded, *info, OverlapFlags());
506 aggregatesMaps_.push_back(aggregatesMap);
510 auto [noAggregates, isoAggregates, oneAggregates, skippedAggregates] =
511 aggregatesMap->
buildAggregates(matrix->getmat(), *(std::get<1>(graphs)), criterion, level==0);
513 if(rank==0 && criterion.debugLevel()>2)
514 std::cout<<
" Have built "<<noAggregates<<
" aggregates totally ("<<isoAggregates<<
" isolated aggregates, "<<
515 oneAggregates<<
" aggregates of one vertex, and skipped "<<
516 skippedAggregates<<
" aggregates)."<<std::endl;
520 int start, end, overlapStart, overlapEnd;
521 int procs=info->communicator().rank();
522 int n = UNKNOWNS/procs;
523 int bigger = UNKNOWNS%procs;
528 end = (rank+1)*(n+1);
530 start = bigger + rank * n;
531 end = bigger + (rank + 1) * n;
536 overlapStart = start - 1;
538 overlapStart = start;
541 overlapEnd = end + 1;
545 assert((UNKNOWNS)*(overlapEnd-overlapStart)==aggregatesMap->
noVertices());
546 for(
int j=0; j< UNKNOWNS; ++j)
547 for(
int i=0; i < UNKNOWNS; ++i)
549 if(i>=overlapStart && i<overlapEnd)
551 int no = (j/2)*((UNKNOWNS)/2)+i/2;
552 (*aggregatesMap)[j*(overlapEnd-overlapStart)+i-overlapStart]=no;
557 if(criterion.debugLevel()>1 && info->communicator().rank()==0)
558 std::cout<<
"aggregating finished."<<std::endl;
560 BIGINT gnoAggregates=noAggregates;
561 gnoAggregates = info->communicator().sum(gnoAggregates);
562 double dgnoAggregates = gnoAggregates.todouble();
564 BIGINT gnoAggregates=((UNKNOWNS)/2)*((UNKNOWNS)/2);
567 if(criterion.debugLevel()>2 && rank==0)
568 std::cout <<
"Building "<<dgnoAggregates<<
" aggregates took "<<watch.elapsed()<<
" seconds."<<std::endl;
570 if(dgnoAggregates==0 || dunknowns/dgnoAggregates<criterion.minCoarsenRate())
575 std::cerr <<
"Stopped coarsening because of rate breakdown "<<dunknowns<<
"/"<<dgnoAggregates
576 <<
"="<<dunknowns/dgnoAggregates<<
"<"
577 <<criterion.minCoarsenRate()<<std::endl;
579 std::cerr<<
"Could not build any aggregates. Probably no connected nodes."<<std::endl;
581 aggregatesMap->
free();
582 delete aggregatesMap;
583 aggregatesMaps_.pop_back();
585 if(criterion.accumulate() && mlevel.isRedistributed() && info->communicator().size()>1) {
589 delete &(mlevel.getRedistributed().getmat());
590 mlevel.deleteRedistributed();
591 delete &(infoLevel.getRedistributed());
592 infoLevel.deleteRedistributed();
593 redistributes_.back().resetSetup();
598 unknowns = noAggregates;
599 dunknowns = dgnoAggregates;
601 CommunicationArgs commargs(info->communicator(),info->category());
602 parallelInformation_.addCoarser(commargs);
606 typename PropertyMapTypeSelector<VertexVisitedTag,PropertiesGraph>::Type visitedMap =
612 *(std::get<1>(graphs)),
617 criterion.useFixedOrder());
618 GraphCreator::free(graphs);
620 if(criterion.debugLevel()>2) {
622 std::cout<<
"Coarsening of index sets took "<<watch.elapsed()<<
" seconds."<<std::endl;
627 infoLevel->buildGlobalLookup(aggregates);
630 infoLevel->globalLookup());
633 if(criterion.debugLevel()>2) {
635 std::cout<<
"Communicating global aggregate numbers took "<<watch.elapsed()<<
" seconds."<<std::endl;
639 std::vector<bool>& visited=excluded;
641 typedef std::vector<bool>::iterator Iterator;
642 typedef IteratorPropertyMap<Iterator, IdentityMap> VisitedMap2;
643 Iterator end = visited.end();
644 for(Iterator iter= visited.begin(); iter != end; ++iter)
647 VisitedMap2 visitedMap2(visited.begin(), Dune::IdentityMap());
649 std::shared_ptr<typename MatrixOperator::matrix_type>
650 coarseMatrix(productBuilder.build(*(std::get<0>(graphs)), visitedMap2,
655 dverb<<
"Building of sparsity pattern took "<<watch.elapsed()<<std::endl;
657 info->freeGlobalLookup();
659 delete std::get<0>(graphs);
660 productBuilder.calculate(matrix->getmat(), *aggregatesMap, *coarseMatrix, *infoLevel, OverlapFlags());
662 if(criterion.debugLevel()>2) {
664 std::cout<<
"Calculation entries of Galerkin product took "<<watch.elapsed()<<
" seconds."<<std::endl;
668 allnonzeros = allnonzeros + infoLevel->communicator().sum(nonzeros);
669 MatrixArgs args(coarseMatrix, *infoLevel);
671 matrices_.addCoarser(args);
676 infoLevel->freeGlobalLookup();
680 aggregatesMaps_.push_back(aggregatesMap);
682 if(criterion.debugLevel()>0) {
683 if(level==criterion.maxLevel()) {
684 BIGINT unknownsLevel = mlevel->getmat().N();
685 unknownsLevel = infoLevel->communicator().sum(unknownsLevel);
686 if(rank==0 && criterion.debugLevel()>1) {
687 double dunknownsLevel = unknownsLevel.todouble();
688 std::cout<<
"Level "<<level<<
" has "<<dunknownsLevel<<
" unknowns, "<<dunknownsLevel/infoLevel->communicator().size()
689 <<
" unknowns per proc (procs="<<infoLevel->communicator().size()<<
")"<<std::endl;
694 if(criterion.accumulate() && !redistributes_.back().isSetup() &&
695 infoLevel->communicator().size()>1) {
696#if HAVE_MPI && !HAVE_PARMETIS
698 infoLevel->communicator().rank()==0)
699 std::cerr<<
"Successive accumulation of data on coarse levels only works with ParMETIS installed."
700 <<
" Fell back to accumulation to one domain on coarsest level"<<std::endl;
704 std::shared_ptr<Matrix> redistMat = std::make_shared<Matrix>();
705 std::shared_ptr<ParallelInformation> redistComm;
709 redistComm, redistributes_.back(), nodomains,criterion);
710 MatrixArgs args(redistMat, *redistComm);
711 BIGINT unknownsRedist = redistMat->N();
712 unknownsRedist = infoLevel->communicator().sum(unknownsRedist);
714 if(redistComm->communicator().rank()==0 && criterion.debugLevel()>1) {
715 double dunknownsRedist = unknownsRedist.todouble();
716 std::cout<<
"Level "<<level<<
" redistributed has "<<dunknownsRedist<<
" unknowns, "<<dunknownsRedist/redistComm->communicator().size()
717 <<
" unknowns per proc (procs="<<redistComm->communicator().size()<<
")"<<std::endl;
720 infoLevel.addRedistributed(redistComm);
721 infoLevel->freeGlobalLookup();
724 int levels = matrices_.levels();
725 maxlevels_ = parallelInformation_.finest()->communicator().max(levels);
726 assert(matrices_.levels()==redistributes_.size());
727 if(hasCoarsest() && rank==0 && criterion.debugLevel()>1)
728 std::cout<<
"operator complexity: "<<allnonzeros.todouble()/finenonzeros.todouble()<<std::endl;
732 template<
class M,
class IS,
class A>
739 template<
class M,
class IS,
class A>
743 return parallelInformation_;
746 template<
class M,
class IS,
class A>
749 int levels=aggregatesMaps().size();
750 int maxlevels=parallelInformation_.
finest()->communicator().max(levels);
751 std::size_t size=(*(aggregatesMaps().begin()))->noVertices();
753 std::vector<std::size_t> tmp;
754 std::vector<std::size_t> *coarse, *fine;
771 if(levels==maxlevels) {
772 const AggregatesMap& map = *(*(++aggregatesMaps().rbegin()));
781 srand((
unsigned)std::clock());
782 std::set<size_t> used;
783 for(
typename std::vector<std::size_t>::iterator iter=coarse->begin(); iter != coarse->end();
786 std::pair<std::set<std::size_t>::iterator,
bool> ibpair
787 = used.insert(
static_cast<std::size_t
>((((
double)rand())/(RAND_MAX+1.0)))*coarse->size());
789 while(!ibpair.second)
790 ibpair = used.insert(
static_cast<std::size_t
>((((
double)rand())/(RAND_MAX+1.0))*coarse->size()));
791 *iter=*(ibpair.first);
799 for(
typename AggregatesMapList::const_reverse_iterator aggregates=++aggregatesMaps().rbegin();
800 aggregates != aggregatesMaps().rend(); ++aggregates,--levels) {
802 fine->resize((*aggregates)->noVertices());
803 fine->assign(fine->size(), 0);
805 ::prolongateVector(*(*aggregates), *coarse, *fine,
static_cast<std::size_t
>(1), *pinfo);
807 std::swap(coarse, fine);
811 assert(coarse==&data);
814 template<
class M,
class IS,
class A>
818 return aggregatesMaps_;
820 template<
class M,
class IS,
class A>
824 return redistributes_;
827 template<
class M,
class IS,
class A>
830 typedef typename AggregatesMapList::reverse_iterator AggregatesMapIterator;
834 AggregatesMapIterator amap = aggregatesMaps_.rbegin();
835 InfoIterator info = parallelInformation_.coarsest();
836 for(Iterator level=matrices_.coarsest(), finest=matrices_.finest(); level != finest; --level, --info, ++amap) {
843 template<
class M,
class IS,
class A>
844 template<
class V,
class BA,
class TA>
847 assert(hierarchy.levels()==1);
849 typedef typename RedistributeInfoList::const_iterator RIter;
850 RIter redist = redistributes_.begin();
852 Iterator matrix = matrices_.finest(), coarsest = matrices_.coarsest();
854 if(redist->isSetup())
855 hierarchy.addRedistributedOnCoarsest(matrix.getRedistributed().getmat().N());
856 Dune::dvverb<<
"Level "<<level<<
" has "<<matrices_.finest()->getmat().N()<<
" unknowns!"<<std::endl;
858 while(matrix != coarsest) {
859 ++matrix; ++level; ++redist;
860 Dune::dvverb<<
"Level "<<level<<
" has "<<matrix->getmat().N()<<
" unknowns!"<<std::endl;
862 hierarchy.addCoarser(matrix->getmat().N());
863 if(redist->isSetup())
864 hierarchy.addRedistributedOnCoarsest(matrix.getRedistributed().getmat().N());
870 template<
class M,
class IS,
class A>
871 template<
class S,
class TA>
875 assert(smoothers.
levels()==0);
878 typedef typename AggregatesMapList::const_iterator AggregatesIterator;
881 cargs.setArgs(sargs);
882 PinfoIterator pinfo = parallelInformation_.finest();
883 AggregatesIterator aggregates = aggregatesMaps_.begin();
885 for(MatrixIterator matrix = matrices_.finest(), coarsest = matrices_.coarsest();
886 matrix != coarsest; ++matrix, ++pinfo, ++aggregates, ++level) {
887 cargs.setMatrix(matrix->getmat(), **aggregates);
888 cargs.setComm(*pinfo);
891 if(maxlevels()>levels()) {
893 cargs.setMatrix(matrices_.coarsest()->getmat(), **aggregates);
894 cargs.setComm(*pinfo);
900 template<
class M,
class IS,
class A>
904 typedef typename AggregatesMapList::iterator AggregatesMapIterator;
908 AggregatesMapIterator amap = aggregatesMaps_.begin();
910 InfoIterator info = parallelInformation_.finest();
911 typename RedistributeInfoList::iterator riIter = redistributes_.begin();
912 Iterator level = matrices_.finest(), coarsest=matrices_.coarsest();
913 if(level.isRedistributed()) {
914 info->buildGlobalLookup(level->getmat().N());
916 const_cast<Matrix&
>(level.getRedistributed().getmat()),
917 *info,info.getRedistributed(), *riIter);
918 info->freeGlobalLookup();
921 for(; level!=coarsest; ++amap) {
922 const Matrix& fine = (level.isRedistributed() ? level.getRedistributed() : *level).getmat();
926 productBuilder.
calculate(fine, *(*amap),
const_cast<Matrix&
>(level->getmat()), *info, copyFlags);
927 if(level.isRedistributed()) {
928 info->buildGlobalLookup(level->getmat().N());
930 const_cast<Matrix&
>(level.getRedistributed().getmat()), *info,
931 info.getRedistributed(), *riIter);
932 info->freeGlobalLookup();
937 template<
class M,
class IS,
class A>
940 return matrices_.levels();
943 template<
class M,
class IS,
class A>
949 template<
class M,
class IS,
class A>
952 return levels()==maxlevels() &&
953 (!matrices_.coarsest().isRedistributed() ||matrices_.coarsest()->getmat().N()>0);
956 template<
class M,
class IS,
class A>
Functionality for redistributing a sparse matrix.
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...
Provides a class for building the galerkin product based on a aggregation scheme.
Provides a class for building the index set and remote indices on the coarse level.
Helper classes for the construction of classes without empty constructor.
Prolongation and restriction for amg.
Provides classes for building the matrix graph.
Classes for the generic construction and application of the smoothers.
Provdes class for identifying aggregates globally.
Provides a classes representing the hierarchies in AMG.
Provides classes for initializing the link attributes of a matrix graph.
Provides classes for the Coloring process of AMG.
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
bool hasCoarsest() const
Definition matrixhierarchy.hh:950
std::size_t levels() const
Get the number of levels in the hierarchy.
Definition hierarchy.hh:322
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:334
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_iterator begin() const
Definition aggregates.hh:725
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
const_iterator end() const
Definition aggregates.hh:730
const void * Arguments
A type holding all the arguments needed to call the constructor.
Definition construction.hh:44
static const V ISOLATED
Identifier of isolated vertices.
Definition aggregates.hh:571
void recalculateGalerkin(const F ©Flags)
Recalculate the galerkin products.
Definition matrixhierarchy.hh:902
std::size_t noVertices() const
Get the number of vertices.
const AggregateDescriptor * const_iterator
Definition aggregates.hh:723
void coarsenVector(Hierarchy< BlockVector< V, BA >, TA > &hierarchy) const
Coarsen the vector hierarchy according to the matrix hierarchy.
Definition matrixhierarchy.hh:845
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:377
void build(const T &criterion)
Build the matrix hierarchy using aggregation.
Definition matrixhierarchy.hh:403
void free()
Free the allocated memory.
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
~MatrixHierarchy()
Definition matrixhierarchy.hh:828
@ 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
Definition allocator.hh:11
void printGlobalSparseMatrix(const M &mat, C &ooc, std::ostream &os)
Definition matrixutils.hh:154
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:293
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:820
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
A vector of blocks with memory management.
Definition bvector.hh:392
derive error class from the base class in common
Definition istlexception.hh:19
A generic dynamic dense matrix.
Definition matrixutils.hh:30
MatrixImp::DenseMatrixBase< T, A >::window_type row_type
The type implementing a matrix row.
Definition matrix.hh:574
A::size_type size_type
Type for indices and sizes.
Definition matrix.hh:577
Definition matrixredistribute.hh:22
Traits class for generically constructing non default constructable types.
Definition schwarz.hh:251
Class providing information about the mapping of the vertices onto aggregates.
Definition aggregates.hh:560
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
The (undirected) graph of a matrix.
Definition graph.hh:51
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
A hierarchy of containers (e.g. matrices or vectors)
Definition hierarchy.hh:40
LevelIterator< Hierarchy< MatrixOperator, Allocator >, MatrixOperator > Iterator
Definition hierarchy.hh:216
LevelIterator< const Hierarchy< MatrixOperator, Allocator >, const MatrixOperator > ConstIterator
Definition hierarchy.hh:219
Definition indicescoarsener.hh:36
The hierarchies build by the coarsening process.
Definition matrixhierarchy.hh:61
A Allocator
The allocator to use.
Definition matrixhierarchy.hh:73
Dune::Amg::AggregatesMap< typename MatrixGraph< Matrix >::VertexDescriptor > AggregatesMap
The type of the aggregates map we use.
Definition matrixhierarchy.hh:76
std::list< RedistributeInfoType, RILAllocator > RedistributeInfoList
The type of the list of redistribute information.
Definition matrixhierarchy.hh:97
typename std::allocator_traits< Allocator >::template rebind_alloc< AggregatesMap * > AAllocator
Allocator for pointers.
Definition matrixhierarchy.hh:85
std::list< AggregatesMap *, AAllocator > AggregatesMapList
The type of the aggregates maps list.
Definition matrixhierarchy.hh:88
M MatrixOperator
The type of the matrix operator.
Definition matrixhierarchy.hh:64
RedistributeInformation< ParallelInformation > RedistributeInfoType
The type of the redistribute information.
Definition matrixhierarchy.hh:91
MatrixOperator::matrix_type Matrix
The type of the matrix.
Definition matrixhierarchy.hh:67
double getProlongationDampingFactor() const
Definition matrixhierarchy.hh:188
typename std::allocator_traits< Allocator >::template rebind_alloc< RedistributeInfoType > RILAllocator
Allocator for RedistributeInfoType.
Definition matrixhierarchy.hh:94
Dune::Amg::Hierarchy< ParallelInformation, Allocator > ParallelInformationHierarchy
The type of the parallel informarion hierarchy.
Definition matrixhierarchy.hh:82
Dune::Amg::Hierarchy< MatrixOperator, Allocator > ParallelMatrixHierarchy
The type of the parallel matrix hierarchy.
Definition matrixhierarchy.hh:79
PI ParallelInformation
The type of the index set.
Definition matrixhierarchy.hh:70
Definition matrixhierarchy.hh:243
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
Matrix::size_type size_type
Definition matrixhierarchy.hh:244
calc()
Definition matrixhierarchy.hh:247
size_type max
Definition matrixhierarchy.hh:262
size_type sum
Definition matrixhierarchy.hh:263
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
All parameters for AMG.
Definition parameters.hh:416
Tag idnetifying the visited property of a vertex.
Definition properties.hh:29
The default class for the smoother arguments.
Definition smoother.hh:38
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