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

describes an inverse mapping X->Y More...

#include <operator_inverse.h>

Inherited by ug::LimexNewtonSolver< class >.

Public Types

typedef Y codomain_function_type
 Range space. More...
 
typedef X domain_function_type
 Domain space. More...
 

Public Member Functions

virtual bool apply (X &u)=0
 apply the operator, i.e. u = N^{-1}(0) More...
 
virtual std::string config_string () const =0
 returns information about configuration parameters More...
 
virtual bool init (SmartPtr< IOperator< Y, X > > N)=0
 initializes the operator for the inversion of the operator N: Y -> X More...
 
virtual bool prepare (X &u)=0
 prepares the function u for application More...
 
virtual ~IOperatorInverse ()
 virtual destructor More...
 

Detailed Description

template<typename X, typename Y = X>
class ug::IOperatorInverse< X, Y >

describes an inverse mapping X->Y

This class is the base class for the inversion of the operator given in form of the IOperator interface class. Given a operator N(u), the basic usage of this class is to invert this operator, i.e. to compute

N(u) = 0, i.e. u := N^{-1}(0).

This application has been split up into three steps:

  1. init(N): This method initializes the inverse operator. The inverse operator is initialized the way that, its application will be the inverse application of the operator N passed in by this function. The prepare method can only be called, when this method has been called once.
  2. prepare(u): This method prepares the function u, before it can be used in the apply method. Here, typically dirichlet values are set.
  3. apply(u): This method performs the inversion. Before this method is called the init and prepare methods have to be called.

This splitting has been made, since initialization and preparation may be computationally expansive. Thus, the user of this class has the choice when to call this initialization/preparation. E.g. when the operator is applied several times on the same vectors, those have only to be prepared once and the init of the operator is only needed once.

Member Typedef Documentation

◆ codomain_function_type

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

Range space.

◆ domain_function_type

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

Domain space.

Constructor & Destructor Documentation

◆ ~IOperatorInverse()

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

virtual destructor

Member Function Documentation

◆ apply()

template<typename X , typename Y = X>
virtual bool ug::IOperatorInverse< X, Y >::apply ( X &  u)
pure virtual

apply the operator, i.e. u = N^{-1}(0)

This method inverts the operator N and returns the solution u = N^{-1}(0).

Parameters
[in,out]udomain function with solution at output
Returns
bool success flag

Implemented in ug::NLJacobiSolver< TAlgebra >, ug::NLGaussSeidelSolver< TDomain, TAlgebra >, ug::NewtonSolver< TAlgebra >, and ug::NestedIterationSolver< TDomain, TAlgebra >.

◆ config_string()

template<typename X , typename Y = X>
virtual std::string ug::IOperatorInverse< X, Y >::config_string ( ) const
pure virtual

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

Implemented in ug::NLJacobiSolver< TAlgebra >, ug::NLGaussSeidelSolver< TDomain, TAlgebra >, ug::NewtonSolver< TAlgebra >, ug::NestedIterationSolver< TDomain, TAlgebra >, and ug::LimexNewtonSolver< class >.

◆ init()

template<typename X , typename Y = X>
virtual bool ug::IOperatorInverse< X, Y >::init ( SmartPtr< IOperator< Y, X > >  N)
pure virtual

initializes the operator for the inversion of the operator N: Y -> X

This method sets the (nonlinear) operator that should be inverted by this inverse operator. In addition preparations can be made to facilitate the application of the inverse.

Parameters
[in]Noperator that is to be inverted
Returns
bool success flag

◆ prepare()

template<typename X , typename Y = X>
virtual bool ug::IOperatorInverse< X, Y >::prepare ( X &  u)
pure virtual

prepares the function u for application

This method prepares the function u before it can be used to find the solution of N(u) = 0. Typically, dirichlet values are set here.

Parameters
[in]udomain function
Returns
bool success flag

Implemented in ug::NLJacobiSolver< TAlgebra >, ug::NLGaussSeidelSolver< TDomain, TAlgebra >, ug::NewtonSolver< TAlgebra >, and ug::NestedIterationSolver< TDomain, TAlgebra >.


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