KASKADE 7 development version
Public Types | Public Member Functions | List of all members
Kaskade::AdditiveMultiGrid< Smoother, Prolongation, CoarsePreconditioner > Class Template Reference

An additive multigrid preconditioner for P1 elements. More...

#include <additiveMultigrid.hh>

Detailed Description

template<class Smoother, class Prolongation, class CoarsePreconditioner = Smoother>
class Kaskade::AdditiveMultiGrid< Smoother, Prolongation, CoarsePreconditioner >

An additive multigrid preconditioner for P1 elements.

This realizes an additive multigrid preconditioner. With a Jacobi smoother, the BPX preconditioner is obtained.

Template Parameters
Smoothera smoother type satisfying the SymmetricPreconditioner interface. The smoother must not rely on the matrix provided on construction to be available subsequently. Hence it should copy all required parts.

Convenience functions for creating additive multigrid preconditioners are available as makeAdditiveMultiGrid and makeBPX.

Todo:
: consider inheriting from Kaskade::SymmetricPreconditioner

Definition at line 46 of file additiveMultigrid.hh.

Inheritance diagram for Kaskade::AdditiveMultiGrid< Smoother, Prolongation, CoarsePreconditioner >:
Kaskade::SymmetricPreconditioner< Smoother::domain_type, Smoother::range_type >

Public Types

using domain_type = typename Smoother::domain_type
 
using range_type = typename Smoother::range_type
 
using Base = SymmetricPreconditioner< domain_type, range_type >
 
typedef X::field_type field_type
 

Public Member Functions

 AdditiveMultiGrid ()=default
 Default constructor. More...
 
template<class Entry , class Index , class MakeSmoother , class MakeCoarsePreconditioner >
 AdditiveMultiGrid (NumaBCRSMatrix< Entry, Index > A, std::vector< Prolongation > Ps, MakeSmoother const &makeSmoother, MakeCoarsePreconditioner const &makeCoarsePreconditioner, bool onlyLowerTriangle=false)
 Constructor. More...
 
 AdditiveMultiGrid (AdditiveMultiGrid &&other)=default
 
AdditiveMultiGridoperator= (AdditiveMultiGrid &&other)=default
 
virtual void apply (domain_type &x, range_type const &r)
 
virtual Base::field_type applyDp (domain_type &x, range_type const &r)
 Computes \( x \leftarrow By \) and returns \( \langle By, y \rangle \). More...
 
virtual bool requiresInitializedInput () const
 Returns true if the target vector x has to be initialized to zero before calling apply or applyDp. More...
 
virtual void pre (Smoother::domain_type &, Smoother::range_type &)
 Preconditioner preparation. More...
 
virtual void post (Smoother::domain_type &x)
 Preconditioner cleanup. More...
 
virtual Dune::SolverCategory::Category category () const override
 returns the category of the operator More...
 

Member Typedef Documentation

◆ Base

template<class Smoother , class Prolongation , class CoarsePreconditioner = Smoother>
using Kaskade::AdditiveMultiGrid< Smoother, Prolongation, CoarsePreconditioner >::Base = SymmetricPreconditioner<domain_type,range_type>

Definition at line 51 of file additiveMultigrid.hh.

◆ domain_type

template<class Smoother , class Prolongation , class CoarsePreconditioner = Smoother>
using Kaskade::AdditiveMultiGrid< Smoother, Prolongation, CoarsePreconditioner >::domain_type = typename Smoother::domain_type

Definition at line 49 of file additiveMultigrid.hh.

◆ field_type

typedef X::field_type Kaskade::SymmetricPreconditioner< Smoother::domain_type , Smoother::range_type >::field_type
inherited

Definition at line 211 of file symmetricOperators.hh.

◆ range_type

template<class Smoother , class Prolongation , class CoarsePreconditioner = Smoother>
using Kaskade::AdditiveMultiGrid< Smoother, Prolongation, CoarsePreconditioner >::range_type = typename Smoother::range_type

Definition at line 50 of file additiveMultigrid.hh.

Constructor & Destructor Documentation

◆ AdditiveMultiGrid() [1/3]

template<class Smoother , class Prolongation , class CoarsePreconditioner = Smoother>
Kaskade::AdditiveMultiGrid< Smoother, Prolongation, CoarsePreconditioner >::AdditiveMultiGrid ( )
default

Default constructor.

◆ AdditiveMultiGrid() [2/3]

template<class Smoother , class Prolongation , class CoarsePreconditioner = Smoother>
template<class Entry , class Index , class MakeSmoother , class MakeCoarsePreconditioner >
Kaskade::AdditiveMultiGrid< Smoother, Prolongation, CoarsePreconditioner >::AdditiveMultiGrid ( NumaBCRSMatrix< Entry, Index >  A,
std::vector< Prolongation Ps,
MakeSmoother const &  makeSmoother,
MakeCoarsePreconditioner const &  makeCoarsePreconditioner,
bool  onlyLowerTriangle = false 
)
inline

Constructor.

Template Parameters
Entrythe type of Galerkin matrix entries
Indexthe index type of Galerkin matrices (usually size_t)

Definition at line 64 of file additiveMultigrid.hh.

◆ AdditiveMultiGrid() [3/3]

template<class Smoother , class Prolongation , class CoarsePreconditioner = Smoother>
Kaskade::AdditiveMultiGrid< Smoother, Prolongation, CoarsePreconditioner >::AdditiveMultiGrid ( AdditiveMultiGrid< Smoother, Prolongation, CoarsePreconditioner > &&  other)
default

Member Function Documentation

◆ apply()

template<class Smoother , class Prolongation , class CoarsePreconditioner = Smoother>
virtual void Kaskade::AdditiveMultiGrid< Smoother, Prolongation, CoarsePreconditioner >::apply ( domain_type x,
range_type const &  r 
)
inlinevirtual

◆ applyDp()

template<class Smoother , class Prolongation , class CoarsePreconditioner = Smoother>
virtual Base::field_type Kaskade::AdditiveMultiGrid< Smoother, Prolongation, CoarsePreconditioner >::applyDp ( domain_type x,
range_type const &  y 
)
inlinevirtual

Computes \( x \leftarrow By \) and returns \( \langle By, y \rangle \).

Implements Kaskade::SymmetricPreconditioner< Smoother::domain_type, Smoother::range_type >.

Definition at line 86 of file additiveMultigrid.hh.

◆ category()

virtual Dune::SolverCategory::Category Kaskade::SymmetricPreconditioner< Smoother::domain_type , Smoother::range_type >::category ( ) const
inlineoverridevirtualinherited

returns the category of the operator

From the Dune doxygen documentation it is unclear what this is supposed to mean. We return a dummy here.

Definition at line 242 of file symmetricOperators.hh.

◆ operator=()

template<class Smoother , class Prolongation , class CoarsePreconditioner = Smoother>
AdditiveMultiGrid & Kaskade::AdditiveMultiGrid< Smoother, Prolongation, CoarsePreconditioner >::operator= ( AdditiveMultiGrid< Smoother, Prolongation, CoarsePreconditioner > &&  other)
default

◆ post()

virtual void Kaskade::SymmetricPreconditioner< Smoother::domain_type , Smoother::range_type >::post ( Smoother::domain_type &  x)
inlinevirtualinherited

Preconditioner cleanup.

The provided default implementation does nothing.

Definition at line 225 of file symmetricOperators.hh.

◆ pre()

virtual void Kaskade::SymmetricPreconditioner< Smoother::domain_type , Smoother::range_type >::pre ( Smoother::domain_type &  ,
Smoother::range_type &   
)
inlinevirtualinherited

Preconditioner preparation.

The provided default implementation does nothing.

Definition at line 218 of file symmetricOperators.hh.

◆ requiresInitializedInput()

template<class Smoother , class Prolongation , class CoarsePreconditioner = Smoother>
virtual bool Kaskade::AdditiveMultiGrid< Smoother, Prolongation, CoarsePreconditioner >::requiresInitializedInput ( ) const
inlinevirtual

Returns true if the target vector x has to be initialized to zero before calling apply or applyDp.

Implements Kaskade::SymmetricPreconditioner< Smoother::domain_type, Smoother::range_type >.

Definition at line 92 of file additiveMultigrid.hh.


The documentation for this class was generated from the following file: