dune-fem
2.4.1-rc
|
LocalFunctionAdapter wrapped a class with a local evaluate method into a grid function. More...
#include </local/tomalk/somewhere/tmp/dune-fem/dune/fem/function/common/localfunctionadapter.hh>
Classes | |
struct | ArgumentIF |
struct | ArgumentInitializer |
struct | LocalFunctionInitializer |
struct | LocalFunctionInitializer< ArgumentType, true > |
Public Member Functions | |
LocalFunctionAdapter (const std::string &name, LocalFunctionImplType &localFunctionImpl, const GridPartType &gridPart, unsigned int order=DiscreteFunctionSpaceType::polynomialOrder) | |
constructer taking instance of EvalImp class More... | |
LocalFunctionAdapter (const ThisType &other) | |
~LocalFunctionAdapter () | |
unsigned int | order () const |
return the order of the space More... | |
const LocalFunctionImplType & | localFunctionImpl () const |
return local function implementation More... | |
LocalFunctionImplType & | localFunctionImpl () |
return local function implementation More... | |
void | evaluate (const DomainType &global, RangeType &result) const |
evaluate function on local coordinate local More... | |
LocalFunctionType | localFunction (const EntityType &entity) |
obtain a local function for an entity (read-write) More... | |
const LocalFunctionType | localFunction (const EntityType &entity) const |
obtain a local function for an entity (read-write) More... | |
const std::string & | name () const |
obtain the name of the discrete function More... | |
const DiscreteFunctionSpaceType & | space () const |
const GridPartType & | gridPart () const |
template<class DFType > | |
DiscreteFunctionType & | operator+= (const DFType &g) |
template<class DFType > | |
DiscreteFunctionType & | operator-= (const DFType &g) |
substract all degrees of freedom from given discrete function using the dof iterators More... | |
DiscreteFunctionType & | operator*= (const RangeFieldType &scalar) |
multiply all DoFs with a scalar factor More... | |
DiscreteFunctionType & | operator/= (const RangeFieldType &scalar) |
devide all DoFs by a scalar factor More... | |
template<class ArgumentType > | |
void | initialize (const ArgumentType &arg, const double time) |
initialize local function with argument (see insertfunctionpass.hh) More... | |
void | registerLocalFunction (LocalFunctionType *lf) const |
add LocalFunction to list of local functions More... | |
void | deleteLocalFunction (LocalFunctionType *lf) const |
remove LocalFunction to list of local functions More... | |
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 | 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... | |
Protected Types | |
typedef std::set< LocalFunctionType * > | LocalFunctionListType |
set of created local functions More... | |
Protected Member Functions | |
const LocalFunctionAdapter< LocalFunctionImpl > & | asImp () const |
LocalFunctionAdapter< LocalFunctionImpl > & | asImp () |
Static Protected Member Functions | |
static const LocalFunctionAdapter< LocalFunctionImpl > & | asImp (const ThisType &other) |
static LocalFunctionAdapter< LocalFunctionImpl > & | asImp (ThisType &other) |
Protected Attributes | |
DiscreteFunctionSpaceType | space_ |
LocalFunctionImplType & | localFunctionImpl_ |
LocalFunctionListType | lfList_ |
const ArgumentIF * | argInitializer_ |
const std::string | name_ |
const unsigned int | order_ |
LocalFunctionAdapter wrapped a class with a local evaluate method into a grid function.
The class takes one template argument LocalFunctionImpl which holds the method evaluate(...) to evaluate the local function
template<class PointType> LocalFunctionImpl::evaluate(const PointType& x,RangeType& val)
and a method init(...)
LocalFunctionImpl::init(const EntityType& entity)
to set the entity.
It is important to know that the point x it is not necessary of type DomainType. More precisely, if the evaluate(...) is used with a caching quadrature point the type is different. Indeed floating point coordinates are not very well suited to address the cache therefore quadrature[i] return a QuadraturePointWrapper (which simply stores a reference to the quadrature and the index i).
In order to be sure that the point x is of type DomainType, you can use the function coordinate(x) which can be also called with a DomainType.
Therefore, the local implementation should be something like
template<class PointType> LocalFunctionImpl::evaluate(const PointType& x,RangeType& val) { const DomainType xDomain(coordiante(x)); // do stuff with xDomain }
to avoid type conflicts.
Required type in LocalFunctionImpl are:
FunctionSpaceType GridPartType EntityType DomainType RangeType
An instance of the LocalFunctionImpl class is passed to the constructor.
In order to adapt a lambda or a plain C++ function, you can directly use the LocalAnalyticalFunctionBinder which provides all the necessary types and methods.
|
inherited |
type of function space this function belongs to
|
inherited |
hessian type
|
inherited |
type of mapping base class
|
inlinestaticprotectedinherited |
|
inlinestaticprotectedinherited |
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlineinherited |
evaluate the hessian of the function
[in] | x | evaluation point |
[out] | hessian | value of the hessian in x |
|
inlineinherited |
evaluate the Jacobian of the function
[in] | x | evaluation point |
[out] | jacobian | value of the Jacobian in x |
|
inlinevirtualinherited |
application operator call evaluate
[in] | arg | argument |
[out] | dest | destination, i.e. f(arg) |
|
inlineinherited |
Application operator that applies all operators in the linear combination stack.
[in] | arg | argument |
[out] | dest | destination |
References Dune::Fem::Mapping< DFieldType, RFieldType, DType, RType >::operator()().