dune-fem  2.4.1-rc
function/common/functionset.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_FUNCTION_COMMON_FUNCTIONSET_HH
2 #define DUNE_FEM_FUNCTION_COMMON_FUNCTIONSET_HH
3 
4 #include <cassert>
5 #include <cstddef>
6 
7 #include <dune/common/nullptr.hh>
8 
9 namespace Dune
10 {
11 
12  namespace Fem
13  {
14 
15  // FunctionSet
16  // -----------
17 
26  template< class FunctionSpace >
28  {
29  public:
32 
41 
43  int order () const;
44 
46  std::size_t size () const;
47 
64  template< class Functor >
65  void evaluateEach ( const DomainType &x, Functor functor ) const;
66 
83  template< class Functor >
84  void jacobianEach ( const DomainType &x, Functor functor ) const;
85 
102  template< class Functor >
103  void hessianEach ( const DomainType &x, Functor functor ) const;
104  };
105 
106 
107 
108  // FunctionSetProxy
109  // ----------------
110 
117  template< class FunctionSet >
119  {
120  public:
122  const ImplementationType &impl () const
123  {
124  assert( functionSet_ );
125  return *functionSet_;
126  }
127 
129 
130  typedef typename FunctionSet::DomainType DomainType;
134 
135  FunctionSetProxy () : functionSet_( nullptr ) {}
136 
137  FunctionSetProxy ( const FunctionSet *functionSet )
138  : functionSet_( functionSet )
139  {}
140 
141  int order () const { return impl().order(); }
142 
143  std::size_t size () const { return impl().size(); }
144 
145  template< class Functor >
146  void evaluateEach ( const DomainType &x, Functor functor ) const
147  {
148  impl().evaluateEach( x, functor );
149  }
150 
151  template< class Functor >
152  void jacobianEach ( const DomainType &x, Functor functor ) const
153  {
154  impl().jacobianEach( x, functor );
155  }
156  template< class Functor >
157  void hessianEach ( const DomainType &x, Functor functor ) const
158  {
159  impl().hessianEach( x, functor );
160  }
161 
162  private:
163  const FunctionSet *functionSet_;
164  };
165 
166  } // namespace Fem
167 
168 } // namespace Dune
169 
170 #endif // #ifndef DUNE_FEM_FUNCTION_COMMON_FUNCTIONSET_HH
FunctionSet::FunctionSpaceType FunctionSpaceType
Definition: function/common/functionset.hh:128
void hessianEach(const DomainType &x, Functor functor) const
evalute hessian of each basis function
FunctionSetProxy(const FunctionSet *functionSet)
Definition: function/common/functionset.hh:137
void jacobianEach(const DomainType &x, Functor functor) const
Definition: function/common/functionset.hh:152
std::size_t size() const
Definition: function/common/functionset.hh:143
int order() const
return order of basis functions
FunctionSpaceType::RangeType RangeType
range type
Definition: function/common/functionset.hh:36
A vector valued function space.
Definition: functionspace.hh:16
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
const ImplementationType & impl() const
Definition: function/common/functionset.hh:122
void hessianEach(const DomainType &x, Functor functor) const
Definition: function/common/functionset.hh:157
FunctionSet::HessianRangeType HessianRangeType
Definition: function/common/functionset.hh:133
Proxy for a FunctionSet.
Definition: function/common/functionset.hh:118
void jacobianEach(const DomainType &x, Functor functor) const
evalute jacobian of each basis function
FunctionSpaceType::JacobianRangeType JacobianRangeType
jacobian range type
Definition: function/common/functionset.hh:38
FunctionSpaceType::HessianRangeType HessianRangeType
hessian range type
Definition: function/common/functionset.hh:40
std::size_t size() const
return number of basis functions
Definition: coordinate.hh:4
int order() const
Definition: function/common/functionset.hh:141
void evaluateEach(const DomainType &x, Functor functor) const
evalute each basis function
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
void evaluateEach(const DomainType &x, Functor functor) const
Definition: function/common/functionset.hh:146
FunctionSet::RangeType RangeType
Definition: function/common/functionset.hh:131
FunctionSpaceType::DomainType DomainType
domain type
Definition: function/common/functionset.hh:34
Global basis functions.
Definition: function/common/functionset.hh:27
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
FunctionSet::JacobianRangeType JacobianRangeType
Definition: function/common/functionset.hh:132
FunctionSet ImplementationType
Definition: function/common/functionset.hh:121
FunctionSpace FunctionSpaceType
function space type
Definition: function/common/functionset.hh:31
FunctionSetProxy()
Definition: function/common/functionset.hh:135