dune-fem  2.4.1-rc
localfunctionsetadapter.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_FUNCTION_LOCALFUNCTION_LOCALFUNCTIONSETADAPTER_HH
2 #define DUNE_FEM_FUNCTION_LOCALFUNCTION_LOCALFUNCTIONSETADAPTER_HH
3 
4 #include <cassert>
5 #include <cstddef>
6 
8 
9 namespace Dune
10 {
11 
12  namespace Fem
13  {
14 
15  // LocalFunctionSetAdapter
16  // -----------------------
17 
25  template< class Entity, class FunctionSet >
27  {
29  typedef Entity EntityType;
32 
35 
44 
45  explicit LocalFunctionSetAdapter ( const Entity &entity,
47  : entity_( &entity ),
48  functionSet_( functionSet )
49  {}
50 
52  int order () const { return functionSet_.order(); }
53 
55  const EntityType &entity () const
56  {
57  assert( entity_ );
58  return *entity_;
59  }
60 
62  std::size_t size () const { return functionSet().size(); }
63 
65  template< class Point, class Functor >
66  void evaluateEach ( const Point &x, Functor functor ) const
67  {
68  DomainType y = geometry().global( coordinate( x ) );
69  functionSet().evaluateEach( y, functor );
70  }
71 
73  template< class Point, class Functor >
74  void jacobianEach ( const Point &x, Functor functor ) const
75  {
76  DomainType y = geometry().global( coordinate( x ) );
77  functionSet().jacobianEach( y, functor );
78  }
79 
81  template< class Point, class Functor >
82  void hessianEach ( const Point &x, Functor functor ) const
83  {
84  DomainType y = geometry().global( coordinate( x ) );
85  functionSet().hessianEach( y, functor );
86  }
87 
88 
89  // Non-interface methods
90  // ---------------------
91 
93  const FunctionSetType functionSet () const { return functionSet_; }
94 
95  private:
96  typename EntityType::Geometry geometry () const { return entity().geometry(); }
97 
98  const EntityType *entity_;
99  FunctionSetType functionSet_;
100  };
101 
102  } // namespace Fem
103 
104 } // namespace Dune
105 
106 #endif // #ifndef DUNE_FEM_FUNCTION_LOCALFUNCTION_LOCALFUNCTIONSETADAPTER_HH
void jacobianEach(const Point &x, Functor functor) const
Definition: localfunctionsetadapter.hh:74
FunctionSpaceType::RangeType RangeType
range type
Definition: localfunctionsetadapter.hh:39
void hessianEach(const DomainType &x, Functor functor) const
evalute hessian of each basis function
int order() const
return order of basis functions
FunctionSpaceType::HessianRangeType HessianRangeType
hessian range type
Definition: localfunctionsetadapter.hh:43
Entity EntityType
entity type
Definition: localfunctionsetadapter.hh:29
A vector valued function space.
Definition: functionspace.hh:16
const EntityType & entity() const
return entity
Definition: localfunctionsetadapter.hh:55
std::size_t size() const
return number of basis functions
Definition: localfunctionsetadapter.hh:62
const FunctionSetType functionSet() const
return function set
Definition: localfunctionsetadapter.hh:93
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
void hessianEach(const Point &x, Functor functor) const
Definition: localfunctionsetadapter.hh:82
void jacobianEach(const DomainType &x, Functor functor) const
evalute jacobian of each basis function
FunctionSpaceType::DomainType DomainType
domain type
Definition: localfunctionsetadapter.hh:37
convert (global) function set to local function set
Definition: localfunctionsetadapter.hh:26
void evaluateEach(const Point &x, Functor functor) const
Definition: localfunctionsetadapter.hh:66
std::size_t size() const
return number of basis functions
Definition: coordinate.hh:4
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
FunctionSet::FunctionSpaceType FunctionSpaceType
function space type
Definition: localfunctionsetadapter.hh:34
FunctionSet FunctionSetType
function set type
Definition: localfunctionsetadapter.hh:31
FunctionSpaceType::JacobianRangeType JacobianRangeType
jacobian range type
Definition: localfunctionsetadapter.hh:41
Global basis functions.
Definition: function/common/functionset.hh:27
int order() const
return order of basis functions
Definition: localfunctionsetadapter.hh:52
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
LocalFunctionSetAdapter(const Entity &entity, const FunctionSet &functionSet=FunctionSet())
Definition: localfunctionsetadapter.hh:45
static const Point & coordinate(const Point &x)
Definition: coordinate.hh:11