1#ifndef DUNE_FEM_SHAPEFUNCTIONSET_LOCALFUNCTIONS_HH
2#define DUNE_FEM_SHAPEFUNCTIONSET_LOCALFUNCTIONS_HH
12#include <dune/fem/common/coordinate.hh>
13#include <dune/fem/space/common/functionspace.hh>
24 template<
class LocalBasis >
25 class LocalFunctionsShapeFunctionSetTraits
28 typedef typename LocalBasis::Traits Traits;
31 typedef typename Traits::DomainType DomainType;
32 typedef typename DomainType::value_type DomainFieldType;
33 static const int dimDomain = DomainType::dimension;
35 typedef typename Traits::RangeType RangeType;
36 typedef typename RangeType::value_type RangeFieldType;
37 static const int dimRange = RangeType::dimension;
39 typedef FunctionSpace< DomainFieldType, RangeFieldType, dimDomain, dimRange >
FunctionSpaceType;
47 template<
class LocalBasis >
48 class LocalFunctionsShapeFunctionSet
51 typedef LocalFunctionsShapeFunctionSet< LocalBasis > ThisType;
53 typedef LocalFunctionsShapeFunctionSetTraits< LocalBasis > Traits;
62 explicit LocalFunctionsShapeFunctionSet (
const LocalBasis &localBasis )
63 : localBasis_( localBasis )
65 values_.reserve(
size() );
66 jacobians_.reserve(
size() );
69 int order ()
const {
return localBasis_.order(); }
71 std::size_t
size ()
const {
return localBasis_.size(); }
73 template<
class Po
int,
class Functor >
74 void evaluateEach (
const Point &x, Functor f )
const
76 localBasis_.evaluateFunction( coordinate( x ), values_ );
77 assert( values_.size() ==
size() );
78 callFunctor( values_, f );
81 template<
class Po
int,
class Functor >
82 void jacobianEach (
const Point &x, Functor f )
const
84 localBasis_.evaluateJacobian( coordinate( x ), jacobians_ );
85 assert( jacobians_.size() ==
size() );
86 callFunctor( jacobians_, f );
89 template<
class Po
int,
class Functor >
90 void hessianEach (
const Point &x, Functor f )
const
92 DUNE_THROW( NotImplemented,
"Method hessianEach not implemented" );
96 template<
class T,
class Functor >
97 static void callFunctor (
const std::vector< T > &v, Functor f )
99 typedef typename std::vector< T >::const_iterator Iterator;
101 for( Iterator it = v.begin(); it != v.end(); ++it )
105 LocalBasis localBasis_;
106 mutable std::vector< RangeType > values_;
107 mutable std::vector< JacobianRangeType > jacobians_;
Definition: explicitfieldvector.hh:75
FunctionSpaceTraits::RangeType RangeType
Type of range vector (using type of range field) has a Dune::FieldVector type interface.
Definition: functionspaceinterface.hh:71
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
A vector valued function space.
Definition: functionspace.hh:60
A few common exception classes.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
Dune namespace.
Definition: alignedallocator.hh:13
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75