KASKADE 7 development version
Public Types | Public Member Functions | List of all members
Kaskade::HierarchicalBasisPreconditioner< Grid, Domain, Range > Class Template Reference

A hierarchical basis preconditioner. More...

#include <hb.hh>

Detailed Description

template<class Grid, class Domain, class Range>
class Kaskade::HierarchicalBasisPreconditioner< Grid, Domain, Range >

A hierarchical basis preconditioner.

This preconditioner realizes an approximative inverse of a Laplace operator with constant diffusion coefficient discretized by linear finite elements in nodal basis over the leaf view of the provided grid.

This implementation is geometry- and coefficient-agnostic, i.e. it assumes that the diagonal of the stiffness matrix is just the identity. The advantage of this approach are its extreme simplicity, both in terms of interface and implementation, a minimal memory footprint, and very cheap set-up phase and application. The drawback is, of course, a worse resulting condition number in case non-uniform coarse grids, anisotropic coarse grids, or spatially varying or anisotropic diffusion coefficients are to be treated.

Extending the implementation to take more structure (stiffness matrices, non-uniform grids) into account is probably not worth the while, as the iteration count grows anyway in proportion to the number of refinement levels in 2D or even faster in 3D. If the simplicity of the PrecondType::HB preconditioner does'nt pay off, have a look at MultigridSolver or BPXYPreconditioner.

We refer to Deuflhard/Weiser Chapter 7.3.

Template Parameters
Gridthe grid on which the Laplace operator is discretized. This implementation assumes that the grid is purely simplicial and that on refinement new nodes are created only at edge midpoints.
Domainthe type of domain space vectors
Rangethe type of range space vectors

Definition at line 64 of file hb.hh.

Inheritance diagram for Kaskade::HierarchicalBasisPreconditioner< Grid, Domain, Range >:
Kaskade::SymmetricPreconditioner< Domain, Range >

Public Types

typedef X::field_type field_type
 

Public Member Functions

 HierarchicalBasisPreconditioner (Grid const &grid)
 Constructor. More...
 
virtual void pre (Domain &x, Range &b)
 Has to be called before the first call to apply. More...
 
virtual void apply (Domain &v, const Range &d)
 applies the preconditioner to the residual More...
 
virtual SymmetricPreconditioner< Domain, Range >::field_type applyDp (Domain &v, const Range &d) override
 Computes \( x \leftarrow By \) and returns \( \langle By, y \rangle \). More...
 
virtual void post (Domain &x)
 Has to be called after the last call to apply. 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 Dune::SolverCategory::Category category () const override
 returns the category of the operator More...
 

Member Typedef Documentation

◆ field_type

typedef X::field_type Kaskade::SymmetricPreconditioner< Domain , Range >::field_type
inherited

Definition at line 211 of file symmetricOperators.hh.

Constructor & Destructor Documentation

◆ HierarchicalBasisPreconditioner()

template<class Grid , class Domain , class Range >
Kaskade::HierarchicalBasisPreconditioner< Grid, Domain, Range >::HierarchicalBasisPreconditioner ( Grid const &  grid)
inlineexplicit

Constructor.

Parameters
gridthe grid
mat_a matrix containing (at least) the diagonal of the stiffness matrix

Definition at line 78 of file hb.hh.

Member Function Documentation

◆ apply()

template<class Grid , class Domain , class Range >
virtual void Kaskade::HierarchicalBasisPreconditioner< Grid, Domain, Range >::apply ( Domain &  v,
const Range &  d 
)
inlinevirtual

applies the preconditioner to the residual

  • d, which results in the correction
  • v

Definition at line 188 of file hb.hh.

Referenced by Kaskade::HierarchicalBasisPreconditioner< Grid, Domain, Range >::applyDp().

◆ applyDp()

template<class Grid , class Domain , class Range >
virtual SymmetricPreconditioner< Domain, Range >::field_type Kaskade::HierarchicalBasisPreconditioner< Grid, Domain, Range >::applyDp ( Domain &  x,
const Range &  y 
)
inlineoverridevirtual

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

Implements Kaskade::SymmetricPreconditioner< Domain, Range >.

Definition at line 226 of file hb.hh.

◆ category()

virtual Dune::SolverCategory::Category Kaskade::SymmetricPreconditioner< Domain , Range >::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.

◆ post()

template<class Grid , class Domain , class Range >
virtual void Kaskade::HierarchicalBasisPreconditioner< Grid, Domain, Range >::post ( Domain &  x)
inlinevirtual

Has to be called after the last call to apply.

Reimplemented from Kaskade::SymmetricPreconditioner< Domain, Range >.

Definition at line 235 of file hb.hh.

◆ pre()

template<class Grid , class Domain , class Range >
virtual void Kaskade::HierarchicalBasisPreconditioner< Grid, Domain, Range >::pre ( Domain &  x,
Range &  b 
)
inlinevirtual

Has to be called before the first call to apply.

Reimplemented from Kaskade::SymmetricPreconditioner< Domain, Range >.

Definition at line 180 of file hb.hh.

◆ requiresInitializedInput()

template<class Grid , class Domain , class Range >
virtual bool Kaskade::HierarchicalBasisPreconditioner< Grid, Domain, Range >::requiresInitializedInput ( ) const
inlinevirtual

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

Implements Kaskade::SymmetricPreconditioner< Domain, Range >.

Definition at line 240 of file hb.hh.


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