ug4
ug::CombinedLinearIterator< X, Y > Class Template Referenceabstract

#include <iterator_product.h>

+ Inheritance diagram for ug::CombinedLinearIterator< X, Y >:

Public Member Functions

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

Protected Attributes

std::vector< SmartPtr< ILinearIterator< X, Y > > > m_vIterator
 
- Protected Attributes inherited from ug::ILinearIterator< X, Y >
SmartPtr< IDamping< X, Y > > m_spDamping
 the scaling More...
 

Additional Inherited Members

- Public Types inherited from ug::ILinearIterator< X, Y >
typedef Y codomain_function_type
 Range space. More...
 
typedef X domain_function_type
 Domain space. More...
 

Detailed Description

template<typename X, typename Y>
class ug::CombinedLinearIterator< X, Y >

Base class for ILinearIterators build from other ILinearIterators

Constructor & Destructor Documentation

◆ CombinedLinearIterator() [1/2]

template<typename X , typename Y >
ug::CombinedLinearIterator< X, Y >::CombinedLinearIterator ( )
inline

◆ CombinedLinearIterator() [2/2]

template<typename X , typename Y >
ug::CombinedLinearIterator< X, Y >::CombinedLinearIterator ( const std::vector< SmartPtr< ILinearIterator< X, Y > > > &  vIterator)
inline

Member Function Documentation

◆ add_iterator() [1/2]

template<typename X , typename Y >
void ug::CombinedLinearIterator< X, Y >::add_iterator ( SmartPtr< ILinearIterator< X, Y > >  I)
inline

◆ add_iterator() [2/2]

template<typename X , typename Y >
void ug::CombinedLinearIterator< X, Y >::add_iterator ( SmartPtr< ILinearIterator< X, Y > >  I,
size_t  nr 
)
inline

◆ apply()

template<typename X , typename Y >
virtual bool ug::CombinedLinearIterator< X, Y >::apply ( Y &  c,
const X &  d 
)
pure virtual

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< X, Y >.

Implemented in ug::LinearIteratorSum< X, Y >, and ug::LinearIteratorProduct< X, Y >.

◆ apply_update_defect()

template<typename X , typename Y >
virtual bool ug::CombinedLinearIterator< X, Y >::apply_update_defect ( Y &  c,
X &  d 
)
pure virtual

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< X, Y >.

Implemented in ug::LinearIteratorSum< X, Y >, and ug::LinearIteratorProduct< X, Y >.

◆ clone()

template<typename X , typename Y >
virtual SmartPtr<ILinearIterator<X,Y> > ug::CombinedLinearIterator< X, Y >::clone ( )
pure virtual

◆ init() [1/2]

template<typename X , typename Y >
virtual bool ug::CombinedLinearIterator< X, Y >::init ( SmartPtr< ILinearOperator< Y, X > >  J,
const Y &  u 
)
pure virtual

initialize for operator J(u) and linearization point u

This method passes the linear operator J(u) that should be used as underlying by this iterator. As second argument the linearization point is passed. This is needed e.g. for the geometric multigrid method.

Parameters
[in]Jlinearized operator to use as underlying
[in]ulinearization point
Returns
bool success flag

Implements ug::ILinearIterator< X, Y >.

Implemented in ug::LinearIteratorSum< X, Y >, and ug::LinearIteratorProduct< X, Y >.

◆ init() [2/2]

template<typename X , typename Y >
virtual bool ug::CombinedLinearIterator< X, Y >::init ( SmartPtr< ILinearOperator< Y, X > >  L)
pure virtual

initialize for linear operator L

This method passes the operator L that used as underlying by this operator. In addition some preparation step can be made.

Parameters
[in]Llinear operator to use as underlying
Returns
bool success flag

Implements ug::ILinearIterator< X, Y >.

Implemented in ug::LinearIteratorSum< X, Y >, and ug::LinearIteratorProduct< X, Y >.

◆ name()

template<typename X , typename Y >
virtual const char* ug::CombinedLinearIterator< X, Y >::name ( ) const
pure virtual

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< X, Y >.

Implemented in ug::LinearIteratorSum< X, Y >, and ug::LinearIteratorProduct< X, Y >.

◆ supports_parallel()

template<typename X , typename Y >
virtual bool ug::CombinedLinearIterator< X, Y >::supports_parallel ( ) const
inlinevirtual

returns if parallel solving is supported

Implements ug::ILinearIterator< X, Y >.

References ug::CombinedLinearIterator< X, Y >::m_vIterator.

Member Data Documentation

◆ m_vIterator

template<typename X , typename Y >
std::vector<SmartPtr<ILinearIterator<X,Y> > > ug::CombinedLinearIterator< X, Y >::m_vIterator
protected

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