Loading [MathJax]/extensions/tex2jax.js
ug4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ug::AnalyzingSolver< M, X, Y > Class Template Reference

#include <analyzing_solver.h>

+ Inheritance diagram for ug::AnalyzingSolver< M, X, Y >:

Public Types

typedef Y codomain_function_type
 Range space.
 
typedef X domain_function_type
 Domain space.
 
typedef M matrix_type
 Matrix type.
 
- Public Types inherited from ug::ILinearOperatorInverse< X, Y >
typedef Y codomain_function_type
 Range space.
 
typedef X domain_function_type
 Domain space.
 
- Public Types inherited from ug::ILinearIterator< X, Y >
typedef Y codomain_function_type
 Range space.
 
typedef X domain_function_type
 Domain space.
 

Public Member Functions

 AnalyzingSolver (SmartPtr< ILinearOperatorInverse< X, Y > > pLinearOperatorInverse)
 
virtual bool apply (Y &u, const X &f)
 applies inverse operator, i.e. returns u = A^{-1} f
 
virtual bool apply_return_defect (Y &u, X &f)
 applies inverse operator, i.e. returns u = A^{-1} f and returns defect d := f - A*u
 
void check (const matrix_type &A)
 
void check (SmartPtr< ILinearOperator< Y, X > > A)
 
virtual std::string config_string () const
 returns information about configuration parameters
 
virtual bool init (SmartPtr< ILinearOperator< Y, X > > A)
 initializes for the inverse for a linear operator
 
virtual bool init (SmartPtr< ILinearOperator< Y, X > > A, const Y &u)
 initializes for the inverse for a linearized operator at linearization point u
 
virtual const char * name () const
 returns the name of the operator inverse
 
virtual bool supports_parallel () const
 returns if parallel solving is supported
 
virtual ~AnalyzingSolver ()
 virtual destructor
 
- Public Member Functions inherited from ug::ILinearOperatorInverse< X, Y >
virtual bool apply_update_defect (Y &u, X &f)
 compute new correction c = B*d and update defect d := d - A*c
 
virtual SmartPtr< ILinearIterator< X, Y > > clone ()
 clone
 
SmartPtr< IConvergenceCheck< X > > convergence_check ()
 returns the convergence check
 
ConstSmartPtr< IConvergenceCheck< X > > convergence_check () const
 returns the convergence check
 
number defect () const
 returns the current defect
 
 ILinearOperatorInverse ()
 constructor setting convergence check to (100, 1e-12, 1e-12, true)
 
 ILinearOperatorInverse (SmartPtr< IConvergenceCheck< X > > spConvCheck)
 Default constructor.
 
SmartPtr< ILinearOperator< Y, X > > linear_operator ()
 returns the current Operator this Inverse Operator is initialized for
 
number reduction () const
 returns the current relative reduction
 
void set_convergence_check (SmartPtr< IConvergenceCheck< X > > spConvCheck)
 set the convergence check
 
virtual int standard_offset () const
 returns the standard offset for output
 
int step () const
 returns the current number of steps
 
virtual ~ILinearOperatorInverse ()
 virtual destructor
 
- Public Member Functions inherited from ug::ILinearIterator< X, Y >
SmartPtr< IDamping< X, Y > > damping ()
 returns the scaling
 
 ILinearIterator ()
 constructor
 
 ILinearIterator (const ILinearIterator< X, Y > &parent)
 copy constructor
 
void set_damp (number factor)
 sets the damping to a constant factor
 
void set_damp (SmartPtr< IDamping< X, Y > > spScaling)
 sets a scaling for the correction
 
virtual ~ILinearIterator ()
 virtual destructor
 

Private Attributes

SmartPtr< ILinearOperatorInverse< X, Y > > m_pLinearOperatorInverse
 

Additional Inherited Members

- Protected Attributes inherited from ug::ILinearOperatorInverse< X, Y >
SmartPtr< IConvergenceCheck< X > > m_spConvCheck
 smart pointer holding the convergence check
 
SmartPtr< ILinearOperator< Y, X > > m_spLinearOperator
 Operator that is inverted by this Inverse Operator.
 
- Protected Attributes inherited from ug::ILinearIterator< X, Y >
SmartPtr< IDamping< X, Y > > m_spDamping
 the scaling
 

Member Typedef Documentation

◆ codomain_function_type

template<typename M , typename X , typename Y = X>
typedef Y ug::AnalyzingSolver< M, X, Y >::codomain_function_type

Range space.

◆ domain_function_type

template<typename M , typename X , typename Y = X>
typedef X ug::AnalyzingSolver< M, X, Y >::domain_function_type

Domain space.

◆ matrix_type

template<typename M , typename X , typename Y = X>
typedef M ug::AnalyzingSolver< M, X, Y >::matrix_type

Matrix type.

Constructor & Destructor Documentation

◆ AnalyzingSolver()

template<typename M , typename X , typename Y = X>
ug::AnalyzingSolver< M, X, Y >::AnalyzingSolver ( SmartPtr< ILinearOperatorInverse< X, Y > >  pLinearOperatorInverse)
inline

◆ ~AnalyzingSolver()

template<typename M , typename X , typename Y = X>
virtual ug::AnalyzingSolver< M, X, Y >::~AnalyzingSolver ( )
inlinevirtual

virtual destructor

Member Function Documentation

◆ apply()

template<typename M , typename X , typename Y = X>
virtual bool ug::AnalyzingSolver< M, X, Y >::apply ( Y &  u,
const X &  f 
)
inlinevirtual

applies inverse operator, i.e. returns u = A^{-1} f

This method applies the inverse operator, i.e. u = A^{-1} f. The domain function f remains unchanged. Note, that this method can always be implemented by creating a copy of f and calling apply_return_defect with this copy.

Parameters
[in]fright-hand side
[out]usolution
Returns
bool success flag

Implements ug::ILinearOperatorInverse< X, Y >.

References ug::AnalyzingSolver< M, X, Y >::m_pLinearOperatorInverse.

◆ apply_return_defect()

template<typename M , typename X , typename Y = X>
virtual bool ug::AnalyzingSolver< M, X, Y >::apply_return_defect ( Y &  u,
X &  f 
)
inlinevirtual

applies inverse operator, i.e. returns u = A^{-1} f and returns defect d := f - A*u

This method applies the inverse operator, i.e. u = A^{-1} f. The domain function f is changed in the way, that the defect d := f - A*u is returned in the function. This is always useful, when the inverting 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 := f - A*u.

Parameters
[in,out]fright-hand side
[out]usolution
Returns
bool success flag

Implements ug::ILinearOperatorInverse< X, Y >.

References ug::AnalyzingSolver< M, X, Y >::m_pLinearOperatorInverse.

◆ check() [1/2]

template<typename M , typename X , typename Y = X>
void ug::AnalyzingSolver< M, X, Y >::check ( const matrix_type A)
inline

◆ check() [2/2]

template<typename M , typename X , typename Y = X>
void ug::AnalyzingSolver< M, X, Y >::check ( SmartPtr< ILinearOperator< Y, X > >  A)
inline

◆ config_string()

template<typename M , typename X , typename Y = X>
virtual std::string ug::AnalyzingSolver< M, X, Y >::config_string ( ) const
inlinevirtual

returns information about configuration parameters

this should return necessary information about parameters and possibly calling config_string of subcomponents.

Returns
std::string necessary information about configuration parameters

Reimplemented from ug::ILinearOperatorInverse< X, Y >.

References ug::AnalyzingSolver< M, X, Y >::m_pLinearOperatorInverse.

◆ init() [1/2]

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

initializes for the inverse for a linear operator

This method passes the operator L that is inverted by this operator. In addition some preparation step can be made.

Parameters
[in]Llinear operator to invert
Returns
bool success flag

Reimplemented from ug::ILinearOperatorInverse< X, Y >.

References ug::AnalyzingSolver< M, X, Y >::check(), and ug::AnalyzingSolver< M, X, Y >::m_pLinearOperatorInverse.

◆ init() [2/2]

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

initializes for the inverse for a linearized operator at linearization point u

This method passes the linear operator J(u) that should be inverted by this operator. As second argument the linearization point is passed. This is needed e.g. for the geometric multigrid method, that inverts a linearized operator based on coarser grid operators, that have to be initialized based on the linearization point.

Parameters
[in]Jlinearized operator to invert
[in]ulinearization point
Returns
bool success flag

Reimplemented from ug::ILinearOperatorInverse< X, Y >.

References ug::AnalyzingSolver< M, X, Y >::check(), and ug::AnalyzingSolver< M, X, Y >::m_pLinearOperatorInverse.

◆ name()

template<typename M , typename X , typename Y = X>
virtual const char * ug::AnalyzingSolver< M, X, Y >::name ( ) const
inlinevirtual

returns the name of the operator inverse

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

Returns
const char* name of inverse operator

Implements ug::ILinearOperatorInverse< X, Y >.

References ug::AnalyzingSolver< M, X, Y >::m_pLinearOperatorInverse.

◆ supports_parallel()

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

returns if parallel solving is supported

Implements ug::ILinearOperatorInverse< X, Y >.

References ug::AnalyzingSolver< M, X, Y >::m_pLinearOperatorInverse.

Member Data Documentation

◆ m_pLinearOperatorInverse


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