Reference documentation for deal.II version 9.4.1
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
PreconditionBlockJacobi< MatrixType, inverse_type > Class Template Reference

#include <deal.II/lac/precondition_block.h>

Inheritance diagram for PreconditionBlockJacobi< MatrixType, inverse_type >:
[legend]

Classes

class  const_iterator
 

Public Types

using size_type = types::global_dof_index
 

Public Member Functions

template<typename number2 >
void vmult (Vector< number2 > &, const Vector< number2 > &) const
 
template<typename number2 >
void Tvmult (Vector< number2 > &, const Vector< number2 > &) const
 
template<typename number2 >
void vmult_add (Vector< number2 > &, const Vector< number2 > &) const
 
template<typename number2 >
void Tvmult_add (Vector< number2 > &, const Vector< number2 > &) const
 
template<typename number2 >
void step (Vector< number2 > &dst, const Vector< number2 > &rhs) const
 
template<typename number2 >
void Tstep (Vector< number2 > &dst, const Vector< number2 > &rhs) const
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator begin (const size_type r) const
 
const_iterator end (const size_type r) const
 

Private Types

using number = typename MatrixType::value_type
 
using value_type = inverse_type
 
enum  Inversion { gauss_jordan , householder , svd }
 

Private Member Functions

template<typename number2 >
void do_vmult (Vector< number2 > &, const Vector< number2 > &, bool adding) const
 
void initialize (const MatrixType &A, const AdditionalData parameters)
 
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 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
 
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
 
template<typename number2 >
void inverse_vmult (size_type i, Vector< number2 > &dst, const Vector< number2 > &src) const
 
template<typename number2 >
void inverse_Tvmult (size_type i, Vector< number2 > &dst, const Vector< number2 > &src) const
 
FullMatrix< number > & inverse (size_type i)
 
const FullMatrix< number > & inverse (size_type i) const
 
Householder< number > & inverse_householder (size_type i)
 
const Householder< number > & inverse_householder (size_type i) const
 
LAPACKFullMatrix< number > & inverse_svd (size_type i)
 
const LAPACKFullMatrix< number > & inverse_svd (size_type i) const
 
FullMatrix< number > & diagonal (size_type i)
 
const FullMatrix< number > & diagonal (size_type i) const
 
void log_statistics () const
 

Static Private Member Functions

static ::ExceptionBaseExcWrongBlockSize (int arg1, int arg2)
 
static ::ExceptionBaseExcInverseMatricesAlreadyExist ()
 
static ::ExceptionBaseExcDiagonalsNotStored ()
 
static ::ExceptionBaseExcInverseNotAvailable ()
 

Private Attributes

size_type blocksize
 
SmartPointer< const MatrixType, PreconditionBlock< MatrixType, inverse_type > > A
 
double relaxation
 
std::vector< size_typepermutation
 
std::vector< size_typeinverse_permutation
 
Inversion inversion
 
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
 

Friends

class Accessor
 
class const_iterator
 

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)
 
void check_no_subscribers () const noexcept
 
std::atomic< unsigned intcounter
 
std::map< std::string, unsigned intcounter_map
 
std::vector< std::atomic< bool > * > validity_pointers
 
const std::type_info * object_info
 
static std::mutex mutex
 
static ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)
 

Detailed Description

template<typename MatrixType, typename inverse_type = typename MatrixType::value_type>
class PreconditionBlockJacobi< MatrixType, inverse_type >

Block Jacobi preconditioning. See PreconditionBlock for requirements on the matrix. This class satisfies the relaxation concept.

Note
Instantiations for this template are provided for <float> and <double>; others can be generated in application programs (see the section on Template instantiations in the manual).

Definition at line 378 of file precondition_block.h.

Member Enumeration Documentation

◆ Inversion

template<typename number >
enum PreconditionBlockBase::Inversion
inherited

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 70 of file precondition_block_base.h.

Member Function Documentation

◆ reinit()

template<typename number >
void PreconditionBlockBase< number >::reinit ( unsigned int  nblocks,
size_type  blocksize,
bool  compress,
Inversion  method = gauss_jordan 
)
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 333 of file precondition_block_base.h.

◆ inverses_computed()

template<typename number >
void PreconditionBlockBase< number >::inverses_computed ( bool  are_they)
inlineinherited

Tell the class that inverses are computed.

Definition at line 598 of file precondition_block_base.h.

◆ same_diagonal()

template<typename number >
bool PreconditionBlockBase< number >::same_diagonal
inlineinherited

Does the matrix use only one diagonal block?

Definition at line 582 of file precondition_block_base.h.

◆ store_diagonals()

template<typename number >
bool PreconditionBlockBase< number >::store_diagonals
inlineinherited

Check, whether diagonal blocks (not their inverses) should be stored.

Definition at line 590 of file precondition_block_base.h.

◆ inverses_ready()

template<typename number >
bool PreconditionBlockBase< number >::inverses_ready
inlineinherited

Return true, if inverses are ready for use.

Definition at line 606 of file precondition_block_base.h.

◆ size()

template<typename number >
unsigned int PreconditionBlockBase< number >::size
inlineinherited

The number of blocks.

Definition at line 411 of file precondition_block_base.h.

◆ inverse_vmult()

template<typename number >
template<typename number2 >
void PreconditionBlockBase< number >::inverse_vmult ( size_type  i,
Vector< number2 > &  dst,
const Vector< number2 > &  src 
) const
inlineinherited

Multiply with the inverse block at position i.

Definition at line 419 of file precondition_block_base.h.

◆ inverse_Tvmult()

template<typename number >
template<typename number2 >
void PreconditionBlockBase< number >::inverse_Tvmult ( size_type  i,
Vector< number2 > &  dst,
const Vector< number2 > &  src 
) const
inlineinherited

Multiply with the transposed inverse block at position i.

Definition at line 448 of file precondition_block_base.h.

◆ inverse() [1/2]

template<typename number >
FullMatrix< number > & PreconditionBlockBase< number >::inverse ( size_type  i)
inlineinherited

Access to the inverse diagonal blocks if Inversion is gauss_jordan.

Definition at line 526 of file precondition_block_base.h.

◆ inverse() [2/2]

template<typename number >
const FullMatrix< number > & PreconditionBlockBase< number >::inverse ( size_type  i) const
inlineinherited

Access to the inverse diagonal blocks.

Definition at line 476 of file precondition_block_base.h.

◆ inverse_householder() [1/2]

template<typename number >
Householder< number > & PreconditionBlockBase< number >::inverse_householder ( size_type  i)
inlineinherited

Access to the inverse diagonal blocks if Inversion is householder.

Definition at line 540 of file precondition_block_base.h.

◆ inverse_householder() [2/2]

template<typename number >
const Householder< number > & PreconditionBlockBase< number >::inverse_householder ( size_type  i) const
inlineinherited

Access to the inverse diagonal blocks if Inversion is householder.

Definition at line 488 of file precondition_block_base.h.

◆ inverse_svd() [1/2]

template<typename number >
LAPACKFullMatrix< number > & PreconditionBlockBase< number >::inverse_svd ( size_type  i)
inlineinherited

Access to the inverse diagonal blocks if Inversion is householder.

Definition at line 554 of file precondition_block_base.h.

◆ inverse_svd() [2/2]

template<typename number >
const LAPACKFullMatrix< number > & PreconditionBlockBase< number >::inverse_svd ( size_type  i) const
inlineinherited

Access to the inverse diagonal blocks if Inversion is householder.

Definition at line 500 of file precondition_block_base.h.

◆ diagonal() [1/2]

template<typename number >
FullMatrix< number > & PreconditionBlockBase< number >::diagonal ( size_type  i)
inlineinherited

Access to the diagonal blocks.

Definition at line 568 of file precondition_block_base.h.

◆ diagonal() [2/2]

template<typename number >
const FullMatrix< number > & PreconditionBlockBase< number >::diagonal ( size_type  i) const
inlineinherited

Access to the diagonal blocks.

Definition at line 512 of file precondition_block_base.h.

◆ log_statistics()

template<typename number >
void PreconditionBlockBase< number >::log_statistics
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 614 of file precondition_block_base.h.

Member Data Documentation

◆ inversion

template<typename number >
Inversion PreconditionBlockBase< number >::inversion
protectedinherited

The method used for inverting blocks.

Definition at line 243 of file precondition_block_base.h.

◆ n_diagonal_blocks

template<typename number >
unsigned int PreconditionBlockBase< number >::n_diagonal_blocks
privateinherited

The number of (inverse) diagonal blocks, if only one is stored.

Definition at line 249 of file precondition_block_base.h.

◆ var_inverse_full

template<typename number >
std::vector<FullMatrix<number> > PreconditionBlockBase< number >::var_inverse_full
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.

◆ var_inverse_householder

template<typename number >
std::vector<Householder<number> > PreconditionBlockBase< number >::var_inverse_householder
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.

◆ var_inverse_svd

template<typename number >
std::vector<LAPACKFullMatrix<number> > PreconditionBlockBase< number >::var_inverse_svd
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.

◆ var_diagonal

template<typename number >
std::vector<FullMatrix<number> > PreconditionBlockBase< number >::var_diagonal
privateinherited

Storage of the original diagonal blocks.

Used by the blocked SSOR method.

Definition at line 280 of file precondition_block_base.h.

◆ var_store_diagonals

template<typename number >
bool PreconditionBlockBase< number >::var_store_diagonals
privateinherited

This is true, if the field var_diagonal is to be used.

Definition at line 286 of file precondition_block_base.h.

◆ var_same_diagonal

template<typename number >
bool PreconditionBlockBase< number >::var_same_diagonal
privateinherited

This is true, if only one inverse is stored.

Definition at line 291 of file precondition_block_base.h.

◆ var_inverses_ready

template<typename number >
bool PreconditionBlockBase< number >::var_inverses_ready
privateinherited

The inverse matrices are usable. Set by the parent class via inverses_computed().

Definition at line 297 of file precondition_block_base.h.


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