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

describes a linear mapping X->Y More...

#include <linear_operator.h>

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

Public Types

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

Public Member Functions

virtual void apply (Y &f, const X &u)=0
 
virtual void apply_sub (Y &f, const X &u)=0
 
virtual void init ()=0
 init operator More...
 
virtual void init (const X &u)=0
 init operator depending on a function u More...
 
virtual void prepare (X &u)
 default implementation for IOperator interface More...
 
virtual ~ILinearOperator ()
 virtual destructor More...
 
- Public Member Functions inherited from ug::IOperator< X, X >
virtual void apply (X &d, const X &u)=0
 computes the nonlinear mapping d := N(u) More...
 
virtual ~IOperator ()
 virtual destructor More...
 

Detailed Description

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

describes a linear mapping X->Y

This class is the base class for all linear mappings between two spaces. The domain space and the codomain space are passed as template parameters. The mapping must be linear. For nonlinear mappings see IOperator. The basic usage of this class is to provide the computation of:

f := L*u,    (resp.  d := J(u) * c in iterative schemes),

where f (resp. d) is from the codomain space, u (resp. c) a function of the domain space and L is a linear mapping (resp. J(u) a linearized mapping)

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

  1. init() or init(u): Theses methods initialize the operator for application. One of these methods has to be called once before one of the other two methods can be invoked. There is no need to init the operator more than once, but sometimes - due to parameter change - this is desirable and can be done.
  2. apply() or apply_sub(): These methods can be called when the operator has been initialized by a call of init. These function perform the linear mapping, where in the case of apply_sub() the result is subtracted from the input function.

This splitting has been made, since initialization may be computationally expansive. Thus, the user of this class has the choice when to call this initialization. E.g. when the operator is applied several times, 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::ILinearOperator< X, Y >::codomain_function_type

Range space.

◆ domain_function_type

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

Domain space.

Constructor & Destructor Documentation

◆ ~ILinearOperator()

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

virtual destructor

Member Function Documentation

◆ apply()

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

This method applies the operator, i.e. f = L*u (or d = J(u)*c in iterative schemes). Note, that the operator must have been initialized once before this method can be used.

Parameters
[in]udomain function
[out]fcodomain function
Returns
bool success flag

Implemented in ug::MatrixOperator< M, X, X >, ug::SchurComplementOperator< TAlgebra >, ug::LocalSchurComplement< TAlgebra >, ug::LocalSchurComplement< algebra_type >, ug::AssembledLinearOperator< TAlgebra >, and ug::MatrixOperator< TAlgebra::matrix_type, TAlgebra::vector_type >.

◆ apply_sub()

template<typename X , typename Y = X>
virtual void ug::ILinearOperator< X, Y >::apply_sub ( Y &  f,
const X &  u 
)
pure virtual

This method applies the operator and subracts the result from the input codomain function, i.e. f -= L*u (or d -= J(u)*c in iterative schemes). Note, that the operator must have been initialized once before this method can be used.

Parameters
[in]udomain function
[in,out]fcodomain function
Returns
bool success flag

Implemented in ug::MatrixOperator< M, X, X >, ug::SchurComplementOperator< TAlgebra >, ug::LocalSchurComplement< TAlgebra >, ug::LocalSchurComplement< algebra_type >, ug::AssembledLinearOperator< TAlgebra >, and ug::MatrixOperator< TAlgebra::matrix_type, TAlgebra::vector_type >.

◆ init() [1/2]

template<typename X , typename Y = X>
virtual void ug::ILinearOperator< X, Y >::init ( )
pure virtual

◆ init() [2/2]

template<typename X , typename Y = X>
virtual void ug::ILinearOperator< X, Y >::init ( const X &  u)
pure virtual

init operator depending on a function u

This method initializes the operator. Once initialized the 'apply'-method can be called. The function u is passed here, since the linear operator may be the linearization of some non-linear operator. Thus, the operator depends on the linearization point. If the operator is not a linearization, this method can be implemented by simply calling init() and forgetting about the linearization point.

Parameters
[in]ufunction (linearization point)
Returns
bool success flag

Implemented in ug::SchurComplementMatrixOperator< TAlgebra, M, X, Y >, ug::MatrixOperator< M, X, Y >, ug::MatrixOperator< M, X, X >, ug::MatrixDiagonalInverse< M, X, Y >, ug::MatrixDiagonal< M, X, Y >, ug::AssembledLinearOperator< TAlgebra >, ug::SchurComplementOperator< TAlgebra >, ug::LocalSchurComplement< TAlgebra >, ug::LocalSchurComplement< algebra_type >, and ug::MatrixOperator< TAlgebra::matrix_type, TAlgebra::vector_type >.

◆ prepare()

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

default implementation for IOperator interface

Implements ug::IOperator< X, X >.


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