AMDiS 2.11-git
The Adaptive Multi-Dimensional Simulation Toolbox
 
Loading...
Searching...
No Matches
BlockDiagonalPreconditioner< M, V, Basis > Class Template Reference

Preconditioner that applies a precon for each diagonal block. More...

#include <BlockDiagonalPreconditioner.hpp>

Inherits BlockPreconditioner< M, V, Basis >.

Classes

struct  Creator
 A creator to be used instead of the constructor. More...
 

Public Member Functions

 BlockDiagonalPreconditioner (std::string prefix, std::shared_ptr< Basis > basis)
 Constructor.
 
void init (M const &A) override
 Extract the diagonal blocks of the fullMatrix into new matrices.
 
void initSubPrecons ()
 
void finish () override
 Is called at the end of a solution procedure.
 
void finishSubPrecons ()
 
void solve (X const &x, Y &y) const override
 Apply the preconditioners block-wise.
 
void adjoint_solve (X const &x, Y &y) const override
 Apply the adjoint preconditioners block-wise.
 
- Public Member Functions inherited from BlockPreconditioner< M, V, Basis >
 BlockPreconditioner (std::shared_ptr< Basis > rowBasis, std::shared_ptr< Basis > colBasis)
 Constructor, constructs a block mapping for row and column basis.
 
 BlockPreconditioner (std::shared_ptr< Basis > rowBasis)
 Constructor, constructs a block mapping for row and column basis.
 
void init (M const &A) override
 Initialize the preconditioner by initializing all sub precons.
 
void initBlocks (M const &A, bool diagonalsOnly=false)
 Fill block matrices from fullMatrix.
 
M const & subMatrix (std::size_t i, std::size_t j) const
 Return the sub-matrix block (i,j)
 
M & subMatrix (std::size_t i, std::size_t j)
 Return the sub-matrix block (i,j)
 
auto subVector (Vector &&vec, mtl::irange const &ir) const
 Return a view on a sub-vector block for indices given in a range.
 
StridedVector subVector (V &vec, mtl::srange const &sr) const
 
StridedVector const subVector (V const &vec, mtl::srange const &sr) const
 Return a view on a sub-vector block for indices given in a strided range.
 
std::size_t rows () const
 Return the number of row blocks.
 
std::size_t cols () const
 Return the number of columns blocks.
 
- Public Member Functions inherited from PreconditionerInterface< M, V, V >
virtual ~PreconditionerInterface ()=default
 Virtual destructor.
 

Protected Attributes

std::string prefix_
 
std::vector< std::shared_ptr< PreconBase > > subPrecon_
 
- Protected Attributes inherited from BlockPreconditioner< M, V, Basis >
BlockedBasisMapping< Basis, Basis > blockMapping_
 
BlockMatrix< M > subMatrix_
 

Additional Inherited Members

- Public Types inherited from BlockPreconditioner< M, V, Basis >
using StridedVector = mtl::vec::strided_vector_ref< typename V::value_type >
 Return a view on a sub-vector block for indices given in a strided range.
 

Detailed Description

template<class M, class V, class Basis>
class AMDiS::BlockDiagonalPreconditioner< M, V, Basis >

Preconditioner that applies a precon for each diagonal block.

Member Function Documentation

◆ adjoint_solve()

template<class M , class V , class Basis >
void adjoint_solve ( X const &  x,
Y &  y 
) const
inlineoverridevirtual

Apply the adjoint preconditioners block-wise.

solve P^t x = b, with P^t = diag(P1^t, P2^t, ...)

Reimplemented from PreconditionerInterface< M, V, V >.

References BlockPreconditioner< M, V, Basis >::cols(), and BlockPreconditioner< M, V, Basis >::subVector().

◆ finish()

template<class M , class V , class Basis >
void finish ( )
inlineoverridevirtual

Is called at the end of a solution procedure.

Implements PreconditionerInterface< M, V, V >.

◆ init()

template<class M , class V , class Basis >
void init ( M const &  A)
inlineoverridevirtual

◆ solve()

template<class M , class V , class Basis >
void solve ( X const &  x,
Y &  y 
) const
inlineoverridevirtual

Apply the preconditioners block-wise.

solve Px = b, with P = diag(P1, P2, ...)

Implements PreconditionerInterface< M, V, V >.

References BlockPreconditioner< M, V, Basis >::rows(), and BlockPreconditioner< M, V, Basis >::subVector().


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