Reference documentation for deal.II version Git 283ce71 2014-12-19 22:22:25 +0100
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Private Attributes | List of all members
PreconditionUseMatrix< MATRIX, VECTOR > Class Template Reference

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

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

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

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:

Vector<double> > gmres(control,memory,500);
gmres.solve (matrix, solution, right_hand_side,
(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,
(matrix,&SparseMatrix<double>::template precondition_Jacobi<double>));
Author
Guido Kanschat, Wolfgang Bangerth, 1999

Definition at line 262 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 268 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 289 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 294 of file precondition.h.


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