dune-fem  2.8-git
basisfunctionset/hpdg/basisfunctionsets.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_HPDG_SPACE_BASISFUNCTIONSETS_BASISFUNCTIONSETS_HH
2 #define DUNE_FEM_HPDG_SPACE_BASISFUNCTIONSETS_BASISFUNCTIONSETS_HH
3 
4 #include <cstddef>
5 
6 #include <dune/common/bartonnackmanifcheck.hh>
7 
8 #include <dune/geometry/type.hh>
9 
10 namespace Dune
11 {
12 
13  namespace Fem
14  {
15 
16  namespace hpDG
17  {
18 
19  // BasisFunctionSets
20  // -----------------
21 
28  template< class T >
30  {
31  protected:
32  using Traits = T;
33 
34  public:
36  using GridPartType = typename Traits::GridPartType;
37 
39  using KeyType = typename Traits::KeyType;
40 
42  using BasisFunctionSetType = typename Traits::BasisFunctionSetType;
44  using EntityType = typename BasisFunctionSetType::EntityType;
45 
47  using Types = typename Traits::Types;
48 
50  static const int localBlockSize = Traits::localBlockSize;
51 
53  using DataType = typename Traits::DataType;
54 
55  protected:
56  BasisFunctionSets () = default;
57 
58  public:
64  Types types () const
65  {
66  CHECK_INTERFACE_IMPLEMENTATION( impl().types() );
67  return impl().types();
68  }
69 
77  std::size_t maxBlocks () const
78  {
79  CHECK_INTERFACE_IMPLEMENTATION( impl().maxBlocks() );
80  return impl().maxBlocks();
81  }
82 
84  std::size_t maxBlocks ( GeometryType type ) const
85  {
86  CHECK_INTERFACE_IMPLEMENTATION( impl().maxBlocks( type ) );
87  return impl().maxBlocks( type );
88  }
89 
91  std::size_t blocks ( GeometryType type, const KeyType &key ) const
92  {
93  CHECK_INTERFACE_IMPLEMENTATION( impl().blocks( type, key ) );
94  return impl().blocks( type, key );
95  }
96 
104  DataType encode ( const KeyType &key ) const
105  {
106  CHECK_INTERFACE_IMPLEMENTATION( impl().encode( key ) );
107  return impl().encode( key );
108  }
109 
111  KeyType decode ( const DataType &data ) const
112  {
113  CHECK_INTERFACE_IMPLEMENTATION( impl().decode( data ) );
114  return impl().decode( data );
115  }
116 
124  static constexpr bool orthogonal () noexcept
125  {
126  return Traits::ImplementationType::orthogonal();
127  }
128 
130  int order () const
131  {
132  CHECK_INTERFACE_IMPLEMENTATION( impl().order() );
133  return impl().order();
134  }
135 
137  int order ( GeometryType type ) const
138  {
139  CHECK_INTERFACE_IMPLEMENTATION( impl().order( type ) );
140  return impl().order( type );
141  }
142 
144  int order ( GeometryType type, const KeyType &key ) const
145  {
146  CHECK_INTERFACE_IMPLEMENTATION( impl().order( type, key ) );
147  return impl().order( type, key );
148  }
149 
151  BasisFunctionSetType basisFunctionSet ( const EntityType &entity, const KeyType &key ) const
152  {
153  CHECK_INTERFACE_IMPLEMENTATION( impl().basisFunctionSet( entity, key ) );
154  return impl().basisFunctionSet( entity, key );
155  }
156 
159  protected:
160  const typename Traits::ImplementationType &impl () const
161  {
162  return static_cast< const typename Traits::ImplementationType & >( *this );
163  }
164  };
165 
166  } // namespace hpDG
167 
168  } // namespace Fem
169 
170 } // namespace Dune
171 
172 #endif // #ifndef DUNE_FEM_HPDG_SPACE_BASISFUNCTIONSETS_BASISFUNCTIONSETS_HH
Definition: bindguard.hh:11
abstract interface class for a family of local basis function sets
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:30
BasisFunctionSetType basisFunctionSet(const EntityType &entity, const KeyType &key) const
return basis function set
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:151
int order(GeometryType type, const KeyType &key) const
return polynomial order
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:144
T Traits
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:32
DataType encode(const KeyType &key) const
map key to data type
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:104
int order(GeometryType type) const
return maximum polynomial order per geometry type
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:137
typename Traits::DataType DataType
data type
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:53
const Traits::ImplementationType & impl() const
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:160
std::size_t maxBlocks() const
return maximum number of blocks used
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:77
std::size_t blocks(GeometryType type, const KeyType &key) const
return number of blocks used
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:91
typename Traits::Types Types
a range of geometry types
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:47
typename Traits::BasisFunctionSetType BasisFunctionSetType
basis function set type
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:42
static const int localBlockSize
block size
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:50
Types types() const
return range of supported geometry types
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:64
typename BasisFunctionSetType::EntityType EntityType
entity type
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:44
int order() const
return maximum polynomial order
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:130
std::size_t maxBlocks(GeometryType type) const
return maximum number of blocks used per geometry type
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:84
KeyType decode(const DataType &data) const
map data to key type
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:111
static constexpr bool orthogonal() noexcept
return true if basis function sets are always orthogonal, false otherwise
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:124
typename Traits::KeyType KeyType
key type
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:39
typename Traits::GridPartType GridPartType
grid part type
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:36