Loading...
Searching...
No Matches
smoother.hh
Go to the documentation of this file.
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_AMGSMOOTHER_HH
#define DUNE_AMGSMOOTHER_HH
#include <dune/istl/paamg/construction.hh>
#include <dune/istl/paamg/aggregates.hh>
#include <dune/istl/preconditioners.hh>
#include <dune/istl/schwarz.hh>
#include <dune/istl/novlpschwarz.hh>
#include <dune/common/propertymap.hh>
#include <dune/common/ftraits.hh>
namespace Dune
{
namespace Amg
{
template<class T>
struct DefaultSmootherArgs
{
typedef typename FieldTraits<T>::real_type RelaxationFactor;
int iterations;
RelaxationFactor relaxationFactor;
DefaultSmootherArgs()
: iterations(1), relaxationFactor(1.0)
{}
};
template<class T>
struct SmootherTraits
{
typedef DefaultSmootherArgs<typename T::matrix_type::field_type> Arguments;
};
template<class X, class Y>
struct SmootherTraits<Richardson<X,Y>>
{
typedef DefaultSmootherArgs<typename X::field_type> Arguments;
};
template<class X, class Y, class C, class T>
struct SmootherTraits<BlockPreconditioner<X,Y,C,T> >
: public SmootherTraits<T>
{};
template<class C, class T>
struct SmootherTraits<NonoverlappingBlockPreconditioner<C,T> >
: public SmootherTraits<T>
{};
template<class T>
class DefaultConstructionArgs
{
typedef typename T::matrix_type Matrix;
typedef typename SmootherTraits<T>::Arguments SmootherArgs;
typedef Dune::Amg::AggregatesMap<typename MatrixGraph<Matrix>::VertexDescriptor> AggregatesMap;
public:
virtual ~DefaultConstructionArgs()
{}
void setMatrix(const Matrix& matrix)
{
matrix_=&matrix;
}
virtual void setMatrix(const Matrix& matrix, [[maybe_unused]] const AggregatesMap& amap)
{
setMatrix(matrix);
}
const Matrix& getMatrix() const
{
return *matrix_;
}
void setArgs(const SmootherArgs& args)
{
args_=&args;
}
template<class T1>
void setComm([[maybe_unused]] T1& comm)
{}
const SequentialInformation& getComm()
{
return comm_;
}
const SmootherArgs getArgs() const
{
return *args_;
}
protected:
const Matrix* matrix_;
private:
const SmootherArgs* args_;
SequentialInformation comm_;
};
template<class T>
struct ConstructionArgs
: public DefaultConstructionArgs<T>
{};
template<class T, class C=SequentialInformation>
class DefaultParallelConstructionArgs
: public ConstructionArgs<T>
{
public:
virtual ~DefaultParallelConstructionArgs()
{}
void setComm(const C& comm)
{
comm_ = &comm;
}
const C& getComm() const
{
return *comm_;
}
private:
const C* comm_;
};
template<class X, class Y>
class DefaultConstructionArgs<Richardson<X,Y>>
{
typedef Richardson<X,Y> T;
typedef typename SmootherTraits<T>::Arguments SmootherArgs;
public:
virtual ~DefaultConstructionArgs()
{}
template <class... Args>
void setMatrix(const Args&...)
{}
void setArgs(const SmootherArgs& args)
{
args_=&args;
}
template<class T1>
void setComm([[maybe_unused]] T1& comm)
{}
const SequentialInformation& getComm()
{
return comm_;
}
const SmootherArgs getArgs() const
{
return *args_;
}
private:
const SmootherArgs* args_;
SequentialInformation comm_;
};
template<class T>
struct ConstructionTraits;
template<class M, class X, class Y, int l>
struct ConstructionTraits<SeqSSOR<M,X,Y,l> >
{
typedef DefaultConstructionArgs<SeqSSOR<M,X,Y,l> > Arguments;
static inline std::shared_ptr<SeqSSOR<M,X,Y,l>> construct(Arguments& args)
{
return std::make_shared<SeqSSOR<M,X,Y,l>>
(args.getMatrix(), args.getArgs().iterations, args.getArgs().relaxationFactor);
}
};
template<class M, class X, class Y, int l>
struct ConstructionTraits<SeqSOR<M,X,Y,l> >
{
typedef DefaultConstructionArgs<SeqSOR<M,X,Y,l> > Arguments;
static inline std::shared_ptr<SeqSOR<M,X,Y,l>> construct(Arguments& args)
{
return std::make_shared<SeqSOR<M,X,Y,l>>
(args.getMatrix(), args.getArgs().iterations, args.getArgs().relaxationFactor);
}
};
template<class M, class X, class Y, int l>
struct ConstructionTraits<SeqJac<M,X,Y,l> >
{
typedef DefaultConstructionArgs<SeqJac<M,X,Y,l> > Arguments;
static inline std::shared_ptr<SeqJac<M,X,Y,l>> construct(Arguments& args)
{
return std::make_shared<SeqJac<M,X,Y,l>>
(args.getMatrix(), args.getArgs().iterations, args.getArgs().relaxationFactor);
}
};
template<class X, class Y>
struct ConstructionTraits<Richardson<X,Y> >
{
typedef DefaultConstructionArgs<Richardson<X,Y> > Arguments;
static inline std::shared_ptr<Richardson<X,Y>> construct(Arguments& args)
{
return std::make_shared<Richardson<X,Y>>
(args.getArgs().relaxationFactor);
}
};
template<class M, class X, class Y>
class ConstructionArgs<SeqILU<M,X,Y> >
: public DefaultConstructionArgs<SeqILU<M,X,Y> >
{
public:
ConstructionArgs(int n=0)
: n_(n)
{}
void setN(int n)
{
n_ = n;
}
int getN()
{
return n_;
}
private:
int n_;
};
template<class M, class X, class Y>
struct ConstructionTraits<SeqILU<M,X,Y> >
{
typedef ConstructionArgs<SeqILU<M,X,Y> > Arguments;
static inline std::shared_ptr<SeqILU<M,X,Y>> construct(Arguments& args)
{
return std::make_shared<SeqILU<M,X,Y>>
(args.getMatrix(), args.getN(), args.getArgs().relaxationFactor);
}
};
template<class M, class X, class Y, class C>
struct ConstructionTraits<ParSSOR<M,X,Y,C> >
{
typedef DefaultParallelConstructionArgs<M,C> Arguments;
static inline std::shared_ptr<ParSSOR<M,X,Y,C>> construct(Arguments& args)
{
return std::make_shared<ParSSOR<M,X,Y,C>>
(args.getMatrix(), args.getArgs().iterations,
args.getArgs().relaxationFactor, args.getComm());
}
};
template<class X, class Y, class C, class T>
struct ConstructionTraits<BlockPreconditioner<X,Y,C,T> >
{
typedef DefaultParallelConstructionArgs<T,C> Arguments;
typedef ConstructionTraits<T> SeqConstructionTraits;
static inline std::shared_ptr<BlockPreconditioner<X,Y,C,T>> construct(Arguments& args)
{
auto seqPrec = SeqConstructionTraits::construct(args);
return std::make_shared<BlockPreconditioner<X,Y,C,T>> (seqPrec, args.getComm());
}
};
template<class C, class T>
struct ConstructionTraits<NonoverlappingBlockPreconditioner<C,T> >
{
typedef DefaultParallelConstructionArgs<T,C> Arguments;
typedef ConstructionTraits<T> SeqConstructionTraits;
static inline std::shared_ptr<NonoverlappingBlockPreconditioner<C,T>> construct(Arguments& args)
{
auto seqPrec = SeqConstructionTraits::construct(args);
return std::make_shared<NonoverlappingBlockPreconditioner<C,T>> (seqPrec, args.getComm());
}
};
template<class T>
struct SmootherApplier
{
typedef T Smoother;
typedef typename Smoother::range_type Range;
typedef typename Smoother::domain_type Domain;
static void preSmooth(Smoother& smoother, Domain& v, const Range& d)
{
smoother.apply(v,d);
}
static void postSmooth(Smoother& smoother, Domain& v, const Range& d)
{
smoother.apply(v,d);
}
};
template<typename LevelContext>
void presmooth(LevelContext& levelContext, size_t steps)
{
for(std::size_t i=0; i < steps; ++i) {
*levelContext.lhs=0;
SmootherApplier<typename LevelContext::SmootherType>
::preSmooth(*levelContext.smoother, *levelContext.lhs,
*levelContext.rhs);
// Accumulate update
*levelContext.update += *levelContext.lhs;
// update defect
levelContext.matrix->applyscaleadd(-1, *levelContext.lhs, *levelContext.rhs);
levelContext.pinfo->project(*levelContext.rhs);
}
}
template<typename LevelContext>
void postsmooth(LevelContext& levelContext, size_t steps)
{
for(std::size_t i=0; i < steps; ++i) {
// update defect
levelContext.matrix->applyscaleadd(-1, *levelContext.lhs,
*levelContext.rhs);
*levelContext.lhs=0;
levelContext.pinfo->project(*levelContext.rhs);
SmootherApplier<typename LevelContext::SmootherType>
::postSmooth(*levelContext.smoother, *levelContext.lhs, *levelContext.rhs);
// Accumulate update
*levelContext.update += *levelContext.lhs;
}
}
template<class M, class X, class Y, int l>
struct SmootherApplier<SeqSOR<M,X,Y,l> >
{
typedef SeqSOR<M,X,Y,l> Smoother;
typedef typename Smoother::range_type Range;
typedef typename Smoother::domain_type Domain;
static void preSmooth(Smoother& smoother, Domain& v, Range& d)
{
smoother.template apply<true>(v,d);
}
static void postSmooth(Smoother& smoother, Domain& v, Range& d)
{
smoother.template apply<false>(v,d);
}
};
template<class M, class X, class Y, class C, int l>
struct SmootherApplier<BlockPreconditioner<X,Y,C,SeqSOR<M,X,Y,l> > >
{
typedef BlockPreconditioner<X,Y,C,SeqSOR<M,X,Y,l> > Smoother;
typedef typename Smoother::range_type Range;
typedef typename Smoother::domain_type Domain;
static void preSmooth(Smoother& smoother, Domain& v, Range& d)
{
smoother.template apply<true>(v,d);
}
static void postSmooth(Smoother& smoother, Domain& v, Range& d)
{
smoother.template apply<false>(v,d);
}
};
template<class M, class X, class Y, class C, int l>
struct SmootherApplier<NonoverlappingBlockPreconditioner<C,SeqSOR<M,X,Y,l> > >
{
typedef NonoverlappingBlockPreconditioner<C,SeqSOR<M,X,Y,l> > Smoother;
typedef typename Smoother::range_type Range;
typedef typename Smoother::domain_type Domain;
static void preSmooth(Smoother& smoother, Domain& v, Range& d)
{
smoother.template apply<true>(v,d);
}
static void postSmooth(Smoother& smoother, Domain& v, Range& d)
{
smoother.template apply<false>(v,d);
}
};
} // end namespace Amg
// forward declarations
template<class M, class X, class MO, class MS, class A>
class SeqOverlappingSchwarz;
struct MultiplicativeSchwarzMode;
namespace Amg
{
template<class M, class X, class MS, class TA>
struct SmootherApplier<SeqOverlappingSchwarz<M,X,MultiplicativeSchwarzMode,
MS,TA> >
{
typedef SeqOverlappingSchwarz<M,X,MultiplicativeSchwarzMode,MS,TA> Smoother;
typedef typename Smoother::range_type Range;
typedef typename Smoother::domain_type Domain;
static void preSmooth(Smoother& smoother, Domain& v, const Range& d)
{
smoother.template apply<true>(v,d);
}
static void postSmooth(Smoother& smoother, Domain& v, const Range& d)
{
smoother.template apply<false>(v,d);
}
};
// template<class M, class X, class TM, class TA>
// class SeqOverlappingSchwarz;
template<class T>
struct SeqOverlappingSchwarzSmootherArgs
: public DefaultSmootherArgs<T>
{
enum Overlap {vertex, aggregate, pairwise, none};
Overlap overlap;
bool onthefly;
SeqOverlappingSchwarzSmootherArgs(Overlap overlap_=vertex,
bool onthefly_=false)
: overlap(overlap_), onthefly(onthefly_)
{}
};
template<class M, class X, class TM, class TS, class TA>
struct SmootherTraits<SeqOverlappingSchwarz<M,X,TM,TS,TA> >
{
typedef SeqOverlappingSchwarzSmootherArgs<typename M::field_type> Arguments;
};
template<class M, class X, class TM, class TS, class TA>
class ConstructionArgs<SeqOverlappingSchwarz<M,X,TM,TS,TA> >
: public DefaultConstructionArgs<SeqOverlappingSchwarz<M,X,TM,TS,TA> >
{
typedef DefaultConstructionArgs<SeqOverlappingSchwarz<M,X,TM,TS,TA> > Father;
public:
typedef typename MatrixGraph<M>::VertexDescriptor VertexDescriptor;
typedef Dune::Amg::AggregatesMap<VertexDescriptor> AggregatesMap;
typedef typename AggregatesMap::AggregateDescriptor AggregateDescriptor;
typedef typename SeqOverlappingSchwarz<M,X,TM,TS,TA>::subdomain_vector Vector;
typedef typename Vector::value_type Subdomain;
virtual void setMatrix(const M& matrix, const AggregatesMap& amap)
{
Father::setMatrix(matrix);
std::vector<bool> visited(amap.noVertices(), false);
typedef IteratorPropertyMap<std::vector<bool>::iterator,IdentityMap> VisitedMapType;
VisitedMapType visitedMap(visited.begin());
MatrixGraph<const M> graph(matrix);
typedef SeqOverlappingSchwarzSmootherArgs<typename M::field_type> SmootherArgs;
switch(Father::getArgs().overlap) {
case SmootherArgs::vertex :
{
VertexAdder visitor(subdomains, amap);
createSubdomains(matrix, graph, amap, visitor, visitedMap);
}
break;
case SmootherArgs::pairwise :
{
createPairDomains(graph);
}
break;
case SmootherArgs::aggregate :
{
AggregateAdder<VisitedMapType> visitor(subdomains, amap, graph, visitedMap);
createSubdomains(matrix, graph, amap, visitor, visitedMap);
}
break;
case SmootherArgs::none :
NoneAdder visitor;
createSubdomains(matrix, graph, amap, visitor, visitedMap);
break;
default :
DUNE_THROW(NotImplemented, "This overlapping scheme is not supported!");
}
}
void setMatrix(const M& matrix)
{
Father::setMatrix(matrix);
/* Create aggregates map where each aggregate is just one vertex. */
AggregatesMap amap(matrix.N());
VertexDescriptor v=0;
for(typename AggregatesMap::iterator iter=amap.begin();
iter!=amap.end(); ++iter)
*iter=v++;
std::vector<bool> visited(amap.noVertices(), false);
typedef IteratorPropertyMap<std::vector<bool>::iterator,IdentityMap> VisitedMapType;
VisitedMapType visitedMap(visited.begin());
MatrixGraph<const M> graph(matrix);
typedef SeqOverlappingSchwarzSmootherArgs<typename M::field_type> SmootherArgs;
switch(Father::getArgs().overlap) {
case SmootherArgs::vertex :
{
VertexAdder visitor(subdomains, amap);
createSubdomains(matrix, graph, amap, visitor, visitedMap);
}
break;
case SmootherArgs::aggregate :
{
DUNE_THROW(NotImplemented, "Aggregate overlap is not supported yet");
/*
AggregateAdder<VisitedMapType> visitor(subdomains, amap, graph, visitedMap);
createSubdomains(matrix, graph, amap, visitor, visitedMap);
*/
}
break;
case SmootherArgs::pairwise :
{
createPairDomains(graph);
}
break;
case SmootherArgs::none :
NoneAdder visitor;
createSubdomains(matrix, graph, amap, visitor, visitedMap);
}
}
const Vector& getSubDomains()
{
return subdomains;
}
private:
struct VertexAdder
{
VertexAdder(Vector& subdomains_, const AggregatesMap& aggregates_)
: subdomains(subdomains_), max(-1), subdomain(-1), aggregates(aggregates_)
{}
template<class T>
void operator()(const T& edge)
{
if(aggregates[edge.target()]!=AggregatesMap::ISOLATED)
subdomains[subdomain].insert(edge.target());
}
int setAggregate(const AggregateDescriptor& aggregate_)
{
subdomain=aggregate_;
max = std::max(subdomain, aggregate_);
return subdomain;
}
int noSubdomains() const
{
return max+1;
}
private:
Vector& subdomains;
AggregateDescriptor max;
AggregateDescriptor subdomain;
const AggregatesMap& aggregates;
};
struct NoneAdder
{
template<class T>
void operator()(const T& /*edge*/)
{}
int setAggregate(const AggregateDescriptor& /*aggregate_*/)
{
return -1;
}
int noSubdomains() const
{
return -1;
}
};
template<class VM>
struct AggregateAdder
{
AggregateAdder(Vector& subdomains_, const AggregatesMap& aggregates_,
const MatrixGraph<const M>& graph_, VM& visitedMap_)
: subdomains(subdomains_), subdomain(-1), aggregates(aggregates_),
adder(subdomains_, aggregates_), graph(graph_), visitedMap(visitedMap_)
{}
template<class T>
void operator()(const T& edge)
{
subdomains[subdomain].insert(edge.target());
// If we (the neighbouring vertex of the aggregate)
// are not isolated, add the aggregate we belong to
// to the same subdomain using the OneOverlapAdder
if(aggregates[edge.target()]!=AggregatesMap::ISOLATED) {
assert(aggregates[edge.target()]!=aggregate);
typename AggregatesMap::VertexList vlist;
aggregates.template breadthFirstSearch<true,false>(edge.target(), aggregate,
graph, vlist, adder, adder,
visitedMap);
}
}
int setAggregate(const AggregateDescriptor& aggregate_)
{
adder.setAggregate(aggregate_);
aggregate=aggregate_;
return ++subdomain;
}
int noSubdomains() const
{
return subdomain+1;
}
private:
AggregateDescriptor aggregate;
Vector& subdomains;
int subdomain;
const AggregatesMap& aggregates;
VertexAdder adder;
const MatrixGraph<const M>& graph;
VM& visitedMap;
};
void createPairDomains(const MatrixGraph<const M>& graph)
{
typedef typename MatrixGraph<const M>::ConstVertexIterator VIter;
typedef typename MatrixGraph<const M>::ConstEdgeIterator EIter;
typedef typename M::size_type size_type;
std::set<std::pair<size_type,size_type> > pairs;
int total=0;
for(VIter v=graph.begin(), ve=graph.end(); ve != v; ++v)
for(EIter e = v.begin(), ee=v.end(); ee!=e; ++e)
{
++total;
if(e.source()<e.target())
pairs.insert(std::make_pair(e.source(),e.target()));
else
pairs.insert(std::make_pair(e.target(),e.source()));
}
subdomains.resize(pairs.size());
Dune::dinfo <<std::endl<< "Created "<<pairs.size()<<" ("<<total<<") pair domains"<<std::endl<<std::endl;
typedef typename std::set<std::pair<size_type,size_type> >::const_iterator SIter;
typename Vector::iterator subdomain=subdomains.begin();
for(SIter s=pairs.begin(), se =pairs.end(); se!=s; ++s)
{
subdomain->insert(s->first);
subdomain->insert(s->second);
++subdomain;
}
std::size_t minsize=10000;
std::size_t maxsize=0;
int sum=0;
for(typename Vector::size_type i=0; i < subdomains.size(); ++i) {
sum+=subdomains[i].size();
minsize=std::min(minsize, subdomains[i].size());
maxsize=std::max(maxsize, subdomains[i].size());
}
Dune::dinfo<<"Subdomain size: min="<<minsize<<" max="<<maxsize<<" avg="<<(sum/subdomains.size())
<<" no="<<subdomains.size()<<std::endl;
}
template<class Visitor>
void createSubdomains(const M& /*matrix*/, const MatrixGraph<const M>& graph,
const AggregatesMap& amap, Visitor& overlapVisitor,
IteratorPropertyMap<std::vector<bool>::iterator,IdentityMap>& visitedMap )
{
// count number ag aggregates. We assume that the
// aggregates are numbered consecutively from 0 except
// for the isolated ones. All isolated vertices form
// one aggregate, here.
int isolated=0;
AggregateDescriptor maxAggregate=0;
for(std::size_t i=0; i < amap.noVertices(); ++i)
if(amap[i]==AggregatesMap::ISOLATED)
isolated++;
else
maxAggregate = std::max(maxAggregate, amap[i]);
subdomains.resize(maxAggregate+1+isolated);
// reset the subdomains
for(typename Vector::size_type i=0; i < subdomains.size(); ++i)
subdomains[i].clear();
// Create the subdomains from the aggregates mapping.
// For each aggregate we mark all entries and the
// neighbouring vertices as belonging to the same subdomain
VertexAdder aggregateVisitor(subdomains, amap);
for(VertexDescriptor i=0; i < amap.noVertices(); ++i)
if(!get(visitedMap, i)) {
AggregateDescriptor aggregate=amap[i];
if(amap[i]==AggregatesMap::ISOLATED) {
// isolated vertex gets its own aggregate
subdomains.push_back(Subdomain());
aggregate=subdomains.size()-1;
}
overlapVisitor.setAggregate(aggregate);
aggregateVisitor.setAggregate(aggregate);
subdomains[aggregate].insert(i);
typename AggregatesMap::VertexList vlist;
amap.template breadthFirstSearch<false,false>(i, aggregate, graph, vlist, aggregateVisitor,
overlapVisitor, visitedMap);
}
std::size_t minsize=10000;
std::size_t maxsize=0;
int sum=0;
for(typename Vector::size_type i=0; i < subdomains.size(); ++i) {
sum+=subdomains[i].size();
minsize=std::min(minsize, subdomains[i].size());
maxsize=std::max(maxsize, subdomains[i].size());
}
Dune::dinfo<<"Subdomain size: min="<<minsize<<" max="<<maxsize<<" avg="<<(sum/subdomains.size())
<<" no="<<subdomains.size()<<" isolated="<<isolated<<std::endl;
}
Vector subdomains;
};
template<class M, class X, class TM, class TS, class TA>
struct ConstructionTraits<SeqOverlappingSchwarz<M,X,TM,TS,TA> >
{
typedef ConstructionArgs<SeqOverlappingSchwarz<M,X,TM,TS,TA> > Arguments;
static inline std::shared_ptr<SeqOverlappingSchwarz<M,X,TM,TS,TA>> construct(Arguments& args)
{
return std::make_shared<SeqOverlappingSchwarz<M,X,TM,TS,TA>>
(args.getMatrix(),
args.getSubDomains(),
args.getArgs().relaxationFactor,
args.getArgs().onthefly);
}
};
} // namespace Amg
} // namespace Dune
#endif
preconditioners.hh
Define general preconditioner interface.
construction.hh
Helper classes for the construction of classes without empty constructor.
aggregates.hh
Provides classes for the Coloring process of AMG.
schwarz.hh
novlpschwarz.hh
Dune::Amg::SmootherTraits< Richardson< X, Y > >::Arguments
DefaultSmootherArgs< typename X::field_type > Arguments
Definition smoother.hh:74
Dune::Amg::SmootherApplier< NonoverlappingBlockPreconditioner< C, SeqSOR< M, X, Y, l > > >::postSmooth
static void postSmooth(Smoother &smoother, Domain &v, Range &d)
Definition smoother.hh:494
Dune::Amg::SmootherApplier< SeqOverlappingSchwarz< M, X, MultiplicativeSchwarzMode, MS, TA > >::preSmooth
static void preSmooth(Smoother &smoother, Domain &v, const Range &d)
Definition smoother.hh:518
Dune::Amg::ConstructionTraits< SeqJac< M, X, Y, l > >::construct
static std::shared_ptr< SeqJac< M, X, Y, l > > construct(Arguments &args)
Definition smoother.hh:256
Dune::Amg::ConstructionTraits< SeqILU< M, X, Y > >::Arguments
ConstructionArgs< SeqILU< M, X, Y > > Arguments
Definition smoother.hh:309
Dune::Amg::DefaultConstructionArgs::getMatrix
const Matrix & getMatrix() const
Definition smoother.hh:114
Dune::Amg::SmootherApplier< SeqOverlappingSchwarz< M, X, MultiplicativeSchwarzMode, MS, TA > >::Range
Smoother::range_type Range
Definition smoother.hh:515
Dune::Amg::Arguments::Arguments
DefaultSmootherArgs< typename Smoother::matrix_type::field_type > Arguments
Definition smoother.hh:67
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::VertexAdder::setAggregate
int setAggregate(const AggregateDescriptor &aggregate_)
Definition smoother.hh:670
Dune::Amg::ConstructionTraits< NonoverlappingBlockPreconditioner< C, T > >::SeqConstructionTraits
ConstructionTraits< T > SeqConstructionTraits
Definition smoother.hh:350
Dune::Amg::DefaultConstructionArgs::setArgs
void setArgs(const SmootherArgs &args)
Definition smoother.hh:119
Dune::Amg::ConstructionTraits< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::Arguments
ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > > Arguments
Definition smoother.hh:855
Dune::Amg::SmootherApplier< NonoverlappingBlockPreconditioner< C, SeqSOR< M, X, Y, l > > >::Smoother
NonoverlappingBlockPreconditioner< C, SeqSOR< M, X, Y, l > > Smoother
Definition smoother.hh:484
Dune::Amg::SmootherApplier< SeqSOR< M, X, Y, l > >::postSmooth
static void postSmooth(Smoother &smoother, Domain &v, Range &d)
Definition smoother.hh:456
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::AggregateAdder::AggregateAdder
AggregateAdder(Vector &subdomains_, const AggregatesMap &aggregates_, const MatrixGraph< const M > &graph_, VM &visitedMap_)
Definition smoother.hh:704
Dune::Amg::SeqOverlappingSchwarzSmootherArgs< typename M::field_type >::Overlap
Overlap
Definition smoother.hh:538
Dune::Amg::ConstructionTraits::construct
static std::shared_ptr< T > construct(Arguments &)
Construct an object with the specified arguments.
Definition construction.hh:52
Dune::Amg::DefaultParallelConstructionArgs::setComm
void setComm(const C &comm)
Definition smoother.hh:158
Dune::Amg::ConstructionTraits< Richardson< X, Y > >::Arguments
DefaultConstructionArgs< Richardson< X, Y > > Arguments
Definition smoother.hh:269
Dune::Amg::DefaultConstructionArgs< Richardson< X, Y > >::~DefaultConstructionArgs
virtual ~DefaultConstructionArgs()
Definition smoother.hh:180
Dune::Amg::SmootherTraits< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::Arguments
SeqOverlappingSchwarzSmootherArgs< typename M::field_type > Arguments
Definition smoother.hh:552
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::Subdomain
Vector::value_type Subdomain
Definition smoother.hh:566
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::NoneAdder::setAggregate
int setAggregate(const AggregateDescriptor &)
Definition smoother.hh:691
Dune::Amg::SmootherApplier< NonoverlappingBlockPreconditioner< C, SeqSOR< M, X, Y, l > > >::preSmooth
static void preSmooth(Smoother &smoother, Domain &v, Range &d)
Definition smoother.hh:488
Dune::Amg::ConstructionArgs< SeqILU< M, X, Y > >::getN
int getN()
Definition smoother.hh:293
Dune::Amg::SmootherApplier< NonoverlappingBlockPreconditioner< C, SeqSOR< M, X, Y, l > > >::Range
Smoother::range_type Range
Definition smoother.hh:485
Dune::Amg::SmootherApplier< SeqSOR< M, X, Y, l > >::Smoother
SeqSOR< M, X, Y, l > Smoother
Definition smoother.hh:446
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::AggregateAdder::operator()
void operator()(const T &edge)
Definition smoother.hh:710
Dune::Amg::ConstructionTraits< SeqSSOR< M, X, Y, l > >::construct
static std::shared_ptr< SeqSSOR< M, X, Y, l > > construct(Arguments &args)
Definition smoother.hh:224
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::AggregateDescriptor
AggregatesMap::AggregateDescriptor AggregateDescriptor
Definition smoother.hh:564
Dune::Amg::SeqOverlappingSchwarzSmootherArgs< typename M::field_type >::onthefly
bool onthefly
Definition smoother.hh:541
Dune::Amg::ConstructionTraits< SeqSOR< M, X, Y, l > >::Arguments
DefaultConstructionArgs< SeqSOR< M, X, Y, l > > Arguments
Definition smoother.hh:238
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::setMatrix
virtual void setMatrix(const M &matrix, const AggregatesMap &amap)
Definition smoother.hh:568
Dune::Amg::DefaultConstructionArgs< Richardson< X, Y > >::setMatrix
void setMatrix(const Args &...)
Definition smoother.hh:184
Dune::Amg::ConstructionTraits< SeqJac< M, X, Y, l > >::Arguments
DefaultConstructionArgs< SeqJac< M, X, Y, l > > Arguments
Definition smoother.hh:254
Dune::Amg::ConstructionTraits< SeqSSOR< M, X, Y, l > >::Arguments
DefaultConstructionArgs< SeqSSOR< M, X, Y, l > > Arguments
Definition smoother.hh:222
Dune::Amg::DefaultConstructionArgs::getArgs
const SmootherArgs getArgs() const
Definition smoother.hh:133
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::VertexAdder::VertexAdder
VertexAdder(Vector &subdomains_, const AggregatesMap &aggregates_)
Definition smoother.hh:661
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::getSubDomains
const Vector & getSubDomains()
Definition smoother.hh:653
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::Vector
SeqOverlappingSchwarz< M, X, TM, TS, TA >::subdomain_vector Vector
Definition smoother.hh:565
Dune::Amg::ConstructionTraits< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::construct
static std::shared_ptr< SeqOverlappingSchwarz< M, X, TM, TS, TA > > construct(Arguments &args)
Definition smoother.hh:857
Dune::Amg::SmootherApplier< BlockPreconditioner< X, Y, C, SeqSOR< M, X, Y, l > > >::preSmooth
static void preSmooth(Smoother &smoother, Domain &v, Range &d)
Definition smoother.hh:469
Dune::Amg::AggregatesMap::begin
const_iterator begin() const
Definition aggregates.hh:731
Dune::Amg::DefaultConstructionArgs::setMatrix
void setMatrix(const Matrix &matrix)
Definition smoother.hh:104
Dune::Amg::SmootherApplier::Smoother
T Smoother
Definition smoother.hh:371
Dune::Amg::SmootherApplier< SeqSOR< M, X, Y, l > >::preSmooth
static void preSmooth(Smoother &smoother, Domain &v, Range &d)
Definition smoother.hh:450
Dune::Amg::SmootherApplier< BlockPreconditioner< X, Y, C, SeqSOR< M, X, Y, l > > >::Smoother
BlockPreconditioner< X, Y, C, SeqSOR< M, X, Y, l > > Smoother
Definition smoother.hh:465
Dune::Amg::DefaultConstructionArgs< Richardson< X, Y > >::setComm
void setComm(T1 &comm)
Definition smoother.hh:193
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::VertexAdder::noSubdomains
int noSubdomains() const
Definition smoother.hh:676
Dune::Amg::AggregatesMap< VertexDescriptor >::iterator
AggregateDescriptor * iterator
Definition aggregates.hh:741
Dune::Amg::presmooth
void presmooth(LevelContext &levelContext, size_t steps)
Apply pre smoothing on the current level.
Definition smoother.hh:406
Dune::Amg::SmootherApplier< SeqOverlappingSchwarz< M, X, MultiplicativeSchwarzMode, MS, TA > >::Domain
Smoother::domain_type Domain
Definition smoother.hh:516
Dune::Amg::SeqOverlappingSchwarzSmootherArgs::SeqOverlappingSchwarzSmootherArgs
SeqOverlappingSchwarzSmootherArgs(Overlap overlap_=vertex, bool onthefly_=false)
Definition smoother.hh:543
Dune::Amg::ConstructionTraits< BlockPreconditioner< X, Y, C, T > >::Arguments
DefaultParallelConstructionArgs< T, C > Arguments
Definition smoother.hh:337
Dune::Amg::ConstructionTraits< NonoverlappingBlockPreconditioner< C, T > >::Arguments
DefaultParallelConstructionArgs< T, C > Arguments
Definition smoother.hh:349
Dune::Amg::DefaultConstructionArgs< SeqSSOR< M, X, Y, l > >::matrix_
const Matrix * matrix_
Definition smoother.hh:139
Dune::Amg::AggregatesMap::end
const_iterator end() const
Definition aggregates.hh:736
Dune::Amg::DefaultConstructionArgs::getComm
const SequentialInformation & getComm()
Definition smoother.hh:128
Dune::Amg::AggregatesMap< VertexDescriptor >::AggregateDescriptor
VertexDescriptor AggregateDescriptor
Definition aggregates.hh:586
Dune::Amg::AggregatesMap< VertexDescriptor >::ISOLATED
static const VertexDescriptor ISOLATED
Definition aggregates.hh:577
Dune::Amg::DefaultSmootherArgs::DefaultSmootherArgs
DefaultSmootherArgs()
Default constructor.
Definition smoother.hh:56
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::setMatrix
void setMatrix(const M &matrix)
Definition smoother.hh:606
Dune::Amg::AggregatesMap::noVertices
std::size_t noVertices() const
Get the number of vertices.
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::VertexAdder::operator()
void operator()(const T &edge)
Definition smoother.hh:665
Dune::Amg::SmootherApplier::postSmooth
static void postSmooth(Smoother &smoother, Domain &v, const Range &d)
apply post smoothing in forward direction
Definition smoother.hh:394
Dune::Amg::DefaultSmootherArgs::RelaxationFactor
FieldTraits< T >::real_type RelaxationFactor
The type of the relaxation factor.
Definition smoother.hh:42
Dune::Amg::SmootherApplier< NonoverlappingBlockPreconditioner< C, SeqSOR< M, X, Y, l > > >::Domain
Smoother::domain_type Domain
Definition smoother.hh:486
Dune::Amg::SmootherApplier::Domain
Smoother::domain_type Domain
Definition smoother.hh:373
Dune::Amg::ConstructionArgs< SeqILU< M, X, Y > >::setN
void setN(int n)
Definition smoother.hh:288
Dune::Amg::ConstructionTraits< BlockPreconditioner< X, Y, C, T > >::construct
static std::shared_ptr< BlockPreconditioner< X, Y, C, T > > construct(Arguments &args)
Definition smoother.hh:339
Dune::Amg::AggregatesMap< VertexDescriptor >::VertexList
SLList< VertexDescriptor, Allocator > VertexList
Definition aggregates.hh:598
Dune::Amg::ConstructionTraits< NonoverlappingBlockPreconditioner< C, T > >::construct
static std::shared_ptr< NonoverlappingBlockPreconditioner< C, T > > construct(Arguments &args)
Definition smoother.hh:351
Dune::Amg::SmootherApplier< SeqOverlappingSchwarz< M, X, MultiplicativeSchwarzMode, MS, TA > >::Smoother
SeqOverlappingSchwarz< M, X, MultiplicativeSchwarzMode, MS, TA > Smoother
Definition smoother.hh:514
Dune::Amg::ConstructionTraits< ParSSOR< M, X, Y, C > >::construct
static std::shared_ptr< ParSSOR< M, X, Y, C > > construct(Arguments &args)
Definition smoother.hh:326
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::VertexDescriptor
MatrixGraph< M >::VertexDescriptor VertexDescriptor
Definition smoother.hh:562
Dune::Amg::ConstructionTraits< SeqILU< M, X, Y > >::construct
static std::shared_ptr< SeqILU< M, X, Y > > construct(Arguments &args)
Definition smoother.hh:311
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::AggregateAdder::noSubdomains
int noSubdomains() const
Definition smoother.hh:731
Dune::Amg::DefaultConstructionArgs< Richardson< X, Y > >::getComm
const SequentialInformation & getComm()
Definition smoother.hh:196
Dune::Amg::ConstructionTraits< SeqSOR< M, X, Y, l > >::construct
static std::shared_ptr< SeqSOR< M, X, Y, l > > construct(Arguments &args)
Definition smoother.hh:240
Dune::Amg::ConstructionTraits< Richardson< X, Y > >::construct
static std::shared_ptr< Richardson< X, Y > > construct(Arguments &args)
Definition smoother.hh:271
Dune::Amg::DefaultConstructionArgs::setMatrix
virtual void setMatrix(const Matrix &matrix, const AggregatesMap &amap)
Definition smoother.hh:108
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::NoneAdder::noSubdomains
int noSubdomains() const
Definition smoother.hh:695
Dune::Amg::postsmooth
void postsmooth(LevelContext &levelContext, size_t steps)
Apply post smoothing on the current level.
Definition smoother.hh:428
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::AggregatesMap
Dune::Amg::AggregatesMap< VertexDescriptor > AggregatesMap
Definition smoother.hh:563
Dune::Amg::DefaultConstructionArgs< Richardson< X, Y > >::getArgs
const SmootherArgs getArgs() const
Definition smoother.hh:201
Dune::Amg::DefaultConstructionArgs::setComm
void setComm(T1 &comm)
Definition smoother.hh:125
Dune::Amg::SmootherApplier< SeqOverlappingSchwarz< M, X, MultiplicativeSchwarzMode, MS, TA > >::postSmooth
static void postSmooth(Smoother &smoother, Domain &v, const Range &d)
Definition smoother.hh:524
Dune::Amg::ConstructionTraits< ParSSOR< M, X, Y, C > >::Arguments
DefaultParallelConstructionArgs< M, C > Arguments
Definition smoother.hh:324
Dune::Amg::DefaultSmootherArgs< typename T::matrix_type::field_type >::relaxationFactor
RelaxationFactor relaxationFactor
Definition smoother.hh:51
Dune::Amg::DefaultParallelConstructionArgs::~DefaultParallelConstructionArgs
virtual ~DefaultParallelConstructionArgs()
Definition smoother.hh:155
Dune::Amg::SmootherApplier< SeqSOR< M, X, Y, l > >::Domain
Smoother::domain_type Domain
Definition smoother.hh:448
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::AggregateAdder::setAggregate
int setAggregate(const AggregateDescriptor &aggregate_)
Definition smoother.hh:725
Dune::Amg::SmootherApplier< SeqSOR< M, X, Y, l > >::Range
Smoother::range_type Range
Definition smoother.hh:447
Dune::Amg::DefaultParallelConstructionArgs::getComm
const C & getComm() const
Definition smoother.hh:163
Dune::Amg::DefaultConstructionArgs::~DefaultConstructionArgs
virtual ~DefaultConstructionArgs()
Definition smoother.hh:101
Dune::Amg::SmootherApplier::preSmooth
static void preSmooth(Smoother &smoother, Domain &v, const Range &d)
apply pre smoothing in forward direction
Definition smoother.hh:382
Dune::Amg::SmootherApplier< BlockPreconditioner< X, Y, C, SeqSOR< M, X, Y, l > > >::postSmooth
static void postSmooth(Smoother &smoother, Domain &v, Range &d)
Definition smoother.hh:475
Dune::Amg::ConstructionTraits< BlockPreconditioner< X, Y, C, T > >::SeqConstructionTraits
ConstructionTraits< T > SeqConstructionTraits
Definition smoother.hh:338
Dune::Amg::ConstructionArgs< SeqOverlappingSchwarz< M, X, TM, TS, TA > >::NoneAdder::operator()
void operator()(const T &)
Definition smoother.hh:689
Dune::Amg::ConstructionArgs< SeqILU< M, X, Y > >::ConstructionArgs
ConstructionArgs(int n=0)
Definition smoother.hh:284
Dune::Amg::SmootherApplier< BlockPreconditioner< X, Y, C, SeqSOR< M, X, Y, l > > >::Range
Smoother::range_type Range
Definition smoother.hh:466
Dune::Amg::DefaultConstructionArgs< Richardson< X, Y > >::setArgs
void setArgs(const SmootherArgs &args)
Definition smoother.hh:187
Dune::Amg::DefaultSmootherArgs< typename T::matrix_type::field_type >::iterations
int iterations
Definition smoother.hh:47
Dune::Amg::SmootherApplier::Range
Smoother::range_type Range
Definition smoother.hh:372
Dune::Amg::SeqOverlappingSchwarzSmootherArgs< typename M::field_type >::overlap
Overlap overlap
Definition smoother.hh:540
Dune::Amg::SmootherApplier< BlockPreconditioner< X, Y, C, SeqSOR< M, X, Y, l > > >::Domain
Smoother::domain_type Domain
Definition smoother.hh:467
Dune::Amg::SeqOverlappingSchwarzSmootherArgs< typename M::field_type >::aggregate
@ aggregate
Definition smoother.hh:538
Dune::Amg::SeqOverlappingSchwarzSmootherArgs< typename M::field_type >::none
@ none
Definition smoother.hh:538
Dune::Amg::SeqOverlappingSchwarzSmootherArgs< typename M::field_type >::pairwise
@ pairwise
Definition smoother.hh:538
Dune::Amg::SeqOverlappingSchwarzSmootherArgs< typename M::field_type >::vertex
@ vertex
Definition smoother.hh:538
Dune
Definition allocator.hh:11
Dune::get
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
Dune::Amg
Definition novlpschwarz.hh:256
Dune::size_type
Dune::SeqOverlappingSchwarz
Sequential overlapping Schwarz preconditioner.
Definition overlappingschwarz.hh:755
Dune::SeqOverlappingSchwarz< M, X, MultiplicativeSchwarzMode, MS, TA >::range_type
X range_type
Definition overlappingschwarz.hh:770
Dune::SeqOverlappingSchwarz< M, X, MultiplicativeSchwarzMode, MS, TA >::domain_type
X domain_type
Definition overlappingschwarz.hh:765
Dune::SeqOverlappingSchwarz::subdomain_vector
std::vector< subdomain_type, typename std::allocator_traits< TA >::template rebind_alloc< subdomain_type > > subdomain_vector
The vector type containing the subdomain to row index mapping.
Definition overlappingschwarz.hh:797
Dune::Amg::ConstructionTraits
Traits class for generically constructing non default constructable types.
Definition construction.hh:39
Dune::NonoverlappingBlockPreconditioner
Nonoverlapping parallel preconditioner.
Definition novlpschwarz.hh:276
Dune::NonoverlappingBlockPreconditioner< C, SeqSOR< M, X, Y, l > >::range_type
SeqSOR< M, X, Y, l >::range_type range_type
Definition novlpschwarz.hh:284
Dune::NonoverlappingBlockPreconditioner< C, SeqSOR< M, X, Y, l > >::domain_type
SeqSOR< M, X, Y, l >::domain_type domain_type
Definition novlpschwarz.hh:282
Dune::MultiplicativeSchwarzMode
Tag that tells the Schwarz method to be multiplicative.
Definition overlappingschwarz.hh:126
Dune::Amg::AggregatesMap
Class providing information about the mapping of the vertices onto aggregates.
Definition aggregates.hh:566
Dune::Amg::MatrixGraph
The (undirected) graph of a matrix.
Definition graph.hh:51
Dune::Amg::MatrixGraph::end
VertexIterator end()
Get an iterator over the vertices.
Dune::Amg::MatrixGraph::ConstVertexIterator
VertexIteratorT< const MatrixGraph< Matrix > > ConstVertexIterator
The constant vertex iterator type.
Definition graph.hh:308
Dune::Amg::MatrixGraph::VertexDescriptor
M::size_type VertexDescriptor
The vertex descriptor.
Definition graph.hh:73
Dune::Amg::MatrixGraph::ConstEdgeIterator
EdgeIteratorT< const MatrixGraph< Matrix > > ConstEdgeIterator
The constant edge iterator type.
Definition graph.hh:298
Dune::Amg::MatrixGraph::begin
VertexIterator begin()
Get an iterator over the vertices.
Dune::Amg::SequentialInformation
Definition pinfo.hh:28
Dune::Amg::DefaultSmootherArgs
The default class for the smoother arguments.
Definition smoother.hh:38
Dune::Amg::SmootherTraits
Traits class for getting the attribute class of a smoother.
Definition smoother.hh:66
Dune::Amg::DefaultConstructionArgs
Construction Arguments for the default smoothers.
Definition smoother.hh:93
Dune::Amg::ConstructionArgs
Definition smoother.hh:148
Dune::Amg::DefaultParallelConstructionArgs
Definition smoother.hh:153
Dune::Amg::SmootherApplier
Helper class for applying the smoothers.
Definition smoother.hh:370
Dune::Amg::SeqOverlappingSchwarzSmootherArgs
Definition smoother.hh:537
Dune::SeqSSOR
Sequential SSOR preconditioner.
Definition preconditioners.hh:142
Dune::SeqSOR
Sequential SOR preconditioner.
Definition preconditioners.hh:262
Dune::SeqSOR< M, X, Y, l >::domain_type
X domain_type
Definition preconditioners.hh:267
Dune::SeqSOR< M, X, Y, l >::range_type
Y range_type
Definition preconditioners.hh:269
Dune::SeqJac
The sequential jacobian preconditioner.
Definition preconditioners.hh:413
Dune::SeqILU
Sequential ILU preconditioner.
Definition preconditioners.hh:697
Dune::Richardson
Richardson preconditioner.
Definition preconditioners.hh:878
Dune::ParSSOR
A parallel SSOR preconditioner.
Definition schwarz.hh:175
Dune::BlockPreconditioner
Block parallel preconditioner.
Definition schwarz.hh:278
Dune::BlockPreconditioner< X, Y, C, SeqSOR< M, X, Y, l > >::domain_type
X domain_type
Definition schwarz.hh:285
Dune::BlockPreconditioner< X, Y, C, SeqSOR< M, X, Y, l > >::range_type
Y range_type
Definition schwarz.hh:290