dune-fem 2.8.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
Dune::Fem::LocalAnalyticalFunctionBinder< DiscreteFunctionSpaceImpl > Class Template Reference

LocalAnalyticalFunctionBinder binds a C++ local analytical function (and also its Jacobian and Hessian) to an object which provides all the methods and types needed by the LocalFunctionAdapter. It stores a copy as a std::function. More...

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

Public Types

typedef DiscreteFunctionSpaceImpl DiscreteFunctionSpaceType
 
typedef LocalAnalyticalFunctionBinder< DiscreteFunctionSpaceTypeThisType
 
typedef DiscreteFunctionSpaceType::FunctionSpaceType FunctionSpaceType
 
typedef DiscreteFunctionSpaceType::GridPartType GridPartType
 
typedef DiscreteFunctionSpaceType::EntityType EntityType
 
typedef FunctionSpaceType::DomainType DomainType
 
typedef FunctionSpaceType::RangeType RangeType
 
typedef DiscreteFunctionSpaceType::DomainFieldType DomainFieldType
 
typedef DiscreteFunctionSpaceType::RangeFieldType RangeFieldType
 
typedef FunctionSpaceType::JacobianRangeType JacobianRangeType
 
typedef FunctionSpaceType::HessianRangeType HessianRangeType
 
typedef std::function< RangeType(const DomainType &, double, const EntityType &)> AnalyticalFunctionType
 
typedef std::function< JacobianRangeType(const DomainType &, double, const EntityType &)> AnalyticalJacobianType
 
typedef std::function< HessianRangeType(const DomainType &, double, const EntityType &)> AnalyticalHessianType
 

Public Member Functions

 LocalAnalyticalFunctionBinder (const AnalyticalFunctionType &f=[](const auto &, auto, const auto &){return RangeType(0.0);}, const AnalyticalJacobianType &j=[](const auto &, auto, const auto &){return JacobianRangeType(0.0);}, const AnalyticalHessianType &h=[](const auto &, auto, const auto &){return HessianRangeType(0.0);}, double t=0.0)
 constructor More...
 
 LocalAnalyticalFunctionBinder (const ThisType &)=default
 
 LocalAnalyticalFunctionBinder (ThisType &&)=default
 
ThisTypeoperator= (const ThisType &)=default
 
ThisTypeoperator= (ThisType &&)=default
 
AnalyticalFunctionTypefunction ()
 get local function More...
 
const AnalyticalFunctionTypefunction () const
 get local function More...
 
AnalyticalJacobianTypejacobian ()
 get jacobian local function More...
 
const AnalyticalJacobianTypejacobian () const
 get jacobian local function More...
 
AnalyticalHessianTypehessian ()
 get hessian local function More...
 
const AnalyticalHessianTypehessian () const
 get hessian local function More...
 
template<class PointType >
void evaluate (const PointType &x, RangeType &ret) const
 evaluate local function More...
 
template<class PointType >
void jacobian (const PointType &x, JacobianRangeType &ret) const
 evaluate jacobian local function More...
 
template<class PointType >
void hessian (const PointType &x, HessianRangeType &ret) const
 evaluate hessian local function More...
 
void init (const EntityType &entity)
 initialize entity More...
 
template<typename Arg >
void initialize (Arg &&, double time)
 initialize time More...
 
const EntityTypeentity () const
 get entity More...
 
double time () const
 get time More...
 

Detailed Description

template<class DiscreteFunctionSpaceImpl>
class Dune::Fem::LocalAnalyticalFunctionBinder< DiscreteFunctionSpaceImpl >

LocalAnalyticalFunctionBinder binds a C++ local analytical function (and also its Jacobian and Hessian) to an object which provides all the methods and types needed by the LocalFunctionAdapter. It stores a copy as a std::function.

Therefore, in order to transform the function

RangeType f(const DomainType& x,double t,const EntityType& entity) { // do stuff }

into a grid function, it is sufficient to pass it to the LocalAnalyticalFucntionBinder

typedef LocalAnalyticalFunctionBinder<DiscreteFunctionSpaceType> LocalAnalyticalFunctionType; LocalAnalyticalFunctionType localAnalyticalFunction(f);

and create the LocalFunctionAdapter

typedef LocalFunctionAdapter<LocalAnalyticalFunctionType> AdaptedFunctionType; AdaptedFunctionType fAdapted("adapted function",localAnalyticalFunction,gridPart);


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