Public Types | |
| enum | Inversion { gauss_jordan, householder, svd } |
Public Member Functions | |
| PreconditionBlockBase (bool store_diagonals=false, Inversion method=gauss_jordan) | |
| ~PreconditionBlockBase () | |
| void | clear () |
| void | reinit (unsigned int nblocks, unsigned int blocksize, bool compress, Inversion method=gauss_jordan) |
| void | inverses_computed (bool are_they) |
| void | set_same_diagonal () |
| bool | same_diagonal () const |
| bool | store_diagonals () const |
| bool | inverses_ready () const |
| bool | empty () const |
| unsigned int | size () const |
| number | el (unsigned int i, unsigned int j) const |
| template<typename number2 > | |
| void | inverse_vmult (unsigned int i, Vector< number2 > &dst, const Vector< number2 > &src) const |
| template<typename number2 > | |
| void | inverse_Tvmult (unsigned int i, Vector< number2 > &dst, const Vector< number2 > &src) const |
| FullMatrix< number > & | inverse (unsigned int i) |
| Householder< number > & | inverse_householder (unsigned int i) |
| LAPACKFullMatrix< number > & | inverse_svd (unsigned int i) |
| const FullMatrix< number > & | inverse (unsigned int i) const |
| const Householder< number > & | inverse_householder (unsigned int i) const |
| const LAPACKFullMatrix< number > & | inverse_svd (unsigned int i) const |
| FullMatrix< number > & | diagonal (unsigned int i) |
| const FullMatrix< number > & | diagonal (unsigned int i) const |
| unsigned int | memory_consumption () const |
Static Public Member Functions | |
| ::ExceptionBase & | ExcDiagonalsNotStored () |
| ::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 |
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.
| enum PreconditionBlockBase::Inversion |
Choose a method for inverting the blocks, and thus the data type for the inverses.
| 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. |
| PreconditionBlockBase< number >::PreconditionBlockBase | ( | bool | store_diagonals = false, |
| Inversion | method = gauss_jordan |
||
| ) | [inline] |
Constructor initializing default values.
| PreconditionBlockBase< number >::~PreconditionBlockBase | ( | ) |
The virtual destructor
| void PreconditionBlockBase< number >::clear | ( | ) | [inline] |
Deletes the inverse diagonal block matrices if existent hence leaves the class in the state that it had directly after calling the constructor.
Reimplemented in PreconditionBlock< MATRIX, inverse_type >, and RelaxationBlock< MATRIX, inverse_type >.
| void PreconditionBlockBase< number >::reinit | ( | unsigned int | nblocks, |
| unsigned int | blocksize, | ||
| bool | compress, | ||
| Inversion | method = gauss_jordan |
||
| ) | [inline] |
Resize to this number of diagonal blocks with the given block size. If compress is true, then only one block will be stored.
References Assert, StandardExceptions::ExcNotImplemented(), and LAPACKSupport::svd.
| void PreconditionBlockBase< number >::inverses_computed | ( | bool | are_they | ) | [inline] |
Tell the class that inverses are computed.
| void PreconditionBlockBase< number >::set_same_diagonal | ( | ) |
Use only the inverse of the first diagonal block to save memory and computation time.
Possible applications: computing on a cartesian grid, all diagonal blocks are the same or all diagonal blocks are at least similar and inversion of one of them still yields a preconditioner.
| bool PreconditionBlockBase< number >::same_diagonal | ( | ) | const [inline] |
Does the matrix use only one diagonal block?
| bool PreconditionBlockBase< number >::store_diagonals | ( | ) | const [inline] |
Check, whether diagonal blocks (not their inverses) should be stored.
| bool PreconditionBlockBase< number >::inverses_ready | ( | ) | const [inline] |
Return true, if inverses are ready for use.
| bool PreconditionBlockBase< number >::empty | ( | ) | const |
Checks whether the object is empty.
Reimplemented in PreconditionBlock< MATRIX, inverse_type >, and RelaxationBlock< MATRIX, inverse_type >.
| unsigned int PreconditionBlockBase< number >::size | ( | ) | const [inline] |
The number of blocks.
| number PreconditionBlockBase< number >::el | ( | unsigned int | i, |
| unsigned int | j | ||
| ) | const |
Read-only access to entries. This function is only possible if the inverse diagonal blocks are stored.
Reimplemented in PreconditionBlock< MATRIX, inverse_type >, and RelaxationBlock< MATRIX, inverse_type >.
| void PreconditionBlockBase< number >::inverse_vmult | ( | unsigned int | i, |
| Vector< number2 > & | dst, | ||
| const Vector< number2 > & | src | ||
| ) | const [inline] |
Multiply with the inverse block at position i.
References Assert, AssertIndexRange, StandardExceptions::ExcNotImplemented(), LAPACKSupport::svd, and LAPACKSupport::U.
| void PreconditionBlockBase< number >::inverse_Tvmult | ( | unsigned int | i, |
| Vector< number2 > & | dst, | ||
| const Vector< number2 > & | src | ||
| ) | const [inline] |
Multiply with the transposed inverse block at position i.
References Assert, AssertIndexRange, StandardExceptions::ExcNotImplemented(), LAPACKSupport::svd, and LAPACKSupport::U.
| FullMatrix< number > & PreconditionBlockBase< number >::inverse | ( | unsigned int | i | ) | [inline] |
Access to the inverse diagonal blocks if Inversion is gauss_jordan.
References Assert, and StandardExceptions::ExcIndexRange().
| Householder< number > & PreconditionBlockBase< number >::inverse_householder | ( | unsigned int | i | ) | [inline] |
Access to the inverse diagonal blocks if Inversion is householder.
References Assert, and AssertIndexRange.
| LAPACKFullMatrix< number > & PreconditionBlockBase< number >::inverse_svd | ( | unsigned int | i | ) | [inline] |
Access to the inverse diagonal blocks if Inversion is householder.
References Assert, and AssertIndexRange.
| const FullMatrix< number > & PreconditionBlockBase< number >::inverse | ( | unsigned int | i | ) | const [inline] |
Access to the inverse diagonal blocks.
References Assert, and StandardExceptions::ExcIndexRange().
| const Householder< number > & PreconditionBlockBase< number >::inverse_householder | ( | unsigned int | i | ) | const [inline] |
Access to the inverse diagonal blocks if Inversion is householder.
References AssertIndexRange.
| const LAPACKFullMatrix< number > & PreconditionBlockBase< number >::inverse_svd | ( | unsigned int | i | ) | const [inline] |
Access to the inverse diagonal blocks if Inversion is householder.
References AssertIndexRange.
| FullMatrix< number > & PreconditionBlockBase< number >::diagonal | ( | unsigned int | i | ) | [inline] |
Access to the diagonal blocks.
References Assert, and StandardExceptions::ExcIndexRange().
| const FullMatrix< number > & PreconditionBlockBase< number >::diagonal | ( | unsigned int | i | ) | const [inline] |
Access to the diagonal blocks.
References Assert, and StandardExceptions::ExcIndexRange().
| unsigned int PreconditionBlockBase< number >::memory_consumption | ( | ) | const [inline] |
Determine an estimate for the memory consumption (in bytes) of this object.
Reimplemented in PreconditionBlock< MATRIX, inverse_type >.
References MemoryConsumption::memory_consumption().
| ::ExceptionBase& PreconditionBlockBase< number >::ExcDiagonalsNotStored | ( | ) | [static] |
You are trying to access a diagonal block (not its inverse), but you decided not to store the diagonal blocks.
| ::ExceptionBase& PreconditionBlockBase< number >::ExcInverseNotAvailable | ( | ) | [static] |
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
Inversion PreconditionBlockBase< number >::inversion [protected] |
The method used for inverting blocks.
unsigned int PreconditionBlockBase< number >::n_diagonal_blocks [private] |
The number of (inverse) diagonal blocks, if only one is stored.
std::vector<FullMatrix<number> > PreconditionBlockBase< number >::var_inverse_full [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.
std::vector<Householder<number> > PreconditionBlockBase< number >::var_inverse_householder [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.
std::vector<LAPACKFullMatrix<number> > PreconditionBlockBase< number >::var_inverse_svd [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.
std::vector<FullMatrix<number> > PreconditionBlockBase< number >::var_diagonal [private] |
Storage of the original diagonal blocks.
Used by the blocked SSOR method.
bool PreconditionBlockBase< number >::var_store_diagonals [private] |
This is true, if the field var_diagonal is to be used.
bool PreconditionBlockBase< number >::var_same_diagonal [private] |
This is true, if only one inverse is stored.
bool PreconditionBlockBase< number >::var_inverses_ready [private] |
The inverse matrices are usable. Set by the parent class via inverses_computed().
documentation generated on Fri Aug 12 2011 15:01:05 by
doxygen
1.7.4