![]() |
deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20:01+00:00
|
#include <deal.II/lac/precondition_block_base.h>
A class storing the inverse diagonal blocks for block preconditioners and block relaxation methods.
This class does the book keeping for preconditioners and relaxation methods based on inverting blocks on the diagonal of a matrix. It allows us to either store all diagonal blocks and their inverses or the same block for each entry, and it keeps track of the choice. Thus, after initializing it and filling the inverse diagonal blocks correctly, a derived class can use inverse() with an integer argument referring to the block number.
Additionally, it allows the storage of the original diagonal blocks, not only the inverses. These are for instance used in the intermediate step of the SSOR preconditioner.
Definition at line 56 of file precondition_block_base.h.
Public Types | |
| enum | Inversion { gauss_jordan , householder , svd } |
| using | size_type = types::global_dof_index |
Public Member Functions | |
| PreconditionBlockBase (const bool store_diagonals=false, const Inversion method=gauss_jordan) | |
| ~PreconditionBlockBase ()=default | |
| void | clear () |
| void | reinit (const unsigned int nblocks, const size_type blocksize, const bool compress, const Inversion method=gauss_jordan) |
| void | inverses_computed (const bool are_they) |
| bool | same_diagonal () const |
| bool | store_diagonals () const |
| bool | inverses_ready () const |
| unsigned int | size () const |
| template<typename number2 > | |
| void | inverse_vmult (const size_type i, Vector< number2 > &dst, const Vector< number2 > &src) const |
| template<typename number2 > | |
| void | inverse_Tvmult (const size_type i, Vector< number2 > &dst, const Vector< number2 > &src) const |
| FullMatrix< number > & | inverse (const size_type i) |
| Householder< number > & | inverse_householder (const size_type i) |
| LAPACKFullMatrix< number > & | inverse_svd (const size_type i) |
| const FullMatrix< number > & | inverse (const size_type i) const |
| const Householder< number > & | inverse_householder (const size_type i) const |
| const LAPACKFullMatrix< number > & | inverse_svd (const size_type i) const |
| FullMatrix< number > & | diagonal (const size_type i) |
| const FullMatrix< number > & | diagonal (const size_type i) const |
| void | log_statistics () const |
| std::size_t | memory_consumption () const |
Static Public Member Functions | |
| static ::ExceptionBase & | ExcDiagonalsNotStored () |
| static ::ExceptionBase & | ExcInverseNotAvailable () |
Protected Attributes | |
| Inversion | inversion |
Private Attributes | |
| unsigned int | n_diagonal_blocks |
| std::vector< FullMatrix< number > > | var_inverse_full |
| std::vector< Householder< number > > | var_inverse_householder |
| std::vector< LAPACKFullMatrix< number > > | var_inverse_svd |
| std::vector< FullMatrix< number > > | var_diagonal |
| bool | var_store_diagonals |
| bool | var_same_diagonal |
| bool | var_inverses_ready |
| using PreconditionBlockBase< number >::size_type = types::global_dof_index |
Declare type for container size.
Definition at line 62 of file precondition_block_base.h.
| enum PreconditionBlockBase::Inversion |
Choose a method for inverting the blocks, and thus the data type for the inverses.
| Enumerator | |
|---|---|
| gauss_jordan | Use the standard Gauss-Jacobi method implemented in FullMatrix::inverse(). |
| householder | Use QR decomposition of the Householder class. |
| svd | Use the singular value decomposition of LAPACKFullMatrix. |
Definition at line 68 of file precondition_block_base.h.
|
inline |
Constructor initializing default values.
Definition at line 301 of file precondition_block_base.h.
|
default |
The virtual destructor
|
inline |
Deletes the inverse diagonal block matrices if existent hence leaves the class in the state that it had directly after calling the constructor.
Definition at line 314 of file precondition_block_base.h.
|
inline |
Resize to this number of diagonal blocks with the given block size. If compress is true, then only one block will be stored.
Definition at line 332 of file precondition_block_base.h.
|
inline |
Tell the class that inverses are computed.
Definition at line 599 of file precondition_block_base.h.
|
inline |
Does the matrix use only one diagonal block?
Definition at line 583 of file precondition_block_base.h.
|
inline |
Check, whether diagonal blocks (not their inverses) should be stored.
Definition at line 591 of file precondition_block_base.h.
|
inline |
Return true, if inverses are ready for use.
Definition at line 607 of file precondition_block_base.h.
|
inline |
The number of blocks.
Definition at line 410 of file precondition_block_base.h.
|
inline |
Multiply with the inverse block at position i.
Definition at line 420 of file precondition_block_base.h.
|
inline |
Multiply with the transposed inverse block at position i.
Definition at line 449 of file precondition_block_base.h.
|
inline |
Access to the inverse diagonal blocks if Inversion is gauss_jordan.
Definition at line 527 of file precondition_block_base.h.
|
inline |
Access to the inverse diagonal blocks if Inversion is householder.
Definition at line 541 of file precondition_block_base.h.
|
inline |
Access to the inverse diagonal blocks if Inversion is householder.
Definition at line 555 of file precondition_block_base.h.
|
inline |
Access to the inverse diagonal blocks.
Definition at line 477 of file precondition_block_base.h.
|
inline |
Access to the inverse diagonal blocks if Inversion is householder.
Definition at line 489 of file precondition_block_base.h.
|
inline |
Access to the inverse diagonal blocks if Inversion is householder.
Definition at line 501 of file precondition_block_base.h.
|
inline |
Access to the diagonal blocks.
Definition at line 569 of file precondition_block_base.h.
|
inline |
Access to the diagonal blocks.
Definition at line 513 of file precondition_block_base.h.
|
inline |
Print some statistics about the inverses to deallog. Output depends on Inversion. It is richest for svd, where we obtain statistics on extremal singular values and condition numbers.
Definition at line 615 of file precondition_block_base.h.
|
inline |
Determine an estimate for the memory consumption (in bytes) of this object.
Definition at line 668 of file precondition_block_base.h.
|
protected |
The method used for inverting blocks.
Definition at line 241 of file precondition_block_base.h.
|
private |
The number of (inverse) diagonal blocks, if only one is stored.
Definition at line 247 of file precondition_block_base.h.
|
private |
Storage of the inverse matrices of the diagonal blocks matrices as FullMatrix<number> matrices, if Inversion gauss_jordan is used. Using number=float saves memory in comparison with number=double, but may introduce numerical instability.
Definition at line 255 of file precondition_block_base.h.
|
private |
Storage of the inverse matrices of the diagonal blocks matrices as Householder matrices if Inversion householder is used. Using number=float saves memory in comparison with number=double, but may introduce numerical instability.
Definition at line 263 of file precondition_block_base.h.
|
private |
Storage of the inverse matrices of the diagonal blocks matrices as LAPACKFullMatrix matrices if Inversion svd is used. Using number=float saves memory in comparison with number=double, but may introduce numerical instability.
Definition at line 271 of file precondition_block_base.h.
|
private |
Storage of the original diagonal blocks.
Used by the blocked SSOR method.
Definition at line 278 of file precondition_block_base.h.
|
private |
This is true, if the field var_diagonal is to be used.
Definition at line 284 of file precondition_block_base.h.
|
private |
This is true, if only one inverse is stored.
Definition at line 289 of file precondition_block_base.h.
|
private |
The inverse matrices are usable. Set by the parent class via inverses_computed().
Definition at line 295 of file precondition_block_base.h.