DUNE-FEM (unstable)

basisfunctionsets.hh
1#ifndef DUNE_FEM_HPDG_SPACE_BASISFUNCTIONSETS_BASISFUNCTIONSETS_HH
2#define DUNE_FEM_HPDG_SPACE_BASISFUNCTIONSETS_BASISFUNCTIONSETS_HH
3
4#include <cstddef>
5
7
9
10namespace 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
Provides check for implementation of interface methods when using static polymorphism,...
abstract interface class for a family of local basis function sets
Definition: basisfunctionsets.hh:30
BasisFunctionSetType basisFunctionSet(const EntityType &entity, const KeyType &key) const
return basis function set
Definition: basisfunctionsets.hh:151
int order(GeometryType type, const KeyType &key) const
return polynomial order
Definition: basisfunctionsets.hh:144
DataType encode(const KeyType &key) const
map key to data type
Definition: basisfunctionsets.hh:104
int order(GeometryType type) const
return maximum polynomial order per geometry type
Definition: basisfunctionsets.hh:137
typename Traits::DataType DataType
data type
Definition: basisfunctionsets.hh:53
std::size_t maxBlocks() const
return maximum number of blocks used
Definition: basisfunctionsets.hh:77
std::size_t blocks(GeometryType type, const KeyType &key) const
return number of blocks used
Definition: basisfunctionsets.hh:91
typename Traits::Types Types
a range of geometry types
Definition: basisfunctionsets.hh:47
typename Traits::BasisFunctionSetType BasisFunctionSetType
basis function set type
Definition: basisfunctionsets.hh:42
static const int localBlockSize
block size
Definition: basisfunctionsets.hh:50
Types types() const
return range of supported geometry types
Definition: basisfunctionsets.hh:64
typename BasisFunctionSetType::EntityType EntityType
entity type
Definition: basisfunctionsets.hh:44
int order() const
return maximum polynomial order
Definition: basisfunctionsets.hh:130
std::size_t maxBlocks(GeometryType type) const
return maximum number of blocks used per geometry type
Definition: basisfunctionsets.hh:84
KeyType decode(const DataType &data) const
map data to key type
Definition: basisfunctionsets.hh:111
static constexpr bool orthogonal() noexcept
return true if basis function sets are always orthogonal, false otherwise
Definition: basisfunctionsets.hh:124
typename Traits::KeyType KeyType
key type
Definition: basisfunctionsets.hh:39
typename Traits::GridPartType GridPartType
grid part type
Definition: basisfunctionsets.hh:36
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:114
Dune namespace.
Definition: alignedallocator.hh:13
A unique label for each type of element that can occur in a grid.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 13, 23:29, 2024)