Reference documentation for deal.II version 9.3.3
|
#include <deal.II/lac/precondition_block.h>
Classes | |
class | AdditionalData |
Public Types | |
using | size_type = types::global_dof_index |
Public Member Functions | |
PreconditionBlock (bool store_diagonals=false) | |
~PreconditionBlock () override=default | |
void | initialize (const MatrixType &A, const AdditionalData parameters) |
void | clear () |
bool | empty () const |
value_type | el (size_type i, size_type j) const |
void | invert_diagblocks () |
template<typename number2 > | |
void | forward_step (Vector< number2 > &dst, const Vector< number2 > &prev, const Vector< number2 > &src, const bool transpose_diagonal) const |
template<typename number2 > | |
void | backward_step (Vector< number2 > &dst, const Vector< number2 > &prev, const Vector< number2 > &src, const bool transpose_diagonal) const |
size_type | block_size () const |
std::size_t | memory_consumption () const |
Static Public Member Functions | |
static ::ExceptionBase & | ExcWrongBlockSize (int arg1, int arg2) |
static ::ExceptionBase & | ExcInverseMatricesAlreadyExist () |
Protected Types | |
enum | Inversion |
Protected Member Functions | |
void | initialize (const MatrixType &A, const std::vector< size_type > &permutation, const std::vector< size_type > &inverse_permutation, const AdditionalData parameters) |
void | set_permutation (const std::vector< size_type > &permutation, const std::vector< size_type > &inverse_permutation) |
void | invert_permuted_diagblocks () |
void | reinit (unsigned int nblocks, size_type blocksize, bool compress, Inversion method=gauss_jordan) |
void | inverses_computed (bool are_they) |
bool | same_diagonal () const |
bool | store_diagonals () const |
bool | inverses_ready () const |
unsigned int | size () const |
void | inverse_vmult (size_type i, Vector< number2 > &dst, const Vector< number2 > &src) const |
void | inverse_Tvmult (size_type i, Vector< number2 > &dst, const Vector< number2 > &src) const |
FullMatrix< typename MatrixType::value_type > & | inverse (size_type i) |
const FullMatrix< typename MatrixType::value_type > & | inverse (size_type i) const |
Householder< typename MatrixType::value_type > & | inverse_householder (size_type i) |
const Householder< typename MatrixType::value_type > & | inverse_householder (size_type i) const |
LAPACKFullMatrix< typename MatrixType::value_type > & | inverse_svd (size_type i) |
const LAPACKFullMatrix< typename MatrixType::value_type > & | inverse_svd (size_type i) const |
FullMatrix< typename MatrixType::value_type > & | diagonal (size_type i) |
const FullMatrix< typename MatrixType::value_type > & | diagonal (size_type i) const |
void | log_statistics () const |
Static Protected Member Functions | |
static ::ExceptionBase & | ExcDiagonalsNotStored () |
static ::ExceptionBase & | ExcInverseNotAvailable () |
Protected Attributes | |
size_type | blocksize |
SmartPointer< const MatrixType, PreconditionBlock< MatrixType, inverse_type > > | A |
double | relaxation |
std::vector< size_type > | permutation |
std::vector< size_type > | inverse_permutation |
Inversion | inversion |
Private Types | |
using | number = typename MatrixType::value_type |
using | value_type = inverse_type |
Private Attributes | |
unsigned int | n_diagonal_blocks |
std::vector< FullMatrix< typename MatrixType::value_type > > | var_inverse_full |
std::vector< Householder< typename MatrixType::value_type > > | var_inverse_householder |
std::vector< LAPACKFullMatrix< typename MatrixType::value_type > > | var_inverse_svd |
std::vector< FullMatrix< typename MatrixType::value_type > > | var_diagonal |
bool | var_store_diagonals |
bool | var_same_diagonal |
bool | var_inverses_ready |
Subscriptor functionality | |
Classes derived from Subscriptor provide a facility to subscribe to this object. This is mostly used by the SmartPointer class. | |
using | map_value_type = decltype(counter_map)::value_type |
using | map_iterator = decltype(counter_map)::iterator |
void | subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
void | unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
unsigned int | n_subscriptions () const |
template<typename StreamType > | |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
static ::ExceptionBase & | ExcInUse (int arg1, std::string arg2, std::string arg3) |
static ::ExceptionBase & | ExcNoSubscriber (std::string arg1, std::string arg2) |
std::atomic< unsigned int > | counter |
std::map< std::string, unsigned int > | counter_map |
std::vector< std::atomic< bool > * > | validity_pointers |
const std::type_info * | object_info |
static std::mutex | mutex |
void | check_no_subscribers () const noexcept |
Base class for actual block preconditioners. This class assumes the MatrixType
consisting of invertible blocks of blocksize
on the diagonal and provides the inversion of the diagonal blocks of the matrix. It is not necessary for this class that the matrix be block diagonal; rather, it applies to matrices of arbitrary structure with the minimal property of having invertible blocks on the diagonal. Still the matrix must have access to single matrix entries. Therefore, BlockMatrixArray and similar classes are not a possible matrix class template arguments.
The block matrix structure used by this class is given, e.g., for the DG method for the transport equation. For a downstream numbering the matrices even have got a block lower left matrix structure, i.e. the matrices are empty above the diagonal blocks.
For all matrices that are empty above and below the diagonal blocks (i.e. for all block diagonal matrices) the BlockJacobi
preconditioner is a direct solver. For all matrices that are empty only above the diagonal blocks (e.g. the matrices one gets by the DG method with downstream numbering) BlockSOR
is a direct solver.
This first implementation of the PreconditionBlock
assumes the matrix has blocks each of the same block size. Varying block sizes within the matrix must still be implemented if needed.
The first template parameter denotes the type of number representation in the sparse matrix, the second denotes the type of number representation in which the inverted diagonal block matrices are stored within this class by invert_diagblocks()
. If you don't want to use the block inversion as an exact solver, but rather as a preconditioner, you may probably want to store the inverted blocks with less accuracy than the original matrix; for example, number==double, inverse_type=float
might be a viable choice.
Definition at line 82 of file precondition_block.h.
|
inherited |
Choose a method for inverting the blocks, and thus the data type for the inverses.
Definition at line 70 of file precondition_block_base.h.
|
inlineinherited |
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 110 of file precondition_block_base.h.
|
inlineinherited |
Tell the class that inverses are computed.
Definition at line 119 of file precondition_block_base.h.
|
inlineinherited |
Does the matrix use only one diagonal block?
Definition at line 125 of file precondition_block_base.h.
|
inlineinherited |
Check, whether diagonal blocks (not their inverses) should be stored.
Definition at line 131 of file precondition_block_base.h.
|
inlineinherited |
Return true, if inverses are ready for use.
Definition at line 137 of file precondition_block_base.h.
|
inlineinherited |
The number of blocks.
Definition at line 143 of file precondition_block_base.h.
|
inlineinherited |
Multiply with the inverse block at position i
.
Definition at line 150 of file precondition_block_base.h.
|
inlineinherited |
Multiply with the transposed inverse block at position i
.
Definition at line 159 of file precondition_block_base.h.
|
inlineinherited |
Access to the inverse diagonal blocks if Inversion is gauss_jordan.
Definition at line 167 of file precondition_block_base.h.
|
inlineinherited |
Access to the inverse diagonal blocks.
Definition at line 185 of file precondition_block_base.h.
|
inlineinherited |
Access to the inverse diagonal blocks if Inversion is householder.
Definition at line 173 of file precondition_block_base.h.
|
inlineinherited |
Access to the inverse diagonal blocks if Inversion is householder.
Definition at line 191 of file precondition_block_base.h.
|
inlineinherited |
Access to the inverse diagonal blocks if Inversion is householder.
Definition at line 179 of file precondition_block_base.h.
|
inlineinherited |
Access to the inverse diagonal blocks if Inversion is householder.
Definition at line 197 of file precondition_block_base.h.
|
inlineinherited |
Access to the diagonal blocks.
Definition at line 203 of file precondition_block_base.h.
|
inlineinherited |
Access to the diagonal blocks.
Definition at line 209 of file precondition_block_base.h.
|
inlineinherited |
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 217 of file precondition_block_base.h.
|
staticinherited |
You are trying to access a diagonal block (not its inverse), but you decided not to store the diagonal blocks.
|
staticinherited |
You are accessing a diagonal block, assuming that it has a certain type. But, the method used for inverting the diagonal blocks does not use this type
|
protectedinherited |
The method used for inverting blocks.
Definition at line 243 of file precondition_block_base.h.
|
privateinherited |
The number of (inverse) diagonal blocks, if only one is stored.
Definition at line 249 of file precondition_block_base.h.
|
privateinherited |
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 257 of file precondition_block_base.h.
|
privateinherited |
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 265 of file precondition_block_base.h.
|
privateinherited |
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 273 of file precondition_block_base.h.
|
privateinherited |
Storage of the original diagonal blocks.
Used by the blocked SSOR method.
Definition at line 280 of file precondition_block_base.h.
|
privateinherited |
This is true, if the field var_diagonal is to be used.
Definition at line 286 of file precondition_block_base.h.
|
privateinherited |
This is true, if only one inverse is stored.
Definition at line 291 of file precondition_block_base.h.
|
privateinherited |
The inverse matrices are usable. Set by the parent class via inverses_computed().
Definition at line 297 of file precondition_block_base.h.