DUNE-FEM (unstable)

DiscreteFunctionAdapter

Classes

class  Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >
 LocalFunctionAdapter wrapped a class with a local evaluate method into a grid function. More...
 
struct  Dune::Fem::LocalFunctionAdapterTraits< LocalFunctionImpl >
 traits of DiscreteFunctionAdapter More...
 
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. More...
 

Typedefs

typedef GridPartType::template Codim< 0 >::IteratorType Dune::Fem::LocalFunctionAdapterTraits< LocalFunctionImpl >::IteratorType
 type of iterator
 
typedef GridPartType::IndexSetType Dune::Fem::LocalFunctionAdapterTraits< LocalFunctionImpl >::IndexSetType
 type of IndexSet
 
typedef LocalFunctionImpl Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::LocalFunctionImplType
 Evaluate class.
 
typedef BaseType::FunctionType Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::FunctionType
 type of function
 
typedef LocalFunctionAdapterTraits< LocalFunctionImplTypeDune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::Traits
 traits class
 
typedef Traits::GridPartType Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::GridPartType
 type of grid part
 
typedef Traits::DiscreteFunctionSpaceType Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::DiscreteFunctionSpaceType
 type of discrete function space
 
typedef Traits::GridType Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::GridType
 type of grid
 
typedef Traits::DomainFieldType Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::DomainFieldType
 domain type
 
typedef Traits::RangeFieldType Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::RangeFieldType
 range type
 
typedef Traits::DomainType Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::DomainType
 domain type
 
typedef Traits::RangeType Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::RangeType
 range type
 
typedef Traits::JacobianRangeType Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::JacobianRangeType
 jacobian type
 
typedef Traits::EntityType Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::EntityType
 type of codim 0 entity
 
typedef Traits::LocalFunctionType Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::LocalFunctionType
 type of local function to export
 
typedef LocalFunctionImpl Dune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::LocalFunctionImplType
 type of local function implementation
 
typedef LocalFunctionAdapterTraits< LocalFunctionImplTypeDune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::Traits
 type of the traits class
 
typedef Traits::DomainFieldType Dune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::DomainFieldType
 domain type
 
typedef Traits::RangeFieldType Dune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::RangeFieldType
 range type
 
typedef Traits::DomainType Dune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::DomainType
 domain type
 
typedef Traits::RangeType Dune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::RangeType
 range type
 
typedef Traits::JacobianRangeType Dune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::JacobianRangeType
 jacobian type
 
typedef Traits::HessianRangeType Dune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::HessianRangeType
 hessian type
 

Functions

 Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::LocalFunctionAdapter (const std::string &name, LocalFunctionImplType &localFunctionImpl, const GridPartType &gridPart, unsigned int order=DiscreteFunctionSpaceType::polynomialOrder)
 
 Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::LocalFunctionAdapter (const std::string &name, const LocalFunctionImplType &localFunctionImpl, const GridPartType &gridPart, unsigned int order=DiscreteFunctionSpaceType::polynomialOrder)
 constructor taking a const reference instance of the local function class
 
 Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::LocalFunctionAdapter (const std::string &name, LocalFunctionImplType &&localFunctionImpl, const GridPartType &gridPart, unsigned int order=DiscreteFunctionSpaceType::polynomialOrder)
 constructor taking a r-value reference instance of the local function class
 
template<class ... Args>
 Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::LocalFunctionAdapter (const std::string &name, const GridPartType &gridPart, unsigned int order, Args &... args)
 
template<class ... Args>
 Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::LocalFunctionAdapter (const std::string &name, const GridPartType &gridPart, const std::tuple< Args &... > &args, unsigned int order=DiscreteFunctionSpaceType::polynomialOrder)
 
unsigned int Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::order () const
 return the order of the space
 
bool Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::continuous () const
 return true, probably
 
const LocalFuncStorageType & Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::localFunctionImpl () const
 return local function implementation
 
LocalFuncStorageType & Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::localFunctionImpl ()
 return local function implementation
 
void Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::evaluate (const DomainType &global, RangeType &result) const
 evaluate function on local coordinate local
 
LocalFunctionType Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::localFunction (const EntityType &entity)
 obtain a local function for an entity (read-write) More...
 
const LocalFunctionType Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::localFunction (const EntityType &entity) const
 obtain a local function for an entity (read-write) More...
 
const std::string & Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::name () const
 obtain the name of the discrete function More...
 
template<class DFType >
DiscreteFunctionTypeDune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::operator+= (const DFType &g)
 
template<class DFType >
DiscreteFunctionTypeDune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::operator-= (const DFType &g)
 substract all degrees of freedom from given discrete function using the dof iterators More...
 
DiscreteFunctionTypeDune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::operator*= (const RangeFieldType &scalar)
 multiply all DoFs with a scalar factor More...
 
DiscreteFunctionTypeDune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::operator/= (const RangeFieldType &scalar)
 devide all DoFs by a scalar factor More...
 
template<class ArgumentType >
void Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::initialize (const ArgumentType &arg, double time)
 initialize local function with argument and time
 
void Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::registerLocalFunction (LocalFunctionType *lf) const
 add LocalFunction to list of local functions
 
void Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::deleteLocalFunction (LocalFunctionType *lf) const
 remove LocalFunction to list of local functions
 
 Dune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::LocalFunctionAdapterLocalFunction (const EntityType &entity, const DiscreteFunctionType &adapter)
 constructor initializing local function
 
 Dune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::LocalFunctionAdapterLocalFunction (const DiscreteFunctionType &adapter)
 constructor
 
 Dune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::LocalFunctionAdapterLocalFunction (const ThisType &other)
 copy constructor
 
 Dune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::~LocalFunctionAdapterLocalFunction ()
 destructor
 
unsigned int Dune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::order () const
 return order of the space
 
template<class PointType >
void Dune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::evaluate (const PointType &x, RangeType &ret) const
 evaluate local function
 
template<class PointType >
void Dune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::jacobian (const PointType &x, JacobianRangeType &ret) const
 jacobian of local function
 
void Dune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::init (const EntityType &entity)
 init local function
 
const EntityType & Dune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::entity () const
 get entity
 
const Geometry & Dune::Fem::LocalFunctionAdapterLocalFunction< LocalFunctionImpl >::geometry () const
 get entity
 
 Dune::Fem::LocalAnalyticalFunctionBinder< DiscreteFunctionSpaceImpl >::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
 
AnalyticalFunctionType & Dune::Fem::LocalAnalyticalFunctionBinder< DiscreteFunctionSpaceImpl >::function ()
 get local function
 
const AnalyticalFunctionType & Dune::Fem::LocalAnalyticalFunctionBinder< DiscreteFunctionSpaceImpl >::function () const
 get local function
 
AnalyticalJacobianType & Dune::Fem::LocalAnalyticalFunctionBinder< DiscreteFunctionSpaceImpl >::jacobian ()
 get jacobian local function
 
const AnalyticalJacobianType & Dune::Fem::LocalAnalyticalFunctionBinder< DiscreteFunctionSpaceImpl >::jacobian () const
 get jacobian local function
 
AnalyticalHessianType & Dune::Fem::LocalAnalyticalFunctionBinder< DiscreteFunctionSpaceImpl >::hessian ()
 get hessian local function
 
const AnalyticalHessianType & Dune::Fem::LocalAnalyticalFunctionBinder< DiscreteFunctionSpaceImpl >::hessian () const
 get hessian local function
 
template<class PointType >
void Dune::Fem::LocalAnalyticalFunctionBinder< DiscreteFunctionSpaceImpl >::evaluate (const PointType &x, RangeType &ret) const
 evaluate local function
 
template<class PointType >
void Dune::Fem::LocalAnalyticalFunctionBinder< DiscreteFunctionSpaceImpl >::jacobian (const PointType &x, JacobianRangeType &ret) const
 evaluate jacobian local function
 
template<class PointType >
void Dune::Fem::LocalAnalyticalFunctionBinder< DiscreteFunctionSpaceImpl >::hessian (const PointType &x, HessianRangeType &ret) const
 evaluate hessian local function
 
void Dune::Fem::LocalAnalyticalFunctionBinder< DiscreteFunctionSpaceImpl >::init (const EntityType &entity)
 initialize entity
 
template<typename Arg >
void Dune::Fem::LocalAnalyticalFunctionBinder< DiscreteFunctionSpaceImpl >::initialize (Arg &&, double time)
 initialize time
 
double Dune::Fem::LocalAnalyticalFunctionBinder< DiscreteFunctionSpaceImpl >::time () const
 get time
 

Detailed Description

Similar to DiscreteFunctionAdapter but here we provide a LocalFunction implementation to plug this into an operator taking discrete functions, i.e., expecting local functions a wrapper can be applied to the analytical function instance.

Function Documentation

◆ localFunction() [1/2]

template<class LocalFunctionImpl >
LocalFunctionType Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::localFunction ( const EntityType entity)
inline

obtain a local function for an entity (read-write)

Parameters
[in]entityEntity to focus view of discrete function
Returns
a local function associated with the entity

◆ localFunction() [2/2]

template<class LocalFunctionImpl >
const LocalFunctionType Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::localFunction ( const EntityType entity) const
inline

obtain a local function for an entity (read-write)

Parameters
[in]entityEntity to focus view of discrete function
Returns
a local function associated with the entity

◆ LocalFunctionAdapter() [1/3]

template<class LocalFunctionImpl >
template<class ... Args>
Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::LocalFunctionAdapter ( const std::string &  name,
const GridPartType gridPart,
const std::tuple< Args &... > &  args,
unsigned int  order = DiscreteFunctionSpaceType::polynomialOrder 
)
inline

constructor setting up a local instance of the local function class. A tuple is used for the constructor arguments of that object, so something like std::forward_as_tuple should be used.

◆ LocalFunctionAdapter() [2/3]

template<class LocalFunctionImpl >
template<class ... Args>
Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::LocalFunctionAdapter ( const std::string &  name,
const GridPartType gridPart,
unsigned int  order,
Args &...  args 
)
inline

constructor setting up a local instance of the local function class. Note: the order argument has to be passed in as well

◆ LocalFunctionAdapter() [3/3]

template<class LocalFunctionImpl >
Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::LocalFunctionAdapter ( const std::string &  name,
LocalFunctionImplType localFunctionImpl,
const GridPartType gridPart,
unsigned int  order = DiscreteFunctionSpaceType::polynomialOrder 
)
inline

constructor taking a reference instance of the local function class This is the only useable constructor if the local function implementation is not copy constructible

◆ name()

template<class LocalFunctionImpl >
const std::string & Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::name ( ) const
inline

obtain the name of the discrete function

Returns
string holding name of discrete function

◆ operator*=()

template<class LocalFunctionImpl >
DiscreteFunctionType & Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::operator*= ( const RangeFieldType scalar)
inline

multiply all DoFs with a scalar factor

Parameters
[in]scalarfactor to multiply DoFs with
Returns
reference to this discrete function (i.e. *this)

References DUNE_THROW.

◆ operator+=()

template<class LocalFunctionImpl >
template<class DFType >
DiscreteFunctionType & Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::operator+= ( const DFType &  g)
inline

References DUNE_THROW.

◆ operator-=()

template<class LocalFunctionImpl >
template<class DFType >
DiscreteFunctionType & Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::operator-= ( const DFType &  g)
inline

substract all degrees of freedom from given discrete function using the dof iterators

Parameters
[in]gdiscrete function which is substracted from this discrete function
Returns
reference to this (i.e. *this)

References DUNE_THROW.

◆ operator/=()

template<class LocalFunctionImpl >
DiscreteFunctionType & Dune::Fem::LocalFunctionAdapter< LocalFunctionImpl >::operator/= ( const RangeFieldType scalar)
inline

devide all DoFs by a scalar factor

Parameters
[in]scalarfactor with which all dofs are devided
Returns
reference to this discrete function (i.e. *this)

References DUNE_THROW.

Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 20, 23:30, 2024)