1#ifndef DUNE_FEM_SPACE_LAGRANGE_SHAPEFUNCTIONSET_HH
2#define DUNE_FEM_SPACE_LAGRANGE_SHAPEFUNCTIONSET_HH
7#include <dune/common/fvector.hh>
10#include <dune/geometry/type.hh>
11#include <dune/geometry/quadraturerules.hh>
39 template<
class FunctionSpace >
78 template<
class FunctionSpace,
class GeometryType,
unsigned int polOrder >
104 virtual int order ()
const {
return polOrder; }
124 template<
class FunctionSpace,
int maxPolOrder >
133 template< GeometryType::Id geometryId>
149 const Dune::GeometryType gt_;
164 template<
class FunctionSpace,
int maxPolOrder >
167 typename LagrangeShapeFunctionFactory< FunctionSpace, maxPolOrder >::ShapeFunctionType
187 template<
class FunctionSpace,
class GeometryType,
unsigned int polOrder >
188 inline void LagrangeShapeFunction< FunctionSpace, GeometryType, polOrder >
191 FieldVector< int, 0 > diffVariable;
192 genericShapeFunction_.evaluate( diffVariable, x, value );
196 template<
class FunctionSpace,
class GeometryType,
unsigned int polOrder >
200 FieldVector< int, 1 > diffVariable;
203 int &i = diffVariable[ 0 ];
204 for( i = 0; i < dimension; ++i )
206 genericShapeFunction_.
evaluate( diffVariable, x, tmp );
207 jacobian[ 0 ][ i ] = tmp[ 0 ];
212 template<
class FunctionSpace,
class GeometryType,
unsigned int polOrder >
216 FieldVector< int, 2 > diffVariable;
219 int &i = diffVariable[ 0 ];
220 for( i = 0; i < dimension; ++i )
224 int &j = diffVariable[ 1 ];
225 for( j = 0; j < i; ++j )
227 genericShapeFunction_.
evaluate( diffVariable, x, tmp );
228 hessian[ 0 ][ i ][ j ] = hessian[ 0 ][ j ][ i ] = tmp[ 0 ];
232 genericShapeFunction_.evaluate( diffVariable, x, tmp );
233 hessian[ 0 ][ i ][ i ] = tmp[ 0 ];
242 template<
class FunctionSpace,
int maxPolOrder >
243 template< GeometryType::Id geometryId>
247 static constexpr GeometryType gt = geometryId;
248 static const unsigned int topologyId = gt.id();
252 template <
int polOrd>
259 static void apply (
const int order, std::size_t &size )
261 if( order == polOrd )
269 if( order == polOrd )
276 static void apply (
const int order, std::size_t &size )
294 template<
class FunctionSpace,
int maxPolOrder >
295 const int LagrangeShapeFunctionFactory< FunctionSpace, maxPolOrder >::dimension;
298 template<
class FunctionSpace,
int maxPolOrder >
299 inline int LagrangeShapeFunctionFactory< FunctionSpace, maxPolOrder >
306 template<
class FunctionSpace,
int polOrder >
310 std::size_t numShapeFunctions( 0 );
311 Dune::Impl::toGeometryTypeIdConstant<dimension>(gt_, [&](
auto geometryTypeId) {
312 Switch<
decltype(geometryTypeId)::value>::apply(order_, numShapeFunctions);
314 return numShapeFunctions;
318 template<
class FunctionSpace,
int polOrder >
324 Dune::Impl::toGeometryTypeIdConstant<dimension>(gt_, [&](
auto geometryTypeId) {
325 Switch<
decltype(geometryTypeId)::value>::apply(i, order_,shapeFunction);
327 assert( shapeFunction );
328 return shapeFunction;
Definition: bindguard.hh:11
static DUNE_PRIVATE void apply(Args &&... args)
Definition: forloop.hh:23
A vector valued function space.
Definition: functionspace.hh:60
ExplicitFieldVector< FieldMatrix< RangeFieldType, dimDomain, dimDomain >, dimRange > HessianRangeType
Intrinsic type used for the hessian values has a Dune::FieldMatrix type interface.
Definition: functionspaceinterface.hh:79
FunctionSpaceTraits::RangeType RangeType
Type of range vector (using type of range field) has a Dune::FieldVector type interface.
Definition: functionspaceinterface.hh:71
@ dimDomain
dimension of domain vector space
Definition: functionspaceinterface.hh:46
@ dimRange
dimension of range vector space
Definition: functionspaceinterface.hh:48
FunctionSpaceTraits::LinearMappingType JacobianRangeType
Intrinsic type used for the jacobian values has a Dune::FieldMatrix type interface.
Definition: functionspaceinterface.hh:75
FunctionSpaceTraits::DomainType DomainType
Type of domain vector (using type of domain field) has a Dune::FieldVector type interface.
Definition: functionspaceinterface.hh:67
Definition: genericgeometry.hh:175
Definition: genericlagrangepoints.hh:21
abstract base class for Lagrange shape functions
Definition: lagrange/shapefunctionset.hh:41
FunctionSpaceType::DomainType DomainType
Definition: lagrange/shapefunctionset.hh:49
FunctionSpaceType::HessianRangeType HessianRangeType
Definition: lagrange/shapefunctionset.hh:52
virtual void evaluate(const DomainType &x, RangeType &value) const =0
virtual void jacobian(const DomainType &x, JacobianRangeType &jacobian) const =0
FunctionSpaceType::JacobianRangeType JacobianRangeType
Definition: lagrange/shapefunctionset.hh:51
FunctionSpaceType::RangeType RangeType
Definition: lagrange/shapefunctionset.hh:50
virtual void hessian(const DomainType &x, HessianRangeType &hessian) const =0
virtual int order() const =0
virtual const ThisType * clone() const =0
virtual ~LagrangeShapeFunctionInterface()
Definition: lagrange/shapefunctionset.hh:54
FunctionSpace FunctionSpaceType
Definition: lagrange/shapefunctionset.hh:47
implementation of Lagrange shape function using generic Lagrange shape functions
Definition: lagrange/shapefunctionset.hh:81
GenericBaseFunctionType genericShapeFunction_
Definition: lagrange/shapefunctionset.hh:109
BaseType::RangeType RangeType
Definition: lagrange/shapefunctionset.hh:92
virtual void evaluate(const DomainType &x, RangeType &value) const
Definition: lagrange/shapefunctionset.hh:189
virtual void hessian(const DomainType &x, HessianRangeType &hessian) const
Definition: lagrange/shapefunctionset.hh:214
GenericLagrangeBaseFunction< FunctionSpace, GeometryType, polOrder > GenericBaseFunctionType
Definition: lagrange/shapefunctionset.hh:89
LagrangeShapeFunction(const GenericBaseFunctionType &genericShapeFunction)
Definition: lagrange/shapefunctionset.hh:96
BaseType::HessianRangeType HessianRangeType
Definition: lagrange/shapefunctionset.hh:94
virtual const BaseType * clone() const
Definition: lagrange/shapefunctionset.hh:106
BaseType::JacobianRangeType JacobianRangeType
Definition: lagrange/shapefunctionset.hh:93
virtual int order() const
Definition: lagrange/shapefunctionset.hh:104
virtual void jacobian(const DomainType &x, JacobianRangeType &jacobian) const
Definition: lagrange/shapefunctionset.hh:198
BaseType::DomainType DomainType
Definition: lagrange/shapefunctionset.hh:91
factory class
Definition: lagrange/shapefunctionset.hh:126
LagrangeShapeFunctionFactory(const Dune::GeometryType &type, const int order=maxPolOrder)
Definition: lagrange/shapefunctionset.hh:137
ShapeFunctionType * createShapeFunction(std::size_t i) const
Definition: lagrange/shapefunctionset.hh:321
std::size_t numShapeFunctions() const
Definition: lagrange/shapefunctionset.hh:308
LagrangeShapeFunctionInterface< FunctionSpace > ShapeFunctionType
Definition: lagrange/shapefunctionset.hh:130
int order() const
Definition: lagrange/shapefunctionset.hh:300
Lagrange shape function set.
Definition: lagrange/shapefunctionset.hh:169
LagrangeShapeFunctionSet(const Dune::GeometryType &type, const int order=maxPolOrder)
Definition: lagrange/shapefunctionset.hh:176
Definition: lagrange/shapefunctionset.hh:254
LagrangeShapeFunction< FunctionSpace, ImplType, polOrd > ShapeFunctionImpl
Definition: lagrange/shapefunctionset.hh:256
static void apply(const int order, std::size_t &size)
Definition: lagrange/shapefunctionset.hh:259
static void apply(const std::size_t &i, const int order, ShapeFunctionType *&shapeFunction)
Definition: lagrange/shapefunctionset.hh:267
ShapeFunctionImpl::GenericBaseFunctionType GenericBaseFunctionType
Definition: lagrange/shapefunctionset.hh:257
Definition: space/shapefunctionset/simple.hh:50
int order() const
Definition: space/shapefunctionset/simple.hh:77