All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Protected Member Functions | List of all members
PreconditionBlockSOR< MATRIX, inverse_type > Class Template Reference
Inheritance diagram for PreconditionBlockSOR< MATRIX, inverse_type >:
Inheritance graph
[legend]

Public Types

typedef types::global_dof_index size_type
 
typedef MATRIX::value_type number
 

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 &)
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
void subscribe (const char *identifier=0) const
 
void unsubscribe (const char *identifier=0) const
 
unsigned int n_subscriptions () const
 
void list_subscribers () const
 
 DeclException3 (ExcInUse, int, char *, std::string &,<< "Object of class "<< arg2<< " is still used by "<< arg1<< " other objects.\n"<< "(Additional information: "<< arg3<< ")\n"<< "Note the entry in the Frequently Asked Questions of "<< "deal.II (linked to from http://www.dealii.org/) for "<< "more information on what this error means.")
 
 DeclException2 (ExcNoSubscriber, char *, char *,<< "No subscriber with identifier \""<< arg2<< "\" did subscribe to this object of class "<< arg1)
 
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< MATRIX, inverse_type >
 PreconditionBlock (bool store_diagonals=false)
 
 ~PreconditionBlock ()
 
void initialize (const MATRIX &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
 
unsigned int n_blocks () const DEAL_II_DEPRECATED
 
std::size_t memory_consumption () const
 
 DeclException2 (ExcWrongBlockSize, int, int,<< "The blocksize "<< arg1<< " and the size of the matrix "<< arg2<< " do not match.")
 
 DeclException0 (ExcInverseMatricesAlreadyExist)
 
void initialize (const MATRIX &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 (const std::vector< size_type > &permutation, const std::vector< size_type > &inverse_permutation)
 

Additional Inherited Members

- Protected Types inherited from PreconditionBlock< MATRIX, inverse_type >
typedef types::global_dof_index size_type
 

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. 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 776 of file precondition_block.h.

Member Typedef Documentation

template<class MATRIX , typename inverse_type = typename MATRIX::value_type>
typedef types::global_dof_index PreconditionBlockSOR< MATRIX, inverse_type >::size_type

Declare type for container size.

Definition at line 783 of file precondition_block.h.

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

Define number type of matrix.

Definition at line 793 of file precondition_block.h.

Constructor & Destructor Documentation

template<class MATRIX , typename inverse_type >
PreconditionBlockSOR< MATRIX, inverse_type >::PreconditionBlockSOR ( )

Default constructor.

Definition at line 709 of file precondition_block.templates.h.

template<class MATRIX , typename inverse_type >
PreconditionBlockSOR< MATRIX, inverse_type >::PreconditionBlockSOR ( bool  store)
protected

Constructor to be used by PreconditionBlockSSOR.

Definition at line 715 of file precondition_block.templates.h.

Member Function Documentation

template<class MATRIX , typename inverse_type >
template<typename number2 >
void PreconditionBlockSOR< MATRIX, inverse_type >::vmult ( Vector< number2 > &  dst,
const Vector< number2 > &  src 
) 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.

Definition at line 910 of file precondition_block.templates.h.

template<class MATRIX , typename inverse_type >
template<typename number2 >
void PreconditionBlockSOR< MATRIX, inverse_type >::vmult_add ( Vector< number2 > &  dst,
const Vector< number2 > &  src 
) 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

Definition at line 920 of file precondition_block.templates.h.

template<class MATRIX , typename inverse_type >
template<typename number2 >
void PreconditionBlockSOR< MATRIX, inverse_type >::Tvmult ( Vector< number2 > &  dst,
const Vector< number2 > &  src 
) 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.

Definition at line 930 of file precondition_block.templates.h.

template<class MATRIX , typename inverse_type >
template<typename number2 >
void PreconditionBlockSOR< MATRIX, inverse_type >::Tvmult_add ( Vector< number2 > &  dst,
const Vector< number2 > &  src 
) 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

Definition at line 940 of file precondition_block.templates.h.

template<class MATRIX , typename inverse_type >
template<typename number2 >
void PreconditionBlockSOR< MATRIX, inverse_type >::step ( Vector< number2 > &  dst,
const Vector< number2 > &  rhs 
) const

Perform one step of the SOR iteration.

Definition at line 951 of file precondition_block.templates.h.

template<class MATRIX , typename inverse_type >
template<typename number2 >
void PreconditionBlockSOR< MATRIX, inverse_type >::Tstep ( Vector< number2 > &  dst,
const Vector< number2 > &  rhs 
) const

Perform one step of the transposed SOR iteration.

Definition at line 961 of file precondition_block.templates.h.

template<class MATRIX , typename inverse_type >
template<typename number2 >
void PreconditionBlockSOR< MATRIX, inverse_type >::forward ( Vector< number2 > &  dst,
const Vector< number2 > &  src,
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.

Definition at line 722 of file precondition_block.templates.h.

References Assert, StandardExceptions::ExcDimensionMismatch(), StandardExceptions::ExcNotInitialized(), and Householder< number >::least_squares().

template<class MATRIX , typename inverse_type >
template<typename number2 >
void PreconditionBlockSOR< MATRIX, inverse_type >::backward ( Vector< number2 > &  dst,
const Vector< number2 > &  src,
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.

Definition at line 812 of file precondition_block.templates.h.

References Assert, StandardExceptions::ExcDimensionMismatch(), StandardExceptions::ExcNotInitialized(), and Householder< number >::least_squares().


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

deal.II
generated on Tue Jun 18 2013 21:14:14 by doxygen 1.8.3.1.
Hosting by IWR Universität Heidelberg