PreconditionBlockSOR< MATRIX, inverse_type > Class Template Reference
[Preconditioners]

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

List of all members.

Public Types

typedef MATRIX::value_type number

Public Member Functions

void set_permutation (const std::vector< unsigned int > &permutation, const std::vector< unsigned int > &inverse_permutation)
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

Protected Member Functions

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

Private Attributes

std::vector< unsigned intpermutation
std::vector< unsigned intinverse_permutation

Detailed Description

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

Block SOR preconditioning.

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.

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 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

Member Typedef Documentation

template<class MATRIX , typename inverse_type = typename MATRIX::value_type>
typedef MATRIX::value_type PreconditionBlockSOR< MATRIX, inverse_type >::number

Define number type of matrix.

Reimplemented from PreconditionBlock< MATRIX, inverse_type >.

Reimplemented in PreconditionBlockSSOR< MATRIX, inverse_type >.


Member Function Documentation

template<class MATRIX , typename inverse_type = typename MATRIX::value_type>
void PreconditionBlockSOR< MATRIX, inverse_type >::set_permutation ( const std::vector< unsigned int > &  permutation,
const std::vector< unsigned int > &  inverse_permutation 
)

Set the permutation and its inverse. These vectors are copied into private data, so they can be reused or deleted after a call to this function.

template<class MATRIX , typename inverse_type = typename MATRIX::value_type>
template<typename number2 >
void PreconditionBlockSOR< MATRIX, inverse_type >::vmult ( Vector< number2 > &  ,
const Vector< number2 > &   
) const [inline]

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.

Reimplemented in PreconditionBlockSSOR< MATRIX, inverse_type >.

template<class MATRIX , typename inverse_type = typename MATRIX::value_type>
template<typename number2 >
void PreconditionBlockSOR< MATRIX, inverse_type >::vmult_add ( Vector< number2 > &  ,
const Vector< number2 > &   
) const [inline]

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
template<class MATRIX , typename inverse_type = typename MATRIX::value_type>
template<typename number2 >
void PreconditionBlockSOR< MATRIX, inverse_type >::Tvmult ( Vector< number2 > &  ,
const Vector< number2 > &   
) const [inline]

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.

Reimplemented in PreconditionBlockSSOR< MATRIX, inverse_type >.

template<class MATRIX , typename inverse_type = typename MATRIX::value_type>
template<typename number2 >
void PreconditionBlockSOR< MATRIX, inverse_type >::Tvmult_add ( Vector< number2 > &  ,
const Vector< number2 > &   
) const [inline]

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
template<class MATRIX , typename inverse_type = typename MATRIX::value_type>
template<typename number2 >
void PreconditionBlockSOR< MATRIX, inverse_type >::forward ( Vector< number2 > &  ,
const Vector< number2 > &  ,
const bool  transpose_diagonal,
const bool  adding 
) const [inline, 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.

template<class MATRIX , typename inverse_type = typename MATRIX::value_type>
template<typename number2 >
void PreconditionBlockSOR< MATRIX, inverse_type >::backward ( Vector< number2 > &  ,
const Vector< number2 > &  ,
const bool  transpose_diagonal,
const bool  adding 
) const [inline, 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.


Member Data Documentation

template<class MATRIX , typename inverse_type = typename MATRIX::value_type>
std::vector<unsigned int> PreconditionBlockSOR< MATRIX, inverse_type >::permutation [private]

The permutation vector

template<class MATRIX , typename inverse_type = typename MATRIX::value_type>
std::vector<unsigned int> PreconditionBlockSOR< MATRIX, inverse_type >::inverse_permutation [private]

The inverse permutation vector


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

deal.II documentation generated on Mon Nov 23 22:58:00 2009 by doxygen 1.6.1