G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsPreconditionerOp< T > Class Template Referenceabstract

Detailed Description

template<class T>
class gismo::gsPreconditionerOp< T >

Simple abstract class for perconditioners.

The class represents an iteration method in the form

\( x_{new} = x_{old} + P(f - A*x_{old}).\)

If the number of steps is set to 1, the member function apply represents the application of \( P \). If setNumOfSweeps is used to set the number of sweeps to some \( \nu>0 \), the member function apply realizes \( I-(I-PA)^{\nu} A^{-1} \). The same interpretation applies if the object is used as a gsLinearOperator.

The member function step represents one step of the above iteration method.

Usually, the step operation can be performed in an optimized way.

The derived classes have to contain the functions: step, stepT, rows, cols.

+ Inheritance diagram for gsPreconditionerOp< T >:
+ Collaboration diagram for gsPreconditionerOp< T >:

Public Types

typedef gsLinearOperator< T > Base
 Base class.
 
typedef gsLinearOperator< T >::Ptr BasePtr
 Base class.
 
typedef memory::shared_ptr
< gsPreconditionerOp
Ptr
 Shared pointer for gsLinearOperator.
 
typedef memory::unique_ptr
< gsPreconditionerOp
uPtr
 Unique pointer for gsLinearOperator.
 

Public Member Functions

void apply (const gsMatrix< T > &input, gsMatrix< T > &x) const
 apply the operator on the input vector and store the result in x More...
 
virtual index_t cols () const =0
 Returns the number of columns of the operator.
 
estimateLargestEigenvalueOfPreconditionedSystem (index_t steps=10) const
 Estimates the largest eigenvalue of \( PA \). More...
 
index_t numOfSweeps ()
 Get the number of sweeps to be applied in the member function apply.
 
virtual index_t rows () const =0
 Returns the number of rows of the operator.
 
void setNumOfSweeps (index_t n)
 Set the number of sweeps to be applied in the member function apply.
 
virtual void setOptions (const gsOptionList &opt)
 Set options based on a gsOptionList object.
 
virtual void step (const gsMatrix< T > &rhs, gsMatrix< T > &x) const =0
 Apply the method for given right hand side and current iterate. More...
 
virtual void stepT (const gsMatrix< T > &rhs, gsMatrix< T > &x) const
 Apply the transposed variant of the method for given right hand side and current iterate. More...
 
virtual BasePtr underlyingOp () const =0
 Return the underlying operator \( A \).
 

Static Public Member Functions

static gsOptionList defaultOptions ()
 Get the default options as gsOptionList object.
 
static gsIdentityOp< T > Identity (const index_t dim)
 Identity operator.
 

Member Function Documentation

void apply ( const gsMatrix< T > &  input,
gsMatrix< T > &  x 
) const
inlinevirtual

apply the operator on the input vector and store the result in x

Parameters
inputInput vector
xresult vector

Implements gsLinearOperator< T >.

Reimplemented in gsPreconditionerFromOp< T >.

T estimateLargestEigenvalueOfPreconditionedSystem ( index_t  steps = 10) const
inline

Estimates the largest eigenvalue of \( PA \).

Parameters
stepsNumber of steps to be performed.
virtual void step ( const gsMatrix< T > &  rhs,
gsMatrix< T > &  x 
) const
pure virtual

Apply the method for given right hand side and current iterate.

Parameters
rhsRight hand side vector
xCurrent iterate vector

Implemented in gsIncompleteLUOp< MatrixType >, gsGaussSeidelOp< MatrixType, ordering >, gsMultiGridOp< T >, gsPreconditionerFromOp< T >, gsJacobiOp< MatrixType >, gsCompositePrecOp< T >, and gsRichardsonOp< MatrixType >.

virtual void stepT ( const gsMatrix< T > &  rhs,
gsMatrix< T > &  x 
) const
inlinevirtual

Apply the transposed variant of the method for given right hand side and current iterate.

Parameters
rhsRight hand side vector
xCurrent iterate vector
Warning
Derived classes must overwrite this virtual function if the preconditioner is not symmetric.

Reimplemented in gsGaussSeidelOp< MatrixType, ordering >, gsMultiGridOp< T >, and gsCompositePrecOp< T >.