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. | |
Preconditioner that applies a precon for each diagonal block.
|
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().
|
inlineoverridevirtual |
Is called at the end of a solution procedure.
Implements PreconditionerInterface< M, V, V >.
|
inlineoverridevirtual |
Extract the diagonal blocks of the fullMatrix into new matrices.
Implements PreconditionerInterface< M, V, V >.
References BlockPreconditioner< M, V, Basis >::cols(), BlockPreconditioner< M, V, Basis >::initBlocks(), and BlockPreconditioner< M, V, Basis >::rows().
|
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().