dune-fem  2.8-git
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 namespace Dune
8 {
9 
10  namespace Fem
11  {
12 
13  // FunctionSet
14  // -----------
15 
24  template< class FunctionSpace >
26  {
27  public:
30 
39 
41  int order () const;
42 
44  std::size_t size () const;
45 
62  template< class Functor >
63  void evaluateEach ( const DomainType &x, Functor functor ) const;
64 
81  template< class Functor >
82  void jacobianEach ( const DomainType &x, Functor functor ) const;
83 
100  template< class Functor >
101  void hessianEach ( const DomainType &x, Functor functor ) const;
102  };
103 
104 
105 
106  // FunctionSetProxy
107  // ----------------
108 
115  template< class FunctionSet >
117  {
118  public:
120  const ImplementationType &impl () const
121  {
122  assert( functionSet_ );
123  return *functionSet_;
124  }
125 
127 
132 
133  FunctionSetProxy () : functionSet_( nullptr ) {}
134 
135  FunctionSetProxy ( const FunctionSet *functionSet )
136  : functionSet_( functionSet )
137  {}
138 
139  int order () const { return impl().order(); }
140 
141  std::size_t size () const { return impl().size(); }
142 
143  template< class Functor >
144  void evaluateEach ( const DomainType &x, Functor functor ) const
145  {
146  impl().evaluateEach( x, functor );
147  }
148 
149  template< class Functor >
150  void jacobianEach ( const DomainType &x, Functor functor ) const
151  {
152  impl().jacobianEach( x, functor );
153  }
154  template< class Functor >
155  void hessianEach ( const DomainType &x, Functor functor ) const
156  {
157  impl().hessianEach( x, functor );
158  }
159 
160  private:
161  const FunctionSet *functionSet_;
162  };
163 
164  } // namespace Fem
165 
166 } // namespace Dune
167 
168 #endif // #ifndef DUNE_FEM_FUNCTION_COMMON_FUNCTIONSET_HH
Definition: bindguard.hh:11
Definition: explicitfieldvector.hh:75
Global basis functions.
Definition: function/common/functionset.hh:26
int order() const
return order of basis functions
std::size_t size() const
return number of basis functions
void evaluateEach(const DomainType &x, Functor functor) const
void hessianEach(const DomainType &x, Functor functor) const
FunctionSpaceType::DomainType DomainType
domain type
Definition: function/common/functionset.hh:32
void jacobianEach(const DomainType &x, Functor functor) const
FunctionSpaceType::RangeType RangeType
range type
Definition: function/common/functionset.hh:34
FunctionSpace FunctionSpaceType
function space type
Definition: function/common/functionset.hh:29
FunctionSpaceType::HessianRangeType HessianRangeType
hessian range type
Definition: function/common/functionset.hh:38
FunctionSpaceType::JacobianRangeType JacobianRangeType
jacobian range type
Definition: function/common/functionset.hh:36
Proxy for a FunctionSet.
Definition: function/common/functionset.hh:117
void jacobianEach(const DomainType &x, Functor functor) const
Definition: function/common/functionset.hh:150
void evaluateEach(const DomainType &x, Functor functor) const
Definition: function/common/functionset.hh:144
FunctionSet::RangeType RangeType
Definition: function/common/functionset.hh:129
FunctionSetProxy(const FunctionSet *functionSet)
Definition: function/common/functionset.hh:135
FunctionSet::DomainType DomainType
Definition: function/common/functionset.hh:126
FunctionSet::JacobianRangeType JacobianRangeType
Definition: function/common/functionset.hh:130
FunctionSet::HessianRangeType HessianRangeType
Definition: function/common/functionset.hh:131
int order() const
Definition: function/common/functionset.hh:139
FunctionSet::FunctionSpaceType FunctionSpaceType
Definition: function/common/functionset.hh:126
const ImplementationType & impl() const
Definition: function/common/functionset.hh:120
void hessianEach(const DomainType &x, Functor functor) const
Definition: function/common/functionset.hh:155
FunctionSet ImplementationType
Definition: function/common/functionset.hh:119
FunctionSetProxy()
Definition: function/common/functionset.hh:133
std::size_t size() const
Definition: function/common/functionset.hh:141
A vector valued function space.
Definition: functionspace.hh:60
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