Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
Public Types | Public Member Functions | Protected Member Functions | List of all members
PreconditionBlockSOR< MatrixType, inverse_type > Class Template Reference

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

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

Public Types

using size_type = types::global_dof_index
 
using number = typename MatrixType::value_type
 

Public Member Functions

 PreconditionBlockSOR ()
 
template<typename number2 >
void vmult (Vector< number2 > &, const Vector< number2 > &) const
 
template<typename number2 >
void vmult_add (Vector< number2 > &, const Vector< number2 > &) const
 
template<typename number2 >
void Tvmult (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
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
 Subscriptor (Subscriptor &&) noexcept
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
Subscriptoroperator= (Subscriptor &&) noexcept
 
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)
 

Protected Member Functions

 PreconditionBlockSOR (bool store)
 
template<typename number2 >
void forward (Vector< number2 > &, const Vector< number2 > &, const bool transpose_diagonal, const bool adding) const
 
template<typename number2 >
void backward (Vector< number2 > &, const Vector< number2 > &, const bool transpose_diagonal, const bool adding) const
 
- Protected Member Functions inherited from PreconditionBlock< MatrixType, inverse_type >
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 ()
 
 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
 
- Protected Member Functions inherited from PreconditionBlockBase< inverse_type >
 PreconditionBlockBase (bool store_diagonals=false, Inversion method=gauss_jordan)
 
 ~PreconditionBlockBase ()=default
 
void clear ()
 
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< inverse_type > & inverse (size_type i)
 
const FullMatrix< inverse_type > & inverse (size_type i) const
 
Householder< inverse_type > & inverse_householder (size_type i)
 
const Householder< inverse_type > & inverse_householder (size_type i) const
 
LAPACKFullMatrix< inverse_type > & inverse_svd (size_type i)
 
const LAPACKFullMatrix< inverse_type > & inverse_svd (size_type i) const
 
FullMatrix< inverse_type > & diagonal (size_type i)
 
const FullMatrix< inverse_type > & diagonal (size_type i) const
 
void log_statistics () const
 
std::size_t memory_consumption () const
 

Additional Inherited Members

- Static Public Member Functions inherited from Subscriptor
static ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)
 
- Protected Types inherited from PreconditionBlock< MatrixType, inverse_type >
using size_type = types::global_dof_index
 
- Protected Types inherited from PreconditionBlockBase< inverse_type >
enum  Inversion
 
using size_type = types::global_dof_index
 
- Static Protected Member Functions inherited from PreconditionBlock< MatrixType, inverse_type >
static ::ExceptionBaseExcWrongBlockSize (int arg1, int arg2)
 
static ::ExceptionBaseExcInverseMatricesAlreadyExist ()
 
- Static Protected Member Functions inherited from PreconditionBlockBase< inverse_type >
static ::ExceptionBaseExcDiagonalsNotStored ()
 
static ::ExceptionBaseExcInverseNotAvailable ()
 
- Protected Attributes inherited from PreconditionBlock< MatrixType, inverse_type >
size_type blocksize
 
SmartPointer< const MatrixType, PreconditionBlock< MatrixType, inverse_type > > A
 
double relaxation
 
std::vector< size_typepermutation
 
std::vector< size_typeinverse_permutation
 
- Protected Attributes inherited from PreconditionBlockBase< inverse_type >
Inversion inversion
 

Detailed Description

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

Block SOR preconditioning. This class satisfies the relaxation concept.

The functions vmult and Tvmult execute a (transposed) block-SOR step, based on the blocks in PreconditionBlock. The elements outside the diagonal blocks may be distributed arbitrarily.

See PreconditionBlock for requirements on the matrix. The blocks used in this class must be contiguous and non-overlapping. An overlapping Schwarz relaxation method can be found in RelaxationBlockSOR; that class does not offer preconditioning, though.

Permutations

Optionally, the entries of the source vector can be treated in the order of the indices in the permutation vector set by set_permutation (or the opposite order for Tvmult()). The inverse permutation is used for storing elements back into this vector. This functionality is automatically enabled after a call to set_permutation() with vectors of nonzero size.

Note
The diagonal blocks, like the matrix, are not permuted! Therefore, the permutation vector can only swap whole blocks. It may not change the order inside blocks or swap single indices between blocks.

Instantiations

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).
Author
Ralf Hartmann, Guido Kanschat, 1999, 2000, 2001, 2002, 2003

Definition at line 661 of file precondition_block.h.

Member Typedef Documentation

◆ size_type

template<typename MatrixType , typename inverse_type = typename MatrixType::value_type>
using PreconditionBlockSOR< MatrixType, inverse_type >::size_type = types::global_dof_index

Declare type for container size.

Definition at line 669 of file precondition_block.h.

◆ number

template<typename MatrixType , typename inverse_type = typename MatrixType::value_type>
using PreconditionBlockSOR< MatrixType, inverse_type >::number = typename MatrixType::value_type

Define number type of matrix.

Definition at line 679 of file precondition_block.h.

Constructor & Destructor Documentation

◆ PreconditionBlockSOR() [1/2]

template<typename MatrixType , typename inverse_type = typename MatrixType::value_type>
PreconditionBlockSOR< MatrixType, inverse_type >::PreconditionBlockSOR ( )

Default constructor.

◆ PreconditionBlockSOR() [2/2]

template<typename MatrixType , typename inverse_type = typename MatrixType::value_type>
PreconditionBlockSOR< MatrixType, inverse_type >::PreconditionBlockSOR ( bool  store)
protected

Constructor to be used by PreconditionBlockSSOR.

Member Function Documentation

◆ vmult()

template<typename MatrixType , typename inverse_type = typename MatrixType::value_type>
template<typename number2 >
template void PreconditionBlockSOR< MatrixType, inverse_type >::vmult< double > ( Vector< number2 > &  ,
const Vector< number2 > &   
) const

Execute block SOR preconditioning.

This function will automatically use the inverse matrices if they exist, if not then BlockSOR will waste much time inverting the diagonal block matrices in each preconditioning step.

For matrices which are empty above the diagonal blocks BlockSOR is a direct solver.

◆ vmult_add()

template<typename MatrixType , typename inverse_type = typename MatrixType::value_type>
template<typename number2 >
template void PreconditionBlockSOR< MatrixType, inverse_type >::vmult_add< double > ( Vector< number2 > &  ,
const Vector< number2 > &   
) const

Execute block SOR preconditioning.

Warning: this function performs normal vmult without adding. The reason for its existence is that BlockMatrixArray requires the adding version by default. On the other hand, adding requires an additional auxiliary vector, which is not desirable.

See also
vmult

◆ Tvmult()

template<typename MatrixType , typename inverse_type = typename MatrixType::value_type>
template<typename number2 >
template void PreconditionBlockSOR< MatrixType, inverse_type >::Tvmult< double > ( Vector< number2 > &  ,
const Vector< number2 > &   
) const

Backward application of vmult().

In the current implementation, this is not the transpose of vmult(). It is a transposed Gauss-Seidel algorithm applied to the whole matrix, but the diagonal blocks being inverted are not transposed. Therefore, it is the transposed, if the diagonal blocks are symmetric.

◆ Tvmult_add()

template<typename MatrixType , typename inverse_type = typename MatrixType::value_type>
template<typename number2 >
template void PreconditionBlockSOR< MatrixType, inverse_type >::Tvmult_add< double > ( Vector< number2 > &  ,
const Vector< number2 > &   
) const

Execute backward block SOR preconditioning.

Warning: this function performs normal vmult without adding. The reason for its existence is that BlockMatrixArray requires the adding version by default. On the other hand, adding requires an additional auxiliary vector, which is not desirable.

See also
vmult

◆ step()

template<typename MatrixType , typename inverse_type = typename MatrixType::value_type>
template<typename number2 >
void PreconditionBlockSOR< MatrixType, inverse_type >::step ( Vector< number2 > &  dst,
const Vector< number2 > &  rhs 
) const

Perform one step of the SOR iteration.

◆ Tstep()

template<typename MatrixType , typename inverse_type = typename MatrixType::value_type>
template<typename number2 >
void PreconditionBlockSOR< MatrixType, inverse_type >::Tstep ( Vector< number2 > &  dst,
const Vector< number2 > &  rhs 
) const

Perform one step of the transposed SOR iteration.

◆ forward()

template<typename MatrixType , typename inverse_type = typename MatrixType::value_type>
template<typename number2 >
void PreconditionBlockSOR< MatrixType, inverse_type >::forward ( Vector< number2 > &  ,
const Vector< number2 > &  ,
const bool  transpose_diagonal,
const bool  adding 
) const
protected

Implementation of the forward substitution loop called by vmult() and vmult_add().

If a permutation is set by set_permutation(), it will automatically be honored by this function.

The parameter adding does not have any function, yet.

◆ backward()

template<typename MatrixType , typename inverse_type = typename MatrixType::value_type>
template<typename number2 >
void PreconditionBlockSOR< MatrixType, inverse_type >::backward ( Vector< number2 > &  ,
const Vector< number2 > &  ,
const bool  transpose_diagonal,
const bool  adding 
) const
protected

Implementation of the backward substitution loop called by Tvmult() and Tvmult_add().

If a permutation is set by set_permutation(), it will automatically be honored by this function.

The parameter adding does not have any function, yet.


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