1#ifndef DUNE_FEM_FUNCTION_COMMON_INSTATIONARY_HH
2#define DUNE_FEM_FUNCTION_COMMON_INSTATIONARY_HH
31 template<
class FunctionSpace,
class Function >
59 double time ()
const {
return time_; }
71 namespace __InstationaryFunction
77 template<
class Function >
80 explicit HoldCopy ( Function function )
81 : function_(
std::move( function ) )
84 const Function &get () const noexcept {
return function_; }
95 template<
class Function >
98 explicit HoldReference (
const Function &function )
99 : function_( function )
102 const Function &
get () const noexcept {
return function_.get(); }
105 std::reference_wrapper< const Function > function_;
152 template<
class Function,
153 template<
class >
class StoragePolicy = __InstationaryFunction::HoldCopy >
155 :
public BasicInstationaryFunction< typename Function::FunctionSpaceType, InstationaryFunction< Function, StoragePolicy > >,
156 private StoragePolicy< Function >
159 typedef StoragePolicy< Function > StoragePolicyType;
171 StoragePolicyType( function )
176 StoragePolicyType(
std::move( function ) )
188 this->
get().evaluate( x, this->
time(), value );
194 this->
get().jacobian( x, this->
time(), jacobian );
200 this->
get().hessian( x, this->
time(), hessian );
211 template<
class Function >
212 InstationaryFunction< Function, __InstationaryFunction::HoldCopy >
216 return InstationaryFunctionType( std::move( function ), time );
219 template<
class Function >
220 InstationaryFunction< typename std::remove_const< Function >::type, __InstationaryFunction::HoldReference >
224 return InstationaryFunctionType( function.get(), time );
Definition: bindguard.hh:11
std::tuple_element< i, Tuple >::type & get(Dune::TypeIndexedTuple< Tuple, Types > &tuple)
Definition: typeindexedtuple.hh:122
InstationaryFunction< Function, __InstationaryFunction::HoldCopy > instationaryFunction(Function function, double time)
Definition: instationary.hh:213
Definition: explicitfieldvector.hh:75
Abstract class representing a function.
Definition: common/function.hh:50
FunctionSpaceType::JacobianRangeType JacobianRangeType
jacobian type
Definition: common/function.hh:70
basic wrapper class (still a CRTP) for instationary functions
Definition: instationary.hh:34
double setTime(double time)
set time to give value
Definition: instationary.hh:56
BasicInstationaryFunction(double time)
Definition: instationary.hh:40
double time() const
return set time
Definition: instationary.hh:59
implementation of a Dune::Fem::Function taking an instationary function
Definition: instationary.hh:157
BaseType::DomainType DomainType
domain type
Definition: instationary.hh:163
void jacobian(const DomainType &x, typename BaseType::JacobianRangeType &jacobian) const
evaluate the Jacobian of the function
Definition: instationary.hh:192
void hessian(const DomainType &x, typename BaseType::HessianRangeType &hessian) const
evaluate the hessian of the function
Definition: instationary.hh:198
void evaluate(const DomainType &x, typename BaseType::RangeType &value) const
evaluate the function
Definition: instationary.hh:186
InstationaryFunction(Function &&function, double time)
Definition: instationary.hh:174
InstationaryFunction(const Function &function, double time)
Definition: instationary.hh:169
DType DomainType
domain vector space (for usage in derived classes) This can either be for example a discrete function...
Definition: mapping.hh:57
RType RangeType
range vector space (for usage in derived classes) This can either be for example a discrete function ...
Definition: mapping.hh:63