ug4
ug::OperatorInverseIterator< TAlgebra > Class Template Reference

#include <operator_inverse_iterator.h>

+ Inheritance diagram for ug::OperatorInverseIterator< TAlgebra >:

Public Types

typedef TAlgebra algebra_type
 Algebra type. More...
 
typedef IPreconditioner< TAlgebra > base_type
 Base type. More...
 
typedef IPreconditioner< TAlgebra >::matrix_operator_type matrix_operator_type
 Matrix Operator type. More...
 
typedef TAlgebra::matrix_type matrix_type
 Matrix type. More...
 
typedef TAlgebra::vector_type vector_type
 Vector type. More...
 
- Public Types inherited from ug::ILinearIterator< TAlgebra::vector_type >
typedef TAlgebra::vector_type codomain_function_type
 Range space. More...
 
typedef TAlgebra::vector_type domain_function_type
 Domain space. More...
 

Public Member Functions

virtual bool apply (vector_type &c, const vector_type &d)
 compute new correction c = B*d More...
 
virtual bool apply_update_defect (vector_type &c, vector_type &d)
 compute new correction c = B*d and update defect d := d - A*c More...
 
virtual SmartPtr< ILinearIterator< vector_type, vector_type > > clone ()
 clone More...
 
virtual bool init (SmartPtr< ILinearOperator< vector_type > > J, const vector_type &u)
 
virtual bool init (SmartPtr< ILinearOperator< vector_type > > L)
 
virtual const char * name () const
 returns the name of iterator More...
 
 OperatorInverseIterator (SmartPtr< ILinearOperatorInverse< vector_type > > opInv)
 default constructor More...
 
virtual bool supports_parallel () const
 returns if parallel solving is supported More...
 
 ~OperatorInverseIterator ()
 
- Public Member Functions inherited from ug::ILinearIterator< TAlgebra::vector_type >
virtual std::string config_string () const
 
SmartPtr< IDamping< TAlgebra::vector_type, TAlgebra::vector_type > > damping ()
 returns the scaling More...
 
 ILinearIterator ()
 constructor More...
 
 ILinearIterator (const ILinearIterator< TAlgebra::vector_type, TAlgebra::vector_type > &parent)
 copy constructor More...
 
virtual bool init (SmartPtr< ILinearOperator< TAlgebra::vector_type, TAlgebra::vector_type > > J, const TAlgebra::vector_type &u)=0
 initialize for operator J(u) and linearization point u More...
 
virtual bool init (SmartPtr< ILinearOperator< TAlgebra::vector_type, TAlgebra::vector_type > > L)=0
 initialize for linear operator L More...
 
void set_damp (number factor)
 sets the damping to a constant factor More...
 
void set_damp (SmartPtr< IDamping< TAlgebra::vector_type, TAlgebra::vector_type > > spScaling)
 sets a scaling for the correction More...
 
virtual ~ILinearIterator ()
 virtual destructor More...
 

Public Attributes

std::string m_name
 

Protected Attributes

SmartPtr< ILinearOperatorInverse< vector_type > > m_opInv
 
- Protected Attributes inherited from ug::ILinearIterator< TAlgebra::vector_type >
SmartPtr< IDamping< TAlgebra::vector_type, TAlgebra::vector_type > > m_spDamping
 the scaling More...
 

Detailed Description

template<typename TAlgebra>
class ug::OperatorInverseIterator< TAlgebra >

a LinearIterator which can uses ILinearOperatorInverse to perform B^{-1} this is for the case that some class needs a preconditioner, but we'd like to use a linear solver example: 4x AMG as preconditioner

linSolver = LinearSolver()
linSolver:set_preconditioner(amg)
linSolver:set_convergence_check(ConvCheck(4, 0, 0, false) )
oii = OperatorInverseIterator(linSolver)
someObject:set_preconditioner(oii)
OperatorInverseIterator(SmartPtr< ILinearOperatorInverse< vector_type > > opInv)
default constructor
Definition: operator_inverse_iterator.h:92

Member Typedef Documentation

◆ algebra_type

template<typename TAlgebra >
typedef TAlgebra ug::OperatorInverseIterator< TAlgebra >::algebra_type

Algebra type.

◆ base_type

template<typename TAlgebra >
typedef IPreconditioner<TAlgebra> ug::OperatorInverseIterator< TAlgebra >::base_type

Base type.

◆ matrix_operator_type

template<typename TAlgebra >
typedef IPreconditioner<TAlgebra>::matrix_operator_type ug::OperatorInverseIterator< TAlgebra >::matrix_operator_type

Matrix Operator type.

◆ matrix_type

template<typename TAlgebra >
typedef TAlgebra::matrix_type ug::OperatorInverseIterator< TAlgebra >::matrix_type

Matrix type.

◆ vector_type

template<typename TAlgebra >
typedef TAlgebra::vector_type ug::OperatorInverseIterator< TAlgebra >::vector_type

Vector type.

Constructor & Destructor Documentation

◆ OperatorInverseIterator()

◆ ~OperatorInverseIterator()

template<typename TAlgebra >
ug::OperatorInverseIterator< TAlgebra >::~OperatorInverseIterator ( )
inline

Member Function Documentation

◆ apply()

template<typename TAlgebra >
virtual bool ug::OperatorInverseIterator< TAlgebra >::apply ( vector_type c,
const vector_type d 
)
inlinevirtual

compute new correction c = B*d

This method applies the iterator operator, i.e. c = B*d. The domain function d remains unchanged. Note, that this method can always be implemented by creating a copy of d and calling apply_update_defect with this copy.

Parameters
[in]ddefect
[out]ccorrection
Returns
bool success flag

Implements ug::ILinearIterator< TAlgebra::vector_type >.

References ug::OperatorInverseIterator< TAlgebra >::m_opInv.

◆ apply_update_defect()

template<typename TAlgebra >
virtual bool ug::OperatorInverseIterator< TAlgebra >::apply_update_defect ( vector_type c,
vector_type d 
)
inlinevirtual

compute new correction c = B*d and update defect d := d - A*c

This method applies the inverse operator, i.e. c = B*d. The domain function d is changed in the way, that the defect d := d - A*c is returned in the function. This is always useful, when the iterating algorithm can (or must) update the defect during computation (this is e.g. the case for the geometric multigrid method). Note, that this method can always be implemented by calling apply and then computing d := d - A*c.

Parameters
[in,out]ddefect
[out]ucorrection
Returns
bool success flag

Implements ug::ILinearIterator< TAlgebra::vector_type >.

References ug::OperatorInverseIterator< TAlgebra >::m_opInv.

◆ clone()

template<typename TAlgebra >
virtual SmartPtr<ILinearIterator<vector_type, vector_type> > ug::OperatorInverseIterator< TAlgebra >::clone ( )
inlinevirtual

◆ init() [1/2]

template<typename TAlgebra >
virtual bool ug::OperatorInverseIterator< TAlgebra >::init ( SmartPtr< ILinearOperator< vector_type > >  J,
const vector_type u 
)
inlinevirtual

◆ init() [2/2]

template<typename TAlgebra >
virtual bool ug::OperatorInverseIterator< TAlgebra >::init ( SmartPtr< ILinearOperator< vector_type > >  L)
inlinevirtual

◆ name()

template<typename TAlgebra >
virtual const char* ug::OperatorInverseIterator< TAlgebra >::name ( ) const
inlinevirtual

returns the name of iterator

This method returns the name of the iterator operator. This function is typically needed, when the iterator operator is used inside of another operator and some debug output should be printed

Returns
const char* name of inverse operator

Implements ug::ILinearIterator< TAlgebra::vector_type >.

References ug::OperatorInverseIterator< TAlgebra >::m_name.

Referenced by ug::OperatorInverseIterator< TAlgebra >::init().

◆ supports_parallel()

template<typename TAlgebra >
virtual bool ug::OperatorInverseIterator< TAlgebra >::supports_parallel ( ) const
inlinevirtual

returns if parallel solving is supported

Implements ug::ILinearIterator< TAlgebra::vector_type >.

References ug::OperatorInverseIterator< TAlgebra >::m_opInv.

Member Data Documentation

◆ m_name

◆ m_opInv


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