PreconditionLACSolver< SOLVER, MATRIX, PRECONDITION > Class Template Reference
[Preconditioners]

Inheritance diagram for PreconditionLACSolver< SOLVER, MATRIX, PRECONDITION >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 PreconditionLACSolver ()
void initialize (SOLVER &, const MATRIX &, const PRECONDITION &)
template<class VECTOR >
void vmult (VECTOR &, const VECTOR &) const

Private Attributes

SmartPointer< SOLVERsolver
SmartPointer< const MATRIX > matrix
SmartPointer< const PRECONDITION > precondition

Detailed Description

template<class SOLVER, class MATRIX = SparseMatrix<double>, class PRECONDITION = PreconditionIdentity>
class PreconditionLACSolver< SOLVER, MATRIX, PRECONDITION >

Preconditioner using an iterative solver. This preconditioner uses a fully initialized LAC iterative solver for the approximate inverse of the matrix. Naturally, this solver needs another preconditionig method.

Usually, the use of ReductionControl is preferred over the use of the basic SolverControl in defining this solver.

Krylov space methods like SolverCG or SolverBicgstab become inefficient if soution down to machine accuracy is needed. This is due to the fact, that round-off errors spoil the orthogonality of the vector sequences. Therefore, a nested iteration of two methods is proposed: The outer method is SolverRichardson, since it is robust with respect to round-of errors. The inner loop is an appropriate Krylov space method, since it is fast.

     // Declare related objects

 SparseMatrix<double> A;
 Vector<double> x;
 Vector<double> b;
 GrowingVectorMemory<Vector<double> > mem;

 ReductionControl inner_control (10, 1.e-30, 1.e-2)
 SolverCG<Vector<double> > inner_iteration (inner_control, mem);
 PreconditionSSOR <SparseMatrix<double> > inner_precondition;
 inner_precondition.initialize (A, 1.2);

 PreconditionLACSolver precondition;
 precondition.initialize (inner_iteration, A, inner_precondition);

 SolverControl outer_control(100, 1.e-16);
 SolverRichardson<Vector<double> > outer_iteration;

 outer_iteration.solve (A, x, b, precondition);

Each time we call the inner loop, reduction of the residual by a factor 1.e-2 is attempted. Since the right hand side vector of the inner iteration is the residual of the outer loop, the relative errors are far from machine accuracy, even if the errors of the outer loop are in the range of machine accuracy.

Author:
Guido Kanschat, 1999

Constructor & Destructor Documentation

template<class SOLVER , class MATRIX = SparseMatrix<double>, class PRECONDITION = PreconditionIdentity>
PreconditionLACSolver< SOLVER, MATRIX, PRECONDITION >::PreconditionLACSolver (  ) 

Constructor. All work is done in initialize.


Member Function Documentation

template<class SOLVER , class MATRIX = SparseMatrix<double>, class PRECONDITION = PreconditionIdentity>
void PreconditionLACSolver< SOLVER, MATRIX, PRECONDITION >::initialize ( SOLVER ,
const MATRIX &  ,
const PRECONDITION &   
)

Initialization function. Provide a solver object, a matrix, and another preconditioner for this.

template<class SOLVER , class MATRIX = SparseMatrix<double>, class PRECONDITION = PreconditionIdentity>
template<class VECTOR >
void PreconditionLACSolver< SOLVER, MATRIX, PRECONDITION >::vmult ( VECTOR &  ,
const VECTOR &   
) const [inline]

Execute preconditioning.


Member Data Documentation

template<class SOLVER , class MATRIX = SparseMatrix<double>, class PRECONDITION = PreconditionIdentity>
SmartPointer<SOLVER> PreconditionLACSolver< SOLVER, MATRIX, PRECONDITION >::solver [private]

The solver object to use.

template<class SOLVER , class MATRIX = SparseMatrix<double>, class PRECONDITION = PreconditionIdentity>
SmartPointer<const MATRIX> PreconditionLACSolver< SOLVER, MATRIX, PRECONDITION >::matrix [private]

The matrix in use.

template<class SOLVER , class MATRIX = SparseMatrix<double>, class PRECONDITION = PreconditionIdentity>
SmartPointer<const PRECONDITION> PreconditionLACSolver< SOLVER, MATRIX, PRECONDITION >::precondition [private]

The preconditioner to use.


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

deal.II documentation generated on Mon Nov 23 22:58:00 2009 by doxygen 1.6.1