Loading [MathJax]/extensions/tex2jax.js
ug4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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.
 
typedef IPreconditioner< TAlgebra > base_type
 Base type.
 
typedef IPreconditioner< TAlgebra >::matrix_operator_type matrix_operator_type
 Matrix Operator type.
 
typedef TAlgebra::matrix_type matrix_type
 Matrix type.
 
typedef TAlgebra::vector_type vector_type
 Vector type.
 
- Public Types inherited from ug::ILinearIterator< TAlgebra::vector_type >
typedef TAlgebra::vector_type codomain_function_type
 Range space.
 
typedef TAlgebra::vector_type domain_function_type
 Domain space.
 

Public Member Functions

virtual bool apply (vector_type &c, const vector_type &d)
 compute new correction c = B*d
 
virtual bool apply_update_defect (vector_type &c, vector_type &d)
 compute new correction c = B*d and update defect d := d - A*c
 
virtual SmartPtr< ILinearIterator< vector_type, vector_type > > clone ()
 clone
 
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
 
 OperatorInverseIterator (SmartPtr< ILinearOperatorInverse< vector_type > > opInv)
 default constructor
 
virtual bool supports_parallel () const
 returns if parallel solving is supported
 
 ~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
 
 ILinearIterator ()
 constructor
 
 ILinearIterator (const ILinearIterator< TAlgebra::vector_type, TAlgebra::vector_type > &parent)
 copy constructor
 
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
 
virtual bool init (SmartPtr< ILinearOperator< TAlgebra::vector_type, TAlgebra::vector_type > > L)=0
 initialize for linear operator L
 
void set_damp (number factor)
 sets the damping to a constant factor
 
void set_damp (SmartPtr< IDamping< TAlgebra::vector_type, TAlgebra::vector_type > > spScaling)
 sets a scaling for the correction
 
virtual ~ILinearIterator ()
 virtual destructor
 

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
 

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)
linear solver using abstract preconditioner interface
Definition linear_solver.h:57
Definition operator_inverse_iterator.h:65

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::ILinearOperatorInverse< X, Y >::apply(), and 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::ILinearOperatorInverse< X, Y >::apply_return_defect(), and ug::OperatorInverseIterator< TAlgebra >::m_opInv.

◆ clone()

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

◆ init() [1/2]

◆ init() [2/2]

◆ 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(), and ug::OperatorInverseIterator< TAlgebra >::init().

◆ supports_parallel()

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

Member Data Documentation

◆ m_name

◆ m_opInv


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