Reference documentation for deal.II version 9.2.0
\(\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\}}\)
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | List of all members
RelaxationBlock< MatrixType, InverseNumberType, VectorType > Class Template Reference

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

Inheritance diagram for RelaxationBlock< MatrixType, InverseNumberType, VectorType >:
[legend]

Classes

class  AdditionalData
 

Public Types

using size_type = types::global_dof_index
 

Public Member Functions

void initialize (const MatrixType &A, const AdditionalData &parameters)
 
void clear ()
 
void invert_diagblocks ()
 

Protected Member Functions

void do_step (VectorType &dst, const VectorType &prev, const VectorType &src, const bool backward) const
 
- Protected Member Functions inherited from PreconditionBlockBase< typename MatrixType::value_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< 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
 
std::size_t memory_consumption () const
 

Protected Attributes

SmartPointer< const MatrixType, RelaxationBlock< MatrixType, InverseNumberType, VectorType > > A
 
SmartPointer< const AdditionalData, RelaxationBlock< MatrixType, InverseNumberType, VectorType > > additional_data
 
- Protected Attributes inherited from PreconditionBlockBase< typename MatrixType::value_type >
Inversion inversion
 

Private Types

using number = typename MatrixType::value_type
 
using value_type = InverseNumberType
 

Private Member Functions

void block_kernel (const size_type block_begin, const size_type block_end)
 

Additional Inherited Members

- Protected Types inherited from PreconditionBlockBase< typename MatrixType::value_type >
enum  Inversion
 
using size_type = types::global_dof_index
 
- Static Protected Member Functions inherited from PreconditionBlockBase< typename MatrixType::value_type >
static ::ExceptionBaseExcDiagonalsNotStored ()
 
static ::ExceptionBaseExcInverseNotAvailable ()
 

Detailed Description

template<typename MatrixType, typename InverseNumberType = typename MatrixType::value_type, typename VectorType = Vector<double>>
class RelaxationBlock< MatrixType, InverseNumberType, VectorType >

Base class for the implementation of overlapping, multiplicative Schwarz relaxation methods and smoothers.

This class uses the infrastructure provided by PreconditionBlockBase. It adds functions to initialize with a block list and to do the relaxation step. The actual relaxation method with the interface expected by SolverRelaxation and MGSmootherRelaxation is in the derived classes.

This class allows for more general relaxation methods than PreconditionBlock, since the index sets may be arbitrary and overlapping, while there only contiguous, disjoint sets of equal size are allowed. As a drawback, this class cannot be used as a preconditioner, since its implementation relies on a straight forward implementation of the Gauss- Seidel process.

Parallel computations require you to specify an initialized ghost vector in AdditionalData::temp_ghost_vector.

Author
Guido Kanschat
Date
2010

Definition at line 59 of file relaxation_block.h.

Member Typedef Documentation

◆ number

template<typename MatrixType , typename InverseNumberType = typename MatrixType::value_type, typename VectorType = Vector<double>>
using RelaxationBlock< MatrixType, InverseNumberType, VectorType >::number = typename MatrixType::value_type
private

Define number type of matrix.

Definition at line 65 of file relaxation_block.h.

◆ value_type

template<typename MatrixType , typename InverseNumberType = typename MatrixType::value_type, typename VectorType = Vector<double>>
using RelaxationBlock< MatrixType, InverseNumberType, VectorType >::value_type = InverseNumberType
private

Value type for inverse matrices.

Definition at line 70 of file relaxation_block.h.

◆ size_type

template<typename MatrixType , typename InverseNumberType = typename MatrixType::value_type, typename VectorType = Vector<double>>
using RelaxationBlock< MatrixType, InverseNumberType, VectorType >::size_type = types::global_dof_index

Declare type for container size.

Definition at line 76 of file relaxation_block.h.

Member Function Documentation

◆ initialize()

template<typename MatrixType , typename InverseNumberType = typename MatrixType::value_type, typename VectorType = Vector<double>>
void RelaxationBlock< MatrixType, InverseNumberType, VectorType >::initialize ( const MatrixType &  A,
const AdditionalData parameters 
)

Initialize matrix and additional information. In a second step, the inverses of the diagonal blocks may be computed.

Note that AdditionalData, different from other preconditioners, defines quite large objects, and that therefore the object is not copied, but rather a pointer is stored. Thus, the lifetime of additional_data hast to exceed the lifetime of this object.

◆ clear()

template<typename MatrixType , typename InverseNumberType = typename MatrixType::value_type, typename VectorType = Vector<double>>
void RelaxationBlock< MatrixType, InverseNumberType, VectorType >::clear ( )

Deletes the inverse diagonal block matrices if existent, sets the blocksize to 0, hence leaves the class in the state that it had directly after calling the constructor.

◆ invert_diagblocks()

template<typename MatrixType , typename InverseNumberType = typename MatrixType::value_type, typename VectorType = Vector<double>>
void RelaxationBlock< MatrixType, InverseNumberType, VectorType >::invert_diagblocks ( )

Stores the inverse of the diagonal blocks in inverse. This costs some additional memory - for DG methods about 1/3 (for double inverses) or 1/6 (for float inverses) of that used for the matrix - but it makes the preconditioning much faster.

It is not allowed to call this function twice (will produce an error) before a call of clear(...) because at the second time there already exist the inverse matrices.

After this function is called, the lock on the matrix given through the use_matrix function is released, i.e. you may overwrite of delete it. You may want to do this in case you use this matrix to precondition another matrix.

◆ do_step()

template<typename MatrixType , typename InverseNumberType = typename MatrixType::value_type, typename VectorType = Vector<double>>
void RelaxationBlock< MatrixType, InverseNumberType, VectorType >::do_step ( VectorType dst,
const VectorType prev,
const VectorType src,
const bool  backward 
) const
protected

Perform one block relaxation step.

Depending on the arguments dst and pref, this performs an SOR step (both reference the same vector) or a Jacobi step (both are different vectors). For the Jacobi step, the calling function must copy dst to prev after this.

◆ block_kernel()

template<typename MatrixType , typename InverseNumberType = typename MatrixType::value_type, typename VectorType = Vector<double>>
void RelaxationBlock< MatrixType, InverseNumberType, VectorType >::block_kernel ( const size_type  block_begin,
const size_type  block_end 
)
private

Computes (the inverse of) a range of blocks.

Member Data Documentation

◆ A

template<typename MatrixType , typename InverseNumberType = typename MatrixType::value_type, typename VectorType = Vector<double>>
SmartPointer<const MatrixType, RelaxationBlock<MatrixType, InverseNumberType, VectorType> > RelaxationBlock< MatrixType, InverseNumberType, VectorType >::A
protected

Pointer to the matrix. Make sure that the matrix exists as long as this class needs it, i.e. until calling invert_diagblocks, or (if the inverse matrices should not be stored) until the last call of the preconditioning vmult function of the derived classes.

Definition at line 255 of file relaxation_block.h.

◆ additional_data

template<typename MatrixType , typename InverseNumberType = typename MatrixType::value_type, typename VectorType = Vector<double>>
SmartPointer<const AdditionalData, RelaxationBlock<MatrixType, InverseNumberType, VectorType> > RelaxationBlock< MatrixType, InverseNumberType, VectorType >::additional_data
protected

Control information.

Definition at line 262 of file relaxation_block.h.


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