MGPrecond< T > Class Template Reference

Class template of the multi-grid preconditioner for SysMatrix<T> . More...

#include <MGPrecond.hpp>

Inheritance diagram for MGPrecond< T >:

Inheritance graph
[legend]
Collaboration diagram for MGPrecond< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MGPrecond (unsigned the_disp_type, int the_gamma, LinSolver< T > &the_base_solver, SysTransfer< T > &the_transfer, SysPrecond< T > &the_pre_smoother, SysPrecond< T > &the_post_smoother, int the_pre_n=1, int the_post_n=1, T the_pre_damp=1, T the_post_damp=1)
 MGPrecond (LinSolver< T > &the_base_solver, SysTransfer< T > &the_transfer, SysPrecond< T > &the_pre_smoother, SysPrecond< T > &the_post_smoother, SGParam *list)
 Reads all the data from SG-parameters.
void PrintParam ()
 Prints the name of the preconditioner and (optionally) the parameters.
void PreProcess (SysPrecondCtxt &context, SysMatrix< T > &A)
 Prepares the preconditioner for a given matrix hierarchy, i.e. creates the grid function hierarchy, checks the sizes of the matrices in the hierarchy.
void Run (SysPrecondCtxt &context, GridVec< T > &r, GridVec< T > &c)
 Applies the preconditioner to a given vector 'r', i.e. computes $c \leftarrow W^{-1} \cdot r$ .
void PostProcess (SysPrecondCtxt &context)
 Releases the allocated memory, postprocesses the smoothers.
virtual ~MGPrecond ()
 Virtual destructor.

Detailed Description

template<typename T>
class MGPrecond< T >

Class template of the multi-grid preconditioner for SysMatrix<T> .

The preconditioner does not create the grid hierarchy, but uses the existing one.

The templates depend on a type T. This type should satisfy the conditions listed in small_matrix.hpp for small matrices.

Date:
Sep. 21, 2004 - created


Constructor & Destructor Documentation

template<typename T>
MGPrecond< T >::MGPrecond ( unsigned  the_disp_type,
int  the_gamma,
LinSolver< T > &  the_base_solver,
SysTransfer< T > &  the_transfer,
SysPrecond< T > &  the_pre_smoother,
SysPrecond< T > &  the_post_smoother,
int  the_pre_n = 1,
int  the_post_n = 1,
the_pre_damp = 1,
the_post_damp = 1 
) [inline]

Constructor which gets all the data from the arguments

Parameters:
[in] the_disp_type The display type
[in] the_gamma The multi-grid cycle type (1 = V-cycle, ...)
[in] the_base_solver The coarse grid solver
[in] the_transfer The transfer operators
[in] the_pre_smoother The pre-smoother
[in] the_post_smoother The post-smoother
[in] the_pre_n The number of the pre-smoothing steps
[in] the_post_n The number of the post-smoothing steps
[in] the_pre_damp The damping factor for the pre-smoother
[in] the_post_damp The damping factor for the post-smoother

template<typename T>
MGPrecond< T >::MGPrecond ( LinSolver< T > &  the_base_solver,
SysTransfer< T > &  the_transfer,
SysPrecond< T > &  the_pre_smoother,
SysPrecond< T > &  the_post_smoother,
SGParam list 
) [inline]

Reads all the data from SG-parameters.

Parameters:
[in] the_base_solver The coarse grid solver
[in] the_transfer The transfer operators
[in] the_pre_smoother The pre-smoother
[in] the_post_smoother The post-smoother
[in] list The list of parameters to read

template<typename T>
virtual MGPrecond< T >::~MGPrecond (  )  [inline, virtual]

Virtual destructor.


Member Function Documentation

template<typename T>
void MGPrecond< T >::PrintParam (  )  [inline, virtual]

Prints the name of the preconditioner and (optionally) the parameters.

Implements SysPrecond< T >.

template<typename T>
void MGPrecond< T >::PreProcess ( SysPrecondCtxt context,
SysMatrix< T > &  A 
) [inline, virtual]

Prepares the preconditioner for a given matrix hierarchy, i.e. creates the grid function hierarchy, checks the sizes of the matrices in the hierarchy.

This function must be called only once for a given matrix hierarchy. Then the preconditioner can be applied to any residual and any right-hand side. This function does not return any value but may throw exceptions

Parameters:
[in] context The context to initialize
[in] A The system matrix hierarchy

Implements SysPrecond< T >.

template<typename T>
void MGPrecond< T >::Run ( SysPrecondCtxt context,
GridVec< T > &  r,
GridVec< T > &  c 
) [inline, virtual]

Applies the preconditioner to a given vector 'r', i.e. computes $c \leftarrow W^{-1} \cdot r$ .

Note:
In some cases 'c' and 'r' must be physically different vectors, but they should have equal sizes. This function does not return any value but may throw exceptions.
Parameters:
[in] context The context
[in] r The residual
[in] c The correction

Implements SysPrecond< T >.

template<typename T>
void MGPrecond< T >::PostProcess ( SysPrecondCtxt context  )  [inline, virtual]

Releases the allocated memory, postprocesses the smoothers.

After you called this function the preconditioner cannot work before you call PreProcess again. This function does not return any value but may throw exceptions

Parameters:
[in] context The context to release

Implements SysPrecond< T >.


The documentation for this class was generated from the following files:
Generated on Fri Sep 21 12:34:20 2007 for SG2 by  doxygen 1.5.2