DUNE-FEM (unstable)

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>

Public Types

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

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...
 
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
 

Related Functions

(Note that these are not member functions.)

static Mapping< Function::FunctionSpaceType ::DomainFieldType, Function::FunctionSpaceType ::RangeFieldType, Function::FunctionSpaceType ::DomainType, Function::FunctionSpaceType ::RangeTypeoperator+ (const Mapping< Function::FunctionSpaceType ::DomainFieldType, Function::FunctionSpaceType ::RangeFieldType, Function::FunctionSpaceType ::DomainType, Function::FunctionSpaceType ::RangeType > &a, const Mapping< Function::FunctionSpaceType ::DomainFieldType, Function::FunctionSpaceType ::RangeFieldType, Function::FunctionSpaceType ::DomainType, Function::FunctionSpaceType ::RangeType > &b)
 add two mappings More...
 
static Mapping< Function::FunctionSpaceType ::DomainFieldType, Function::FunctionSpaceType ::RangeFieldType, Function::FunctionSpaceType ::DomainType, Function::FunctionSpaceType ::RangeTypeoperator- (const Mapping< Function::FunctionSpaceType ::DomainFieldType, Function::FunctionSpaceType ::RangeFieldType, Function::FunctionSpaceType ::DomainType, Function::FunctionSpaceType ::RangeType > &a, const Mapping< Function::FunctionSpaceType ::DomainFieldType, Function::FunctionSpaceType ::RangeFieldType, Function::FunctionSpaceType ::DomainType, Function::FunctionSpaceType ::RangeType > &b)
 substract two mappings More...
 
static Mapping< Function::FunctionSpaceType ::DomainFieldType, Function::FunctionSpaceType ::RangeFieldType, Function::FunctionSpaceType ::DomainType, Function::FunctionSpaceType ::RangeTypeoperator* (const Mapping< Function::FunctionSpaceType ::DomainFieldType, Function::FunctionSpaceType ::RangeFieldType, Function::FunctionSpaceType ::DomainType, Function::FunctionSpaceType ::RangeType > &mapping, const Function::FunctionSpaceType ::RangeFieldType &factor)
 scale mapping with factor More...
 
static Mapping< Function::FunctionSpaceType ::DomainFieldType, Function::FunctionSpaceType ::RangeFieldType, Function::FunctionSpaceType ::DomainType, Function::FunctionSpaceType ::RangeTypeoperator* (const Function::FunctionSpaceType ::RangeFieldType &factor, const Mapping< Function::FunctionSpaceType ::DomainFieldType, Function::FunctionSpaceType ::RangeFieldType, Function::FunctionSpaceType ::DomainType, Function::FunctionSpaceType ::RangeType > &mapping)
 scale mapping with factor More...
 
static Mapping< Function::FunctionSpaceType ::DomainFieldType, Function::FunctionSpaceType ::RangeFieldType, Function::FunctionSpaceType ::DomainType, Function::FunctionSpaceType ::RangeTypeoperator/ (const Mapping< Function::FunctionSpaceType ::DomainFieldType, Function::FunctionSpaceType ::RangeFieldType, Function::FunctionSpaceType ::DomainType, Function::FunctionSpaceType ::RangeType > &mapping, const Function::FunctionSpaceType ::RangeFieldType &factor)
 operator / for mappings More...
 
static Mapping< Function::FunctionSpaceType ::DomainFieldType, Function::FunctionSpaceType ::RangeFieldType, Function::FunctionSpaceType ::DomainType, Function::FunctionSpaceType ::RangeTypeoperator/ (const Function::FunctionSpaceType ::RangeFieldType &factor, const Mapping< Function::FunctionSpaceType ::DomainFieldType, Function::FunctionSpaceType ::RangeFieldType, Function::FunctionSpaceType ::DomainType, Function::FunctionSpaceType ::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;
Definition: explicitfieldvector.hh:75
void evaluate(const DomainType &x, RangeType &value) const
evaluate the function
Definition: function.hh:107
FunctionSpaceType::JacobianRangeType JacobianRangeType
jacobian type
Definition: function.hh:70
void jacobian(const DomainType &x, JacobianRangeType &jacobian) const
evaluate the Jacobian of the function
Definition: function.hh:117
void hessian(const DomainType &x, HessianRangeType &hessian) const
evaluate the hessian of the function
Definition: 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;
Abstract class representing a function.
Definition: function.hh:50

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

Dune::Fem::instationaryFunction

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

◆ DomainType

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

domain type

Member Function Documentation

◆ evaluate()

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

References Dune::get(), and Dune::Fem::BasicInstationaryFunction< Function::FunctionSpaceType, InstationaryFunction< Function, __InstationaryFunction::HoldCopy > >::time().

◆ hessian()

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

References Dune::get(), and Dune::Fem::BasicInstationaryFunction< Function::FunctionSpaceType, InstationaryFunction< Function, __InstationaryFunction::HoldCopy > >::time().

◆ jacobian()

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

References Dune::get(), and Dune::Fem::BasicInstationaryFunction< Function::FunctionSpaceType, InstationaryFunction< Function, __InstationaryFunction::HoldCopy > >::time().

◆ operator()() [1/2]

virtual void Dune::Fem::Function< Function::FunctionSpaceType , InstationaryFunction< Function, __InstationaryFunction::HoldCopy > >::operator() ( const DomainType arg,
RangeType dest 
) const
inlinevirtualinherited

application operator call evaluate

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

◆ operator()() [2/2]

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

Friends And Related Function Documentation

◆ operator*() [1/2]

◆ operator*() [2/2]

◆ operator+()

◆ operator-()

◆ operator/() [1/2]

◆ operator/() [2/2]

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:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 23, 23:29, 2024)