DUNE-FEM (unstable)

vectorial.hh
1#ifndef DUNE_FEM_HPDG_SPACE_BASISFUNCTIONSETS_VECTORIAL_HH
2#define DUNE_FEM_HPDG_SPACE_BASISFUNCTIONSETS_VECTORIAL_HH
3
4#include <cstddef>
5
7
9
10#include <dune/fem/space/basisfunctionset/vectorial.hh>
11
12#include "basisfunctionsets.hh"
13
14namespace Dune
15{
16
17 namespace Fem
18 {
19
20 namespace hpDG
21 {
22
23 // Internal forward declaration
24 // ----------------------------
25
26 template< class BasisFunctionSets, class Range >
27 class VectorialBasisFunctionSets;
28
29
30
31#ifndef DOXYGEN
32
33 // VectorialBasisFunctionSetTraits
34 // -------------------------------
35
36 template< class BasisFunctionSets, class Range >
37 class VectorialBasisFunctionSetsTraits
38 {
39 public:
40 using ImplementationType = VectorialBasisFunctionSets< BasisFunctionSets, Range >;
41
42 using GridPartType = typename BasisFunctionSets::GridPartType;
43 using Types = typename BasisFunctionSets::Types;
44
45 using KeyType = typename BasisFunctionSets::KeyType;
47 static const int localBlockSize = Range::dimension * BasisFunctionSets::localBlockSize;
48
49 using DataType = void *;
50 };
51
52#endif // #ifndef DOXYGEN
53
54
55
56 // VectorialBasisFunctionSet
57 // -------------------------
58
66 template< class BasisFunctionSets, class Range >
68 : public Dune::Fem::hpDG::BasisFunctionSets< VectorialBasisFunctionSetsTraits< BasisFunctionSets, Range > >
69 {
71
72 public:
74 using KeyType = typename BaseType::KeyType;
75
80
82 using DataType = typename BaseType::DataType;
83
88 explicit VectorialBasisFunctionSets ( const BasisFunctionSets &basisFunctionSets )
89 : basisFunctionSets_( basisFunctionSets )
90 {}
91
99 typename BaseType::Types types () const { return impl().types(); }
100
102 std::size_t maxBlocks () const { return impl().maxBlocks(); }
103
105 std::size_t maxBlocks ( GeometryType type ) const { return impl().maxBlocks(); }
106
108 std::size_t blocks ( GeometryType type, const KeyType &key ) const { return impl().maxBlocks(); }
109
111 DataType encode ( const KeyType &key ) const
112 {
113 DUNE_THROW( NotImplemented, "Method encode() not implemented yet" );
114 }
115
117 KeyType decode ( const DataType &data ) const
118 {
119 DUNE_THROW( NotImplemented, "Method decode() not implemented yet" );
120 }
121
123 static constexpr bool orthogonal () noexcept { return BasisFunctionSets::orthogonal(); }
124
126 int order () const { return impl().order(); }
127
129 int order ( GeometryType type ) const { return impl().order( type ); }
130
132 int order ( GeometryType type, const KeyType &key ) const { return impl().order( type, key ); }
133
135 std::size_t size ( GeometryType type, const KeyType &key ) const
136 {
137 return static_cast< std::size_t >( Range::dimension ) * impl().order( type, key );
138 }
139
141 BasisFunctionSetType basisFunctionSet ( const EntityType &entity, const KeyType &key ) const
142 {
143 return BasisFunctionSetType( impl().basisFunctionSet( entity, key ) );
144 }
145
153 const BasisFunctionSets &impl() const { return basisFunctionSets_; }
154
157 private:
158 BasisFunctionSets basisFunctionSets_;
159 };
160
161 } // namespace hpDG
162
163 } // namespace Fem
164
165} // namespace Dune
166
167#endif // #ifndef DUNE_FEM_HPDG_SPACE_BASISFUNCTIONSETS_VECTORIAL_HH
Builds a vectorial basis function set from given scalar basis function set.
Definition: vectorial.hh:279
abstract interface class for a family of local basis function sets
Definition: basisfunctionsets.hh:30
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
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
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
A meta implemenation of a family of local basis function sets.
Definition: vectorial.hh:69
BasisFunctionSetType basisFunctionSet(const EntityType &entity, const KeyType &key) const
return basis function set for given entity
Definition: vectorial.hh:141
int order() const
return maximum order
Definition: vectorial.hh:126
DataType encode(const KeyType &key) const
map key to data type
Definition: vectorial.hh:111
std::size_t maxBlocks() const
Definition: vectorial.hh:102
int order(GeometryType type) const
return maximum order
Definition: vectorial.hh:129
BaseType::Types types() const
Definition: vectorial.hh:99
KeyType decode(const DataType &data) const
map data to key type
Definition: vectorial.hh:117
const BasisFunctionSets & impl() const
return scalar basis function sets
Definition: vectorial.hh:153
typename BaseType::DataType DataType
Definition: vectorial.hh:82
int order(GeometryType type, const KeyType &key) const
return maximum order
Definition: vectorial.hh:132
typename BaseType::KeyType KeyType
Definition: vectorial.hh:74
typename BaseType::EntityType EntityType
entity type
Definition: vectorial.hh:79
std::size_t size(GeometryType type, const KeyType &key) const
Definition: vectorial.hh:135
std::size_t maxBlocks(GeometryType type) const
Definition: vectorial.hh:105
static constexpr bool orthogonal() noexcept
Definition: vectorial.hh:123
typename BaseType::BasisFunctionSetType BasisFunctionSetType
basis function set
Definition: vectorial.hh:77
std::size_t blocks(GeometryType type, const KeyType &key) const
Definition: vectorial.hh:108
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:114
Default exception for dummy implementations.
Definition: exceptions.hh:263
A few common exception classes.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
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 21, 23:30, 2024)