KASKADE 7 development version
Loading...
Searching...
No Matches
Kaskade::AdditiveMultiGrid< Smoother, Prolongation, CoarsePreconditioner > Class Template Reference

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

#include <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 Smoother::domain_type::field_type field_type

Public Member Functions

 AdditiveMultiGrid ()=default
 Default constructor.
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.
 AdditiveMultiGrid (AdditiveMultiGrid &&other)=default
AdditiveMultiGrid & operator= (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 \).
virtual bool requiresInitializedInput () const
 Returns true if the target vector x has to be initialized to zero before calling apply or applyDp.
virtual void pre (Smoother::domain_type &, Smoother::range_type &)
 Preconditioner preparation.
virtual void post (Smoother::domain_type &x)
 Preconditioner cleanup.
virtual Dune::SolverCategory::Category category () const override
 returns the category of the operator

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.

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 Smoother::domain_type::field_type Kaskade::SymmetricPreconditioner< Smoother::domain_type, Smoother::range_type >::field_type
inherited

Definition at line 217 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.

Referenced by AdditiveMultiGrid(), and operator=().

◆ 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

Definition at line 80 of file additiveMultigrid.hh.

Referenced by applyDp().

◆ 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 248 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 231 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 224 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: