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

describes a mapping X->Y More...

#include <operator.h>

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

Public Types

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

Public Member Functions

virtual void apply (Y &d, const X &u)=0
 computes the nonlinear mapping d := N(u) More...
 
virtual void init ()=0
 initializes the operator More...
 
virtual void prepare (X &u)=0
 prepares domain and codomain functions for application More...
 
virtual ~IOperator ()
 virtual destructor More...
 

Detailed Description

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

describes a mapping X->Y

This class is the base class for all mappings between two spaces. The domain space and the codomain space are passed as template parameters. In particular, the mapping can be nonlinear. For linear (or linearized) mappings see ILinearizedOperator. The basic usage of this class is to provide the computation of:

d := N(u),

where d is from the codomain space, u a function of the domain space and N() is a (nonlinear-) mapping.

This application is splitted into three methods, that have to be called in the correct order:

  1. init(): This method initializes the operator for application. It has to be called once before one of the other two methods can be invoked. There is no need to call this method more than once, but sometimes - due to parameter change - this is desirable and can be done.
  2. prepare(): This method is used to prepare the in- and output vector used later in apply. It can be called, after the init method has been called at least once. The prepare method is e.g. used to set dirichlet values.
  3. apply(): This method can be called when the operator has been initialized by a call of init and with two functions, that have been prepare using the prepare method. It maps the function from the domain space to the range space.

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.

Template Parameters
XDomain space function
YRange space function

Member Typedef Documentation

◆ codomain_function_type

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

Range space.

◆ domain_function_type

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

Domain space.

Constructor & Destructor Documentation

◆ ~IOperator()

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

virtual destructor

Member Function Documentation

◆ apply()

template<typename X , typename Y = X>
virtual void ug::IOperator< X, Y >::apply ( Y &  d,
const X &  u 
)
pure virtual

computes the nonlinear mapping d := N(u)

This method maps a function from the domain space to the range space. Note, that is must be called with functions, that have previously been prepared using the 'prepare'-method and that the operator must have been initialized using the 'init'-method

Parameters
[in]udomain function
[out]dcodomain function
Returns
bool flag if application successful

Implemented in ug::ILinearOperator< X, X >, ug::MatrixOperator< M, X, X >, ug::AssembledOperator< TAlgebra >, and ug::ITimeIntegrator< class, class >.

◆ init()

◆ prepare()

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

prepares domain and codomain functions for application

This method prepares the in- and output functions for the application and has to be called once before the apply method can be invoked with the functions used here.

Parameters
[in]udomain function
Returns
bool flag if preparation successful

Implemented in ug::ILinearOperator< X, Y >, ug::ILinearOperator< X, X >, ug::AssembledOperator< TAlgebra >, and ug::ITimeIntegrator< class, class >.


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