1#ifndef DUNE_ACFEM_COORDINATEGRIDFUNCTIONS_HH
2#define DUNE_ACFEM_COORDINATEGRIDFUNCTIONS_HH
4#include "../functions/gridfunctionwrapper.hh"
16 template<
class Field,
unsigned dim>
18 :
public Fem::Function<Fem::FunctionSpace<Field, Field, dim, dim>, IdentityFunction<Field, dim> >
21 typedef Fem::Function<Fem::FunctionSpace<Field, Field, dim, dim>,
ThisType> BaseType;
23 typedef typename BaseType::FunctionSpaceType FunctionSpaceType;
25 enum { dimRange = FunctionSpaceType::dimRange };
26 enum { dimDomain = FunctionSpaceType::dimDomain };
28 typedef typename FunctionSpaceType::RangeFieldType RangeFieldType;
30 typedef typename FunctionSpaceType::RangeType RangeType;
31 typedef typename FunctionSpaceType::DomainType DomainType;
33 typedef typename FunctionSpaceType::JacobianRangeType JacobianRangeType;
34 typedef typename FunctionSpaceType::HessianRangeType HessianRangeType;
38 void evaluate(
const DomainType& x, RangeType& res)
const
43 void jacobian(
const DomainType& x, JacobianRangeType& res)
const
46 for (
int i = 0; i < dimDomain; ++i) {
51 void hessian(
const DomainType& x, HessianRangeType& res)
const
60 template<
class Field,
unsigned dim,
unsigned N>
62 :
public Fem::Function<Fem::FunctionSpace<Field, Field, dim, 1>, CoordinateFunction<Field, dim, N> >
65 typedef Fem::Function<Fem::FunctionSpace<Field, Field, dim, 1>,
ThisType> BaseType;
67 typedef typename BaseType::FunctionSpaceType FunctionSpaceType;
69 enum { dimRange = 1 };
70 enum { dimDomain = FunctionSpaceType::dimDomain };
71 enum { component = N };
73 typedef typename FunctionSpaceType::RangeFieldType RangeFieldType;
75 typedef typename FunctionSpaceType::RangeType RangeType;
76 typedef typename FunctionSpaceType::DomainType DomainType;
78 typedef typename FunctionSpaceType::JacobianRangeType JacobianRangeType;
79 typedef typename FunctionSpaceType::HessianRangeType HessianRangeType;
82 static_assert(component < (unsigned)dimDomain,
"Index out of range");
85 void evaluate(
const DomainType& x, RangeType& res)
const
90 void jacobian(
const DomainType& x, JacobianRangeType& res)
const
93 res[0][component] = 1.0;
96 void hessian(
const DomainType& x, HessianRangeType& res)
const
Coordinate function returns a specific component of the world point, x_N, so to say.
Definition: coordinatefunctions.hh:63
A function which returns its argument.
Definition: coordinatefunctions.hh:19