dune-fem  2.4.1-rc
localfunctionset.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_FUNCTION_LOCALFUNCTION_LOCALFUNCTIONSET_HH
2 #define DUNE_FEM_FUNCTION_LOCALFUNCTION_LOCALFUNCTIONSET_HH
3 
4 #include <cassert>
5 #include <cstddef>
6 
7 #include <dune/common/nullptr.hh>
8 
10 
11 namespace Dune
12 {
13 
14  namespace Fem
15  {
16 
17  // LocalFunctionSet
18  // ----------------
19 
28  template< class Entity, class Range >
30  {
32  typedef Entity EntityType;
33 
35  typedef FunctionSpace< typename Entity::Geometry::ctype, typename Range::value_type,
36  Entity::Geometry::coorddimension, Range::dimension > FunctionSpaceType;
37 
46 
48  int order () const;
49 
51  const EntityType &entity () const;
52 
54  std::size_t size () const;
55 
72  template< class Point, class Functor >
73  void evaluateEach ( const Point &x, Functor functor ) const;
74 
91  template< class Point, class Functor >
92  void jacobianEach ( const Point &x, Functor functor ) const;
93 
110  template< class Point, class Functor >
111  void hessianEach ( const Point &x, Functor functor ) const;
112  };
113 
114 
115 
116  // LocalFunctionSetProxy
117  // ---------------------
118 
125  template< class LocalFunctionSet >
127  {
128  public:
130  const ImplementationType &impl () const
131  {
132  assert( localFunctionSet_ );
133  return *localFunctionSet_;
134  }
135 
138 
143 
144  LocalFunctionSetProxy () : localFunctionSet_( nullptr ) {}
145 
146  LocalFunctionSetProxy ( const LocalFunctionSet *localFunctionSet )
147  : localFunctionSet_( localFunctionSet )
148  {}
149 
150  int order () const { return impl().order(); }
151 
152  const EntityType &entity () const { return impl().entity(); }
153 
154  std::size_t size () const { return impl().size(); }
155 
156  template< class Point, class Functor >
157  void evaluateEach ( const Point &x, Functor functor ) const
158  {
159  impl().evaluateEach( x, functor );
160  }
161 
162  template< class Point, class Functor >
163  void jacobianEach ( const Point &x, Functor functor ) const
164  {
165  impl().jacobianEach( x, functor );
166  }
167 
168  template< class Point, class Functor >
169  void hessianEach ( const Point &x, Functor functor ) const
170  {
171  impl().hessianEach( x, functor );
172  }
173 
174  private:
175  const LocalFunctionSet *localFunctionSet_;
176  };
177 
178  } // namespace Fem
179 
180 } // namespace Dune
181 
182 #endif // #ifndef DUNE_FEM_FUNCTION_LOCALFUNCTION_LOCALFUNCTIONSET_HH
void evaluateEach(const Point &x, Functor functor) const
Definition: localfunctionset.hh:157
void jacobianEach(const Point &x, Functor functor) const
evalute jacobian of each basis function
const EntityType & entity() const
Definition: localfunctionset.hh:152
A vector valued function space.
Definition: functionspace.hh:16
int order() const
return order of basis functions
LocalFunctionSet::DomainType DomainType
Definition: localfunctionset.hh:139
VectorSpaceTraits< DomainField, RangeField, dimD, dimR >::LinearMappingType JacobianRangeType
Intrinsic type used for the jacobian values has a Dune::FieldMatrix type interface.
Definition: functionspaceinterface.hh:74
FieldVector< FieldMatrix< RangeFieldType, dimDomain, dimDomain >, dimRange > HessianRangeType
Intrinsic type used for the hessian values has a Dune::FieldMatrix type interface.
Definition: functionspaceinterface.hh:78
Proxy for a LocalBasisFunctionSet.
Definition: localfunctionset.hh:126
Local basis functions.
Definition: localfunctionset.hh:29
LocalFunctionSet::FunctionSpaceType FunctionSpaceType
Definition: localfunctionset.hh:137
LocalFunctionSetProxy(const LocalFunctionSet *localFunctionSet)
Definition: localfunctionset.hh:146
LocalFunctionSet::HessianRangeType HessianRangeType
Definition: localfunctionset.hh:142
LocalFunctionSetProxy()
Definition: localfunctionset.hh:144
LocalFunctionSet::RangeType RangeType
Definition: localfunctionset.hh:140
LocalFunctionSet ImplementationType
Definition: localfunctionset.hh:129
Definition: coordinate.hh:4
FunctionSpaceType::DomainType DomainType
domain type
Definition: localfunctionset.hh:39
VectorSpaceTraits< DomainField, RangeField, dimD, dimR >::DomainType DomainType
Type of domain vector (using type of domain field) has a Dune::FieldVector type interface.
Definition: functionspaceinterface.hh:66
int order() const
Definition: localfunctionset.hh:150
void hessianEach(const Point &x, Functor functor) const
evalute hessian of each basis function
FunctionSpaceType::JacobianRangeType JacobianRangeType
jacobian range type
Definition: localfunctionset.hh:43
const EntityType & entity() const
return entity
std::size_t size() const
return number of basis functions
FunctionSpace< typename Entity::Geometry::ctype, typename Range::value_type, Entity::Geometry::coorddimension, Range::dimension > FunctionSpaceType
function space type
Definition: localfunctionset.hh:36
void jacobianEach(const Point &x, Functor functor) const
Definition: localfunctionset.hh:163
std::size_t size() const
Definition: localfunctionset.hh:154
LocalFunctionSet::JacobianRangeType JacobianRangeType
Definition: localfunctionset.hh:141
VectorSpaceTraits< DomainField, RangeField, dimD, dimR >::RangeType RangeType
Type of range vector (using type of range field) has a Dune::FieldVector type interface.
Definition: functionspaceinterface.hh:70
LocalFunctionSet::EntityType EntityType
Definition: localfunctionset.hh:136
Entity EntityType
entity type
Definition: localfunctionset.hh:32
FunctionSpaceType::HessianRangeType HessianRangeType
hessian range type
Definition: localfunctionset.hh:45
void evaluateEach(const Point &x, Functor functor) const
evalute each basis function
FunctionSpaceType::RangeType RangeType
range type
Definition: localfunctionset.hh:41
const ImplementationType & impl() const
Definition: localfunctionset.hh:130
void hessianEach(const Point &x, Functor functor) const
Definition: localfunctionset.hh:169