dune-fem  2.8-git
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Related Functions | List of all members
Dune::Fem::InstationaryFunction< Function, StoragePolicy > Class Template Reference

implementation of a Dune::Fem::Function taking an instationary function More...

#include <dune/fem/function/common/instationary.hh>

Inheritance diagram for Dune::Fem::InstationaryFunction< Function, StoragePolicy >:
Inheritance graph

Public Types

typedef BaseType::DomainType DomainType
 domain type More...
 
typedef FunctionSpaceImp FunctionSpaceType
 type of function space this function belongs to More...
 
typedef FunctionImp FunctionType
 type of the implementation (Barton-Nackman) More...
 
typedef FunctionSpaceType ::DomainFieldType DomainFieldType
 field type of domain More...
 
typedef FunctionSpaceType ::RangeFieldType RangeFieldType
 field type of range More...
 
typedef FunctionSpaceType ::RangeType RangeType
 range type More...
 
typedef FunctionSpaceType ::JacobianRangeType JacobianRangeType
 jacobian type More...
 
typedef FunctionSpaceType ::HessianRangeType HessianRangeType
 hessian type More...
 
typedef Mapping< DomainFieldType, RangeFieldType, DomainType, RangeTypeMappingType
 type of mapping base class More...
 

Public Member Functions

virtual void operator() (const DomainType &arg, RangeType &dest) const
 application operator call evaluate More...
 
void operator() (const DomainType &arg, RangeType &dest) const
 Application operator that applies all operators in the linear combination stack. More...
 
void evaluate (const DomainType &x, RangeType &value) const
 evaluate the function More...
 
void jacobian (const DomainType &x, JacobianRangeType &jacobian) const
 evaluate the Jacobian of the function More...
 
void hessian (const DomainType &x, HessianRangeType &hessian) const
 evaluate the hessian of the function More...
 
Constructon
 InstationaryFunction (const Function &function, double time)
 
 InstationaryFunction (Function &&function, double time)
 
Public member methods
void evaluate (const DomainType &x, typename BaseType::RangeType &value) const
 evaluate the function More...
 
void jacobian (const DomainType &x, typename BaseType::JacobianRangeType &jacobian) const
 evaluate the Jacobian of the function More...
 
void hessian (const DomainType &x, typename BaseType::HessianRangeType &hessian) const
 evaluate the hessian of the function More...
 
Set time
double setTime (double time)
 set time to give value More...
 
double time () const
 return set time More...
 

Protected Member Functions

const Implementation & asImp () const
 
Implementation & asImp ()
 
const FunctionImp & asImp () const
 

Static Protected Member Functions

static const Implementation & asImp (const ThisType &other)
 
static Implementation & asImp (ThisType &other)
 
static const FunctionImp & asImp (const ThisType &other)
 
static FunctionImp & asImp (ThisType &other)
 

Related Functions

(Note that these are not member functions.)

static Mapping< FunctionSpaceImp ::DomainFieldType, FunctionSpaceImp ::RangeFieldType, FunctionSpaceImp ::DomainType, FunctionSpaceImp ::RangeTypeoperator+ (const Mapping< FunctionSpaceImp ::DomainFieldType, FunctionSpaceImp ::RangeFieldType, FunctionSpaceImp ::DomainType, FunctionSpaceImp ::RangeType > &a, const Mapping< FunctionSpaceImp ::DomainFieldType, FunctionSpaceImp ::RangeFieldType, FunctionSpaceImp ::DomainType, FunctionSpaceImp ::RangeType > &b)
 add two mappings More...
 
static Mapping< FunctionSpaceImp ::DomainFieldType, FunctionSpaceImp ::RangeFieldType, FunctionSpaceImp ::DomainType, FunctionSpaceImp ::RangeTypeoperator- (const Mapping< FunctionSpaceImp ::DomainFieldType, FunctionSpaceImp ::RangeFieldType, FunctionSpaceImp ::DomainType, FunctionSpaceImp ::RangeType > &a, const Mapping< FunctionSpaceImp ::DomainFieldType, FunctionSpaceImp ::RangeFieldType, FunctionSpaceImp ::DomainType, FunctionSpaceImp ::RangeType > &b)
 substract two mappings More...
 
static Mapping< FunctionSpaceImp ::DomainFieldType, FunctionSpaceImp ::RangeFieldType, FunctionSpaceImp ::DomainType, FunctionSpaceImp ::RangeTypeoperator* (const Mapping< FunctionSpaceImp ::DomainFieldType, FunctionSpaceImp ::RangeFieldType, FunctionSpaceImp ::DomainType, FunctionSpaceImp ::RangeType > &mapping, const FunctionSpaceImp ::RangeFieldType &factor)
 scale mapping with factor More...
 
static Mapping< FunctionSpaceImp ::DomainFieldType, FunctionSpaceImp ::RangeFieldType, FunctionSpaceImp ::DomainType, FunctionSpaceImp ::RangeTypeoperator* (const FunctionSpaceImp ::RangeFieldType &factor, const Mapping< FunctionSpaceImp ::DomainFieldType, FunctionSpaceImp ::RangeFieldType, FunctionSpaceImp ::DomainType, FunctionSpaceImp ::RangeType > &mapping)
 scale mapping with factor More...
 
static Mapping< FunctionSpaceImp ::DomainFieldType, FunctionSpaceImp ::RangeFieldType, FunctionSpaceImp ::DomainType, FunctionSpaceImp ::RangeTypeoperator/ (const Mapping< FunctionSpaceImp ::DomainFieldType, FunctionSpaceImp ::RangeFieldType, FunctionSpaceImp ::DomainType, FunctionSpaceImp ::RangeType > &mapping, const FunctionSpaceImp ::RangeFieldType &factor)
 operator / for mappings More...
 
static Mapping< FunctionSpaceImp ::DomainFieldType, FunctionSpaceImp ::RangeFieldType, FunctionSpaceImp ::DomainType, FunctionSpaceImp ::RangeTypeoperator/ (const FunctionSpaceImp ::RangeFieldType &factor, const Mapping< FunctionSpaceImp ::DomainFieldType, FunctionSpaceImp ::RangeFieldType, FunctionSpaceImp ::DomainType, FunctionSpaceImp ::RangeType > &mapping)
 operator / for mappings More...
 

Detailed Description

template<class Function, template< class > class StoragePolicy = __InstationaryFunction::HoldCopy>
class Dune::Fem::InstationaryFunction< Function, StoragePolicy >

implementation of a Dune::Fem::Function taking an instationary function

It is assumed that all evaluation methods are present on the parameter function and have a second parameter for the time:

void Function::evaluate(const DomainType &x, double time, RangeType &value) const;
void Function::jacobian(const DomainType &x, double time, JacobianRangeType &value) const;
void Function::hessian(const DomainType &x, double time, HessianRangeType &value) const;
FunctionSpaceType ::RangeType RangeType
range type
Definition: common/function.hh:68
void evaluate(const DomainType &x, RangeType &value) const
evaluate the function
Definition: common/function.hh:107
void jacobian(const DomainType &x, JacobianRangeType &jacobian) const
evaluate the Jacobian of the function
Definition: common/function.hh:117
FunctionSpaceType ::HessianRangeType HessianRangeType
hessian type
Definition: common/function.hh:72
FunctionSpaceType ::JacobianRangeType JacobianRangeType
jacobian type
Definition: common/function.hh:70
void hessian(const DomainType &x, HessianRangeType &hessian) const
evaluate the hessian of the function
Definition: common/function.hh:127
BaseType::DomainType DomainType
domain type
Definition: instationary.hh:163

Users may prescribe how the parameter function is stored by providing a second template parameter, the storage policy. The policy is class that must be constructible from a function object or reference and that has a single method:

const Function &Policy::get() const;
std::tuple_element< i, Tuple >::type & get(Dune::TypeIndexedTuple< Tuple, Types > &tuple)
Definition: typeindexedtuple.hh:122
Function()=default
default constructor

The default policy is to copy the function parameter. The free-standing method

InstationaryFunction< Function, __InstationaryFunction::HoldCopy > instationaryFunction(Function function, double time)
Definition: instationary.hh:213

may be used to conveniently create a new instance of InstationaryFunction. Use

auto g = instationaryFunction( std::cref( f ), 0. );

to create an instationary function that holds a reference to f instead of a copy.

Template Parameters
Functionan instationary function
StoragePolicystorage policy

Member Typedef Documentation

◆ DomainFieldType

template<class FunctionSpaceImp , class FunctionImp >
typedef FunctionSpaceType :: DomainFieldType Dune::Fem::Function< FunctionSpaceImp, FunctionImp >::DomainFieldType
inherited

field type of domain

◆ DomainType

template<class Function , template< class > class StoragePolicy = __InstationaryFunction::HoldCopy>
typedef BaseType::DomainType Dune::Fem::InstationaryFunction< Function, StoragePolicy >::DomainType

domain type

◆ FunctionSpaceType

template<class FunctionSpaceImp , class FunctionImp >
typedef FunctionSpaceImp Dune::Fem::Function< FunctionSpaceImp, FunctionImp >::FunctionSpaceType
inherited

type of function space this function belongs to

◆ FunctionType

template<class FunctionSpaceImp , class FunctionImp >
typedef FunctionImp Dune::Fem::Function< FunctionSpaceImp, FunctionImp >::FunctionType
inherited

type of the implementation (Barton-Nackman)

◆ HessianRangeType

template<class FunctionSpaceImp , class FunctionImp >
typedef FunctionSpaceType :: HessianRangeType Dune::Fem::Function< FunctionSpaceImp, FunctionImp >::HessianRangeType
inherited

hessian type

◆ JacobianRangeType

template<class FunctionSpaceImp , class FunctionImp >
typedef FunctionSpaceType :: JacobianRangeType Dune::Fem::Function< FunctionSpaceImp, FunctionImp >::JacobianRangeType
inherited

jacobian type

◆ MappingType

template<class FunctionSpaceImp , class FunctionImp >
typedef Mapping< DomainFieldType, RangeFieldType, DomainType, RangeType > Dune::Fem::Function< FunctionSpaceImp, FunctionImp >::MappingType
inherited

type of mapping base class

◆ RangeFieldType

template<class FunctionSpaceImp , class FunctionImp >
typedef FunctionSpaceType :: RangeFieldType Dune::Fem::Function< FunctionSpaceImp, FunctionImp >::RangeFieldType
inherited

field type of range

◆ RangeType

template<class FunctionSpaceImp , class FunctionImp >
typedef FunctionSpaceType :: RangeType Dune::Fem::Function< FunctionSpaceImp, FunctionImp >::RangeType
inherited

range type

Constructor & Destructor Documentation

◆ InstationaryFunction() [1/2]

template<class Function , template< class > class StoragePolicy = __InstationaryFunction::HoldCopy>
Dune::Fem::InstationaryFunction< Function, StoragePolicy >::InstationaryFunction ( const Function function,
double  time 
)
inline

◆ InstationaryFunction() [2/2]

template<class Function , template< class > class StoragePolicy = __InstationaryFunction::HoldCopy>
Dune::Fem::InstationaryFunction< Function, StoragePolicy >::InstationaryFunction ( Function &&  function,
double  time 
)
inline

Member Function Documentation

◆ asImp() [1/7]

template<class FunctionSpaceImp , class FunctionImp >
Implementation& Dune::Fem::BartonNackmanInterface< Interface, Implementation >::asImp
inlineprotectedinherited

◆ asImp() [2/7]

template<class FunctionSpaceImp , class FunctionImp >
const Implementation& Dune::Fem::BartonNackmanInterface< Interface, Implementation >::asImp
inlineprotectedinherited

◆ asImp() [3/7]

const FunctionImp & Dune::Fem::BartonNackmanInterface< Function< FunctionSpaceImp, FunctionImp > , FunctionImp >::asImp ( ) const
inlineprotectedinherited

◆ asImp() [4/7]

template<class FunctionSpaceImp , class FunctionImp >
static const Implementation& Dune::Fem::BartonNackmanInterface< Interface, Implementation >::asImp
inlinestaticprotectedinherited

◆ asImp() [5/7]

static const FunctionImp & Dune::Fem::BartonNackmanInterface< Function< FunctionSpaceImp, FunctionImp > , FunctionImp >::asImp ( const ThisType other)
inlinestaticprotectedinherited

◆ asImp() [6/7]

template<class FunctionSpaceImp , class FunctionImp >
static Implementation& Dune::Fem::BartonNackmanInterface< Interface, Implementation >::asImp
inlinestaticprotectedinherited

◆ asImp() [7/7]

static FunctionImp & Dune::Fem::BartonNackmanInterface< Function< FunctionSpaceImp, FunctionImp > , FunctionImp >::asImp ( ThisType other)
inlinestaticprotectedinherited

◆ evaluate() [1/2]

template<class FunctionSpaceImp , class FunctionImp >
void Dune::Fem::Function< FunctionSpaceImp, FunctionImp >::evaluate ( const DomainType x,
RangeType value 
) const
inlineinherited

evaluate the function

Parameters
[in]xevaluation point
[out]valuevalue of the function in x

◆ evaluate() [2/2]

template<class Function , template< class > class StoragePolicy = __InstationaryFunction::HoldCopy>
void Dune::Fem::InstationaryFunction< Function, StoragePolicy >::evaluate ( const DomainType x,
typename BaseType::RangeType value 
) const
inline

evaluate the function

Parameters
[in]xevaluation point
[out]valuevalue of the function in x

◆ hessian() [1/2]

template<class FunctionSpaceImp , class FunctionImp >
void Dune::Fem::Function< FunctionSpaceImp, FunctionImp >::hessian ( const DomainType x,
HessianRangeType hessian 
) const
inlineinherited

evaluate the hessian of the function

Parameters
[in]xevaluation point
[out]hessianvalue of the hessian in x

◆ hessian() [2/2]

template<class Function , template< class > class StoragePolicy = __InstationaryFunction::HoldCopy>
void Dune::Fem::InstationaryFunction< Function, StoragePolicy >::hessian ( const DomainType x,
typename BaseType::HessianRangeType hessian 
) const
inline

evaluate the hessian of the function

Parameters
[in]xevaluation point
[out]hessianvalue of the hessian in x

◆ jacobian() [1/2]

template<class FunctionSpaceImp , class FunctionImp >
void Dune::Fem::Function< FunctionSpaceImp, FunctionImp >::jacobian ( const DomainType x,
JacobianRangeType jacobian 
) const
inlineinherited

evaluate the Jacobian of the function

Parameters
[in]xevaluation point
[out]jacobianvalue of the Jacobian in x

◆ jacobian() [2/2]

template<class Function , template< class > class StoragePolicy = __InstationaryFunction::HoldCopy>
void Dune::Fem::InstationaryFunction< Function, StoragePolicy >::jacobian ( const DomainType x,
typename BaseType::JacobianRangeType jacobian 
) const
inline

evaluate the Jacobian of the function

Parameters
[in]xevaluation point
[out]jacobianvalue of the Jacobian in x

◆ operator()() [1/2]

template<class FunctionSpaceImp , class FunctionImp >
virtual void Dune::Fem::Function< FunctionSpaceImp, FunctionImp >::operator() ( const DomainType arg,
RangeType dest 
) const
inlinevirtualinherited

application operator call evaluate

Parameters
[in]argargument
[out]destdestination, i.e. f(arg)

◆ operator()() [2/2]

void Dune::Fem::Mapping< FunctionSpaceImp ::DomainFieldType , FunctionSpaceImp ::RangeFieldType , FunctionSpaceImp ::DomainType , FunctionSpaceImp ::RangeType >::operator() ( const DomainType arg,
RangeType dest 
) const
inlineinherited

Application operator that applies all operators in the linear combination stack.

Parameters
[in]argargument
[out]destdestination

◆ setTime()

double Dune::Fem::BasicInstationaryFunction< Function::FunctionSpaceType , InstationaryFunction< Function, __InstationaryFunction::HoldCopy > >::setTime ( double  time)
inlineinherited

set time to give value

Parameters
[in]timetime to be used
Returns
set time

◆ time()

double Dune::Fem::BasicInstationaryFunction< Function::FunctionSpaceType , InstationaryFunction< Function, __InstationaryFunction::HoldCopy > >::time ( ) const
inlineinherited

return set time

Friends And Related Function Documentation

◆ operator*() [1/2]

static Mapping< FunctionSpaceImp ::DomainFieldType , FunctionSpaceImp ::RangeFieldType , FunctionSpaceImp ::DomainType , FunctionSpaceImp ::RangeType > operator* ( const RFieldType &  factor,
const Mapping< DFieldType, RFieldType, DType, RType > &  mapping 
)
related

scale mapping with factor

Parameters
[in]factorfactor with which mapping is scaled
[in]mappingMapping which is scaled
Returns
new object mapping

◆ operator*() [2/2]

static Mapping< FunctionSpaceImp ::DomainFieldType , FunctionSpaceImp ::RangeFieldType , FunctionSpaceImp ::DomainType , FunctionSpaceImp ::RangeType > operator* ( const Mapping< DFieldType, RFieldType, DType, RType > &  mapping,
const RFieldType &  factor 
)
related

scale mapping with factor

Parameters
[in]mappingMapping which is scaled
[in]factorfactor with which mapping is scaled
Returns
new object mapping

◆ operator+()

static Mapping< FunctionSpaceImp ::DomainFieldType , FunctionSpaceImp ::RangeFieldType , FunctionSpaceImp ::DomainType , FunctionSpaceImp ::RangeType > operator+ ( const Mapping< DFieldType, RFieldType, DType, RType > &  a,
const Mapping< DFieldType, RFieldType, DType, RType > &  b 
)
related

add two mappings

Parameters
[in]amapping 1
[in]bmapping 2
Returns
new object mapping

◆ operator-()

static Mapping< FunctionSpaceImp ::DomainFieldType , FunctionSpaceImp ::RangeFieldType , FunctionSpaceImp ::DomainType , FunctionSpaceImp ::RangeType > operator- ( const Mapping< DFieldType, RFieldType, DType, RType > &  a,
const Mapping< DFieldType, RFieldType, DType, RType > &  b 
)
related

substract two mappings

Parameters
[in]amapping 1
[in]bmapping 2
Returns
new object mapping

◆ operator/() [1/2]

static Mapping< FunctionSpaceImp ::DomainFieldType , FunctionSpaceImp ::RangeFieldType , FunctionSpaceImp ::DomainType , FunctionSpaceImp ::RangeType > operator/ ( const RFieldType &  factor,
const Mapping< DFieldType, RFieldType, DType, RType > &  mapping 
)
related

operator / for mappings

Parameters
[in]factorby which result of mapping is divided
[in]mappingwhich is divided
Returns
new object mapping

◆ operator/() [2/2]

static Mapping< FunctionSpaceImp ::DomainFieldType , FunctionSpaceImp ::RangeFieldType , FunctionSpaceImp ::DomainType , FunctionSpaceImp ::RangeType > operator/ ( const Mapping< DFieldType, RFieldType, DType, RType > &  mapping,
const RFieldType &  factor 
)
related

operator / for mappings

Parameters
[in]mappingmapping which is divided
[in]factorf factor by which result of mapping is divided
Returns
new object mapping

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