SolverRichardson< VECTOR > Class Template Reference
[Linear solver classes]

Inheritance diagram for SolverRichardson< VECTOR >:

Inheritance graph
[legend]

List of all members.

Classes

struct  AdditionalData

Public Member Functions

 SolverRichardson (SolverControl &cn, VectorMemory< VECTOR > &mem, const AdditionalData &data=AdditionalData())
 SolverRichardson (SolverControl &cn, const AdditionalData &data=AdditionalData())
virtual ~SolverRichardson ()
template<class MATRIX , class PRECONDITIONER >
void solve (const MATRIX &A, VECTOR &x, const VECTOR &b, const PRECONDITIONER &precondition)
template<class MATRIX , class PRECONDITIONER >
void Tsolve (const MATRIX &A, VECTOR &x, const VECTOR &b, const PRECONDITIONER &precondition)
void set_omega (const double om=1.)
virtual void print_vectors (const unsigned int step, const VECTOR &x, const VECTOR &r, const VECTOR &d) const

Protected Member Functions

virtual VECTOR::value_type criterion ()

Protected Attributes

VECTOR * Vr
VECTOR * Vd
AdditionalData additional_data
VECTOR::value_type res


Detailed Description

template<class VECTOR = Vector<double>>
class SolverRichardson< VECTOR >

Implementation of the richardson iteration method. The stopping criterion is the norm of the residual.

For the requirements on matrices and vectors in order to work with this class, see the documentation of the Solver base class.

Like all other solver classes, this class has a local structure called AdditionalData which is used to pass additional parameters to the solver, like damping parameters or the number of temporary vectors. We use this additional structure instead of passing these values directly to the constructor because this makes the use of the SolverSelector and other classes much easier and guarantees that these will continue to work even if number or type of the additional parameters for a certain solver changes.

For the Richardson method, the additional data is the damping parameter, which is the only content of the AdditionalData structure. By default, the constructor of the structure sets it to one.

Author:
Ralf Hartmann

Constructor & Destructor Documentation

template<class VECTOR = Vector<double>>
SolverRichardson< VECTOR >::SolverRichardson ( SolverControl cn,
VectorMemory< VECTOR > &  mem,
const AdditionalData data = AdditionalData() 
)

Constructor.

template<class VECTOR = Vector<double>>
SolverRichardson< VECTOR >::SolverRichardson ( SolverControl cn,
const AdditionalData data = AdditionalData() 
)

Constructor. Use an object of type GrowingVectorMemory as a default to allocate memory.

template<class VECTOR = Vector<double>>
virtual SolverRichardson< VECTOR >::~SolverRichardson (  )  [virtual]

Virtual destructor.


Member Function Documentation

template<class VECTOR = Vector<double>>
template<class MATRIX , class PRECONDITIONER >
void SolverRichardson< VECTOR >::solve ( const MATRIX &  A,
VECTOR &  x,
const VECTOR &  b,
const PRECONDITIONER &  precondition 
) [inline]

Solve the linear system $Ax=b$ for x.

Referenced by SolverSelector< VECTOR >::solve().

template<class VECTOR = Vector<double>>
template<class MATRIX , class PRECONDITIONER >
void SolverRichardson< VECTOR >::Tsolve ( const MATRIX &  A,
VECTOR &  x,
const VECTOR &  b,
const PRECONDITIONER &  precondition 
) [inline]

Solve $A^Tx=b$ for $x$.

template<class VECTOR = Vector<double>>
void SolverRichardson< VECTOR >::set_omega ( const double  om = 1.  ) 

Set the damping-coefficient. Default is 1., i.e. no damping.

template<class VECTOR = Vector<double>>
virtual void SolverRichardson< VECTOR >::print_vectors ( const unsigned int  step,
const VECTOR &  x,
const VECTOR &  r,
const VECTOR &  d 
) const [virtual]

Interface for derived class. This function gets the current iteration vector, the residual and the update vector in each step. It can be used for a graphical output of the convergence history.

template<class VECTOR = Vector<double>>
virtual VECTOR::value_type SolverRichardson< VECTOR >::criterion (  )  [protected, virtual]

Implementation of the computation of the norm of the residual.


Member Data Documentation

template<class VECTOR = Vector<double>>
VECTOR* SolverRichardson< VECTOR >::Vr [protected]

Residual. Temporary vector allocated through the VectorMemory object at the start of the actual solution process and deallocated at the end.

template<class VECTOR = Vector<double>>
VECTOR* SolverRichardson< VECTOR >::Vd [protected]

Preconditioned residual. Temporary vector allocated through the VectorMemory object at the start of the actual solution process and deallocated at the end.

template<class VECTOR = Vector<double>>
AdditionalData SolverRichardson< VECTOR >::additional_data [protected]

Control parameters.

template<class VECTOR = Vector<double>>
VECTOR::value_type SolverRichardson< VECTOR >::res [protected]

Within the iteration loop, the norm of the residual is stored in this variable. The function criterion uses this variable to compute the convergence value, which in this class is the norm of the residual vector and thus the square root of the res2 value.


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

deal.II documentation generated on Sat Aug 15 16:52:18 2009 by doxygen 1.5.9