PreconditionPSOR< MATRIX > Class Template Reference
[Preconditioners]

Inheritance diagram for PreconditionPSOR< MATRIX >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

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

Private Attributes

const std::vector< unsigned int > * permutation
const std::vector< unsigned int > * inverse_permutation

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

 SparseMatrix<double> A;
 Vector<double> x;
 Vector<double> b;
 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

 PreconditionPSOR<SparseMatrix<double> > precondition;
 precondition.initialize (A, permutation, inverse_permutation, .6);

 solver.solve (A, x, b, precondition);
Author:
Guido Kanschat, 2003

Member Function Documentation

template<class MATRIX = SparseMatrix<double>>
void PreconditionPSOR< MATRIX >::initialize ( const MATRIX &  A,
const std::vector< unsigned int > &  permutation,
const std::vector< unsigned int > &  inverse_permutation,
typename PreconditionRelaxation< MATRIX >::AdditionalData  parameters = typename PreconditionRelaxation< MATRIX >::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 [inline]

Apply preconditioner.

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

Apply transpose preconditioner.


Member Data Documentation

template<class MATRIX = SparseMatrix<double>>
const std::vector<unsigned int>* PreconditionPSOR< MATRIX >::permutation [private]

Storage for the permutation vector.

template<class MATRIX = SparseMatrix<double>>
const std::vector<unsigned int>* PreconditionPSOR< MATRIX >::inverse_permutation [private]

Storage for 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:01 2009 by doxygen 1.6.1