DUNE-FEM (unstable)

functionset.hh
1#ifndef DUNE_FEM_FUNCTION_COMMON_FUNCTIONSET_HH
2#define DUNE_FEM_FUNCTION_COMMON_FUNCTIONSET_HH
3
4#include <cassert>
5#include <cstddef>
6
7namespace 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
128 typedef typename FunctionSet::DomainType DomainType;
129 typedef typename FunctionSet::RangeType RangeType;
130 typedef typename FunctionSet::JacobianRangeType JacobianRangeType;
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: explicitfieldvector.hh:75
Proxy for a FunctionSet.
Definition: functionset.hh:117
Global basis functions.
Definition: 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: functionset.hh:32
void jacobianEach(const DomainType &x, Functor functor) const
FunctionSpaceType::RangeType RangeType
range type
Definition: functionset.hh:34
FunctionSpace FunctionSpaceType
function space type
Definition: functionset.hh:29
FunctionSpaceType::HessianRangeType HessianRangeType
hessian range type
Definition: functionset.hh:38
FunctionSpaceType::JacobianRangeType JacobianRangeType
jacobian range type
Definition: functionset.hh:36
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
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 27, 22:29, 2024)