Public Types | Public Member Functions | Private Attributes

PreconditionUseMatrix< MATRIX, VECTOR > Class Template Reference
[Preconditioners and Relaxation Operators]

Inheritance diagram for PreconditionUseMatrix< MATRIX, VECTOR >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef void(MATRIX::* function_ptr )(VECTOR &, const VECTOR &) const

Public Member Functions

 PreconditionUseMatrix (const MATRIX &M, const function_ptr method)
void vmult (VECTOR &dst, const VECTOR &src) const

Private Attributes

const MATRIXmatrix
const function_ptr precondition

Detailed Description

template<class MATRIX = SparseMatrix<double>, class VECTOR = Vector<double>>
class PreconditionUseMatrix< MATRIX, VECTOR >

Preconditioner using a matrix-builtin function. This class forms a preconditioner suitable for the LAC solver classes. Since many preconditioning methods are based on matrix entries, these have to be implemented as member functions of the underlying matrix implementation. This class now is intended to allow easy access to these member functions from LAC solver classes.

It seems that all builtin preconditioners have a relaxation parameter, so please use PreconditionRelaxation for these.

You will usually not want to create a named object of this type, although possible. The most common use is like this:

    SolverGMRES<SparseMatrix<double>,
                Vector<double> >      gmres(control,memory,500);

    gmres.solve (matrix, solution, right_hand_side,
                   PreconditionUseMatrix<SparseMatrix<double>,Vector<double> >
                   (matrix,&SparseMatrix<double>::template precondition_Jacobi<double>));

This creates an unnamed object to be passed as the fourth parameter to the solver function of the SolverGMRES class. It assumes that the SparseMatrix class has a function precondition_Jacobi taking two vectors (source and destination) as parameters (Actually, there is no function like that, the existing function takes a third parameter, denoting the relaxation parameter; this example is therefore only meant to illustrate the general idea).

Note that due to the default template parameters, the above example could be written shorter as follows:

    ...
    gmres.solve (matrix, solution, right_hand_side,
                   PreconditionUseMatrix<>
                     (matrix,&SparseMatrix<double>::template precondition_Jacobi<double>));
Author:
Guido Kanschat, Wolfgang Bangerth, 1999

Definition at line 283 of file precondition.h.


Member Typedef Documentation

template<class MATRIX = SparseMatrix<double>, class VECTOR = Vector<double>>
typedef void( MATRIX::* PreconditionUseMatrix< MATRIX, VECTOR >::function_ptr)(VECTOR &, const VECTOR &) const

Type of the preconditioning function of the matrix.

Definition at line 290 of file precondition.h.


Constructor & Destructor Documentation

template<class MATRIX = SparseMatrix<double>, class VECTOR = Vector<double>>
PreconditionUseMatrix< MATRIX, VECTOR >::PreconditionUseMatrix ( const MATRIX M,
const function_ptr  method 
)

Constructor. This constructor stores a reference to the matrix object for later use and selects a preconditioning method, which must be a member function of that matrix.


Member Function Documentation

template<class MATRIX = SparseMatrix<double>, class VECTOR = Vector<double>>
void PreconditionUseMatrix< MATRIX, VECTOR >::vmult ( VECTOR &  dst,
const VECTOR &  src 
) const

Execute preconditioning. Calls the function passed to the constructor of this object with the two arguments given here.


Member Data Documentation

template<class MATRIX = SparseMatrix<double>, class VECTOR = Vector<double>>
const MATRIX& PreconditionUseMatrix< MATRIX, VECTOR >::matrix [private]

Pointer to the matrix in use.

Definition at line 317 of file precondition.h.

template<class MATRIX = SparseMatrix<double>, class VECTOR = Vector<double>>
const function_ptr PreconditionUseMatrix< MATRIX, VECTOR >::precondition [private]

Pointer to the preconditioning function.

Definition at line 323 of file precondition.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Fri Feb 3 2012 06:04:10 by doxygen 1.7.2