ug4
ug::LinearIteratorSum< X, Y > Class Template Reference

#include <iterator_product.h>

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

Public Member Functions

virtual bool apply (Y &c, const X &d)
 compute new correction c = B*d More...
 
virtual bool apply_update_defect (Y &c, X &d)
 compute new correction c = B*d and update defect d := d - A*c More...
 
virtual SmartPtr< ILinearIterator< X, Y > > clone ()
 clone More...
 
virtual bool init (SmartPtr< ILinearOperator< Y, X > > J, const Y &u)
 initialize for operator J(u) and linearization point u More...
 
virtual bool init (SmartPtr< ILinearOperator< Y, X > > L)
 initialize for linear operator L More...
 
 LinearIteratorSum ()
 
 LinearIteratorSum (const std::vector< SmartPtr< ILinearIterator< X, Y > > > &vIterator)
 
virtual const char * name () const
 returns the name of iterator More...
 
- Public Member Functions inherited from ug::CombinedLinearIterator< X, Y >
void add_iterator (SmartPtr< ILinearIterator< X, Y > > I)
 
void add_iterator (SmartPtr< ILinearIterator< X, Y > > I, size_t nr)
 
 CombinedLinearIterator ()
 
 CombinedLinearIterator (const std::vector< SmartPtr< ILinearIterator< X, Y > > > &vIterator)
 
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 Types

typedef CombinedLinearIterator< X, Y > base_type
 

Protected Attributes

SmartPtr< ILinearOperator< Y, X > > m_spOp
 
std::vector< SmartPtr< ILinearIterator< X, Y > > > m_vIterator
 
- Protected Attributes inherited from ug::CombinedLinearIterator< X, Y >
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::LinearIteratorSum< X, Y >

This operator is a sum of ILinearIterator (additive composition).

Member Typedef Documentation

◆ base_type

template<typename X , typename Y >
typedef CombinedLinearIterator<X,Y> ug::LinearIteratorSum< X, Y >::base_type
protected

Constructor & Destructor Documentation

◆ LinearIteratorSum() [1/2]

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

◆ LinearIteratorSum() [2/2]

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

Member Function Documentation

◆ apply()

template<typename X , typename Y >
virtual bool ug::LinearIteratorSum< X, Y >::apply ( Y &  c,
const X &  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::CombinedLinearIterator< X, Y >.

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

Referenced by ug::LinearIteratorSum< X, Y >::apply_update_defect().

◆ apply_update_defect()

template<typename X , typename Y >
virtual bool ug::LinearIteratorSum< X, Y >::apply_update_defect ( Y &  c,
X &  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::CombinedLinearIterator< X, Y >.

References ug::LinearIteratorSum< X, Y >::apply(), and ug::LinearIteratorSum< X, Y >::m_spOp.

◆ clone()

template<typename X , typename Y >
virtual SmartPtr<ILinearIterator<X,Y> > ug::LinearIteratorSum< X, Y >::clone ( )
inlinevirtual

◆ init() [1/2]

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

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

References ug::LinearIteratorSum< X, Y >::m_spOp, and ug::LinearIteratorSum< X, Y >::m_vIterator.

◆ init() [2/2]

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

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

References ug::LinearIteratorSum< X, Y >::m_spOp, and ug::LinearIteratorSum< X, Y >::m_vIterator.

◆ name()

template<typename X , typename Y >
virtual const char* ug::LinearIteratorSum< X, Y >::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::CombinedLinearIterator< X, Y >.

Member Data Documentation

◆ m_spOp

template<typename X , typename Y >
SmartPtr<ILinearOperator<Y,X> > ug::LinearIteratorSum< X, Y >::m_spOp
protected

◆ 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: