Public Member Functions | Public Attributes | Private Attributes
IterativeInverse< VECTOR > Class Template Reference
Inheritance diagram for IterativeInverse< VECTOR >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

template<class MATRIX , class PRECONDITION >
void initialize (const MATRIX &, const PRECONDITION &)
void clear ()
void vmult (VECTOR &dst, const VECTOR &src) const

Public Attributes

SolverSelector< VECTOR > solver

Private Attributes

std_cxx1x::shared_ptr
< PointerMatrixBase< VECTOR > > 
matrix
std_cxx1x::shared_ptr
< PointerMatrixBase< VECTOR > > 
preconditioner
std_cxx1x::shared_ptr
< PointerMatrixBase< VECTOR > > 
transpose_matrix
std_cxx1x::shared_ptr
< PointerMatrixBase< VECTOR > > 
transpose_preconditioner

Detailed Description

template<class VECTOR>
class IterativeInverse< VECTOR >

Implementation of the inverse of a matrix, using an iterative method.

The function vmult() of this class starts an iterative solver in order to approximate the action of the inverse matrix.

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)
 PreconditionSSOR <SparseMatrix<double> > inner_precondition;
 inner_precondition.initialize (A, 1.2);

 IterativeInverse<Vector<double> > precondition;
 precondition.initialize (A, inner_precondition);
 precondition.solver.select("cg");
 precondition.solver.control = inner_control;

 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
Date:
2010

Member Function Documentation

template<class VECTOR >
template<class MATRIX , class PRECONDITION >
void IterativeInverse< VECTOR >::initialize ( const MATRIX &  m,
const PRECONDITION &  p 
) [inline]

Initialization function. Provide a matrix and preconditioner for th solve in vmult().

References LAPACKSupport::matrix, and PointerMatrixAux< MATRIX, VECTOR >::new_pointer_matrix_base().

template<class VECTOR >
void IterativeInverse< VECTOR >::clear ( ) [inline]

Delete the pointers to matrix and preconditioner.

References LAPACKSupport::matrix.

template<class VECTOR >
void IterativeInverse< VECTOR >::vmult ( VECTOR &  dst,
const VECTOR &  src 
) const [inline]

Solve for right hand side src.

References Assert, StandardExceptions::ExcNotInitialized(), and LAPACKSupport::matrix.


Member Data Documentation

template<class VECTOR>
SolverSelector<VECTOR> IterativeInverse< VECTOR >::solver

Solve the transposed system for right hand side src. The solver, which allows selection of the actual solver as well as adjuxtment of parameters.

template<class VECTOR>
std_cxx1x::shared_ptr<PointerMatrixBase<VECTOR> > IterativeInverse< VECTOR >::matrix [private]

The matrix in use.

template<class VECTOR>
std_cxx1x::shared_ptr<PointerMatrixBase<VECTOR> > IterativeInverse< VECTOR >::preconditioner [private]

The preconditioner to use.

template<class VECTOR>
std_cxx1x::shared_ptr<PointerMatrixBase<VECTOR> > IterativeInverse< VECTOR >::transpose_matrix [private]

The transpose of the matrix in use.

template<class VECTOR>
std_cxx1x::shared_ptr<PointerMatrixBase<VECTOR> > IterativeInverse< VECTOR >::transpose_preconditioner [private]

The transpose of the preconditioner to use.


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

deal.II documentation generated on Fri Aug 12 2011 15:01:05 by doxygen 1.7.4