Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Public Types | Public Member Functions | Private Attributes | List of all members
PreconditionPSOR< MATRIX > Class Template Reference

#include <precondition.h>

Inheritance diagram for PreconditionPSOR< MATRIX >:
[legend]

Public Types

typedef types::global_dof_index size_type
 

Public Member Functions

void initialize (const MATRIX &A, const std::vector< size_type > &permutation, const std::vector< size_type > &inverse_permutation, const typename PreconditionRelaxation< MATRIX >::AdditionalData &parameters=typename PreconditionRelaxation< MATRIX >::AdditionalData())
 
template<class VECTOR >
void vmult (VECTOR &, const VECTOR &) const
 
template<class VECTOR >
void Tvmult (VECTOR &, const VECTOR &) const
 
- Public Member Functions inherited from PreconditionRelaxation< MATRIX >
void initialize (const MATRIX &A, const AdditionalData &parameters=AdditionalData())
 
void clear ()
 
- 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 std::vector< size_type > * permutation
 
const std::vector< size_type > * inverse_permutation
 

Additional Inherited Members

- Protected Attributes inherited from PreconditionRelaxation< MATRIX >
SmartPointer< const MATRIX,
PreconditionRelaxation< MATRIX > > 
A
 
double relaxation
 

Detailed Description

template<class MATRIX = SparseMatrix<double>>
class PreconditionPSOR< MATRIX >

Permuted SOR preconditioner using matrix built-in function. The MATRIX class used is required to have functions PSOR(VECTOR&, const VECTOR&, double) and TPSOR(VECTOR&, const VECTOR&, double).

// Declare related objects
SolverCG<> solver(...);
//...initialize and build A
std::vector<unsigned int> permutation(x.size());
std::vector<unsigned int> inverse_permutation(x.size());
//...fill permutation and its inverse with reasonable values
// Define and initialize preconditioner
precondition.initialize (A, permutation, inverse_permutation, .6);
solver.solve (A, x, b, precondition);
Author
Guido Kanschat, 2003

Definition at line 679 of file precondition.h.

Member Typedef Documentation

template<class MATRIX = SparseMatrix<double>>
typedef types::global_dof_index PreconditionPSOR< MATRIX >::size_type

Declare type for container size.

Definition at line 685 of file precondition.h.

Member Function Documentation

template<class MATRIX = SparseMatrix<double>>
void PreconditionPSOR< MATRIX >::initialize ( const MATRIX A,
const std::vector< size_type > &  permutation,
const std::vector< size_type > &  inverse_permutation,
const typename PreconditionRelaxation< MATRIX >::AdditionalData parameters = typename PreconditionRelaxationMATRIX >::AdditionalData() 
)

Initialize matrix and relaxation parameter. The matrix is just stored in the preconditioner object.

The permutation vector is stored as a pointer. Therefore, it has to be assured that the lifetime of the vector exceeds the lifetime of the preconditioner.

The relaxation parameter should be larger than zero and smaller than 2 for numerical reasons. It defaults to 1.

template<class MATRIX = SparseMatrix<double>>
template<class VECTOR >
void PreconditionPSOR< MATRIX >::vmult ( VECTOR &  ,
const VECTOR &   
) const

Apply preconditioner.

template<class MATRIX = SparseMatrix<double>>
template<class VECTOR >
void PreconditionPSOR< MATRIX >::Tvmult ( VECTOR &  ,
const VECTOR &   
) const

Apply transpose preconditioner.

Member Data Documentation

template<class MATRIX = SparseMatrix<double>>
const std::vector<size_type>* PreconditionPSOR< MATRIX >::permutation
private

Storage for the permutation vector.

Definition at line 728 of file precondition.h.

template<class MATRIX = SparseMatrix<double>>
const std::vector<size_type>* PreconditionPSOR< MATRIX >::inverse_permutation
private

Storage for the inverse permutation vector.

Definition at line 733 of file precondition.h.


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