Reference documentation for deal.II version 8.1.0
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SolverRichardson< VECTOR > Class Template Reference

#include <solver_richardson.h>

Inheritance diagram for SolverRichardson< VECTOR >:
[legend]

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
 
- Public Member Functions inherited from Solver< VECTOR >
 Solver (SolverControl &solver_control, VectorMemory< VECTOR > &vector_memory)
 
 Solver (SolverControl &solver_control)
 
SolverControlcontrol () 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)
 

Protected Member Functions

virtual VECTOR::value_type criterion ()
 

Protected Attributes

VECTOR * Vr
 
VECTOR * Vd
 
AdditionalData additional_data
 
VECTOR::value_type res
 
- Protected Attributes inherited from Solver< VECTOR >
GrowingVectorMemory< VECTOR > static_vector_memory
 
SolverControlcntrl
 
VectorMemory< VECTOR > & memory
 

Detailed Description

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

Implementation of the preconditioned 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

Definition at line 55 of file solver_richardson.h.

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 
)

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

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 
)

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

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.

Definition at line 159 of file solver_richardson.h.

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.

Definition at line 169 of file solver_richardson.h.

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

Control parameters.

Definition at line 174 of file solver_richardson.h.

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.

Definition at line 186 of file solver_richardson.h.


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