dune-fem 2.8.0
Loading...
Searching...
No Matches
mapper.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_SPACE_PADAPTIVE_MAPPER_HH
2#define DUNE_FEM_SPACE_PADAPTIVE_MAPPER_HH
3
4#include <dune/common/exceptions.hh>
5
6#include <dune/geometry/type.hh>
7#include <dune/geometry/typeindex.hh>
8
9#include <dune/grid/utility/persistentcontainer.hh>
10
12#include <dune/fem/misc/metaprogramming.hh>
19
20
21namespace Dune
22{
23
24 namespace Fem
25 {
26
27 // Internal forward declaration
28 // ----------------------------
29 template< class GridPart, int polOrder >
30 class PAdaptiveLagrangeMapper;
31
32
33
34 // PAdaptiveLagrangeMapperTraits
35 // -----------------------------
36
37 template< class GridPart, int polOrder >
39 {
40 typedef GridPart GridPartType;
41
42 static const int polynomialOrder = polOrder;
43 // if this is set to true the mapper behaves like a DG mapper
44 static const bool discontinuousMapper = false;
45
46 typedef typename GridPartType::template Codim< 0 >::EntityType ElementType;
48
52
53 typedef std::vector< BaseSetLocalKeyStorageType > CompiledLocalKeyVectorType ;
54
55 typedef int SizeType ;
56 typedef int GlobalKeyType ;
57 };
58
59
60
61 // Higher Order Lagrange Mapper
62 // ----------------------------
63
64 template< class GridPart, int polOrder >
66 : public GenericAdaptiveDofMapper< PAdaptiveLagrangeMapperTraits< GridPart, polOrder > >
67 {
68 public:
69 // my traits class
71
72 private:
75
76 public:
79
81 typedef typename Traits :: CompiledLocalKeyVectorType CompiledLocalKeyVectorType;
82
85 const int order,
86 CompiledLocalKeyVectorType &compiledLocalKeys )
87 : BaseType( gridPart, order, compiledLocalKeys )
88 {}
89
92 const int order,
93 CompiledLocalKeyVectorType &compiledLocalKeys )
94 : BaseType( other, order, compiledLocalKeys )
95 {}
96 };
97
98 template< class GridPart, int polOrder >
99 class PAdaptiveDGMapper;
100
101 template< class GridPart, int polOrder >
103 : public PAdaptiveLagrangeMapperTraits< GridPart, polOrder >
104 {
105 // this is a mapper for DG
106 static const bool discontinuousMapper = true ;
107
108 typedef typename GridPart::template Codim< 0 >::EntityType ElementType;
110 typedef int SizeType ;
111 typedef int GlobalKeyType ;
112 };
113
114
115 // Higher Order Adaptive DG Mapper
116 // -------------------------------
117
118 template< class GridPart, int polOrder >
120 : public GenericAdaptiveDofMapper< PAdaptiveDGMapperTraits< GridPart, polOrder > >
121 {
122 public:
123 // my traits class
125
126 private:
129
130 public:
133
135 typedef typename Traits :: CompiledLocalKeyVectorType CompiledLocalKeyVectorType;
136
139 const int order,
140 CompiledLocalKeyVectorType &compiledLocalKeys )
141 : BaseType( gridPart, order, compiledLocalKeys )
142 {}
143
146 const int order,
147 CompiledLocalKeyVectorType &compiledLocalKeys )
148 : BaseType( other, order, compiledLocalKeys )
149 {}
150 };
151
152 namespace Capabilities
153 {
154 // isConsecutiveIndexSet
155 // ---------------------
156
157 template< class GridPart, int polOrder >
158 struct isConsecutiveIndexSet< PAdaptiveDGMapper< GridPart, polOrder > >
159 {
160 static const bool v = true;
161 };
162
163 template< class GridPart, int polOrder >
164 struct isConsecutiveIndexSet< PAdaptiveLagrangeMapper< GridPart, polOrder > >
165 {
166 static const bool v = true;
167 };
168
169 template< class GridPart, int polOrder >
170 struct isAdaptiveDofMapper< PAdaptiveLagrangeMapper< GridPart, polOrder > >
171 {
172 static const bool v = true;
173 };
174
175 template< class GridPart, int polOrder >
176 struct isAdaptiveDofMapper< PAdaptiveDGMapper< GridPart, polOrder > >
177 {
178 static const bool v = true;
179 };
180
181 } // namespace Capabilities
182
183 } // namespace Fem
184
185} // namespace Dune
186
187#endif // #ifndef DUNE_FEM_SPACE_PADAPTIVE_MAPPER_HH
Definition: bindguard.hh:11
specialize with true if index set implements the interface for consecutive index sets
Definition: common/indexset.hh:42
static const bool v
Definition: common/indexset.hh:49
storage class for base function set pointer and compiled local key pointers
Definition: basesetlocalkeystorage.hh:26
Definition: lagrangepoints.hh:685
Definition: space/mapper/capabilities.hh:22
static const bool v
Definition: space/mapper/capabilities.hh:23
Definition: genericadaptivedofmapper.hh:32
Definition: mapper.hh:67
PAdaptiveLagrangeMapper(const GridPartType &gridPart, const int order, CompiledLocalKeyVectorType &compiledLocalKeys)
constructor
Definition: mapper.hh:84
PAdaptiveLagrangeMapper(const ThisType &other, const int order, CompiledLocalKeyVectorType &compiledLocalKeys)
sort of copy constructor
Definition: mapper.hh:91
PAdaptiveLagrangeMapperTraits< GridPart, polOrder > Traits
Definition: mapper.hh:70
Traits::CompiledLocalKeyVectorType CompiledLocalKeyVectorType
type of compiled local keys vector
Definition: mapper.hh:81
Traits::GridPartType GridPartType
type of the grid part
Definition: mapper.hh:78
int SizeType
Definition: mapper.hh:55
std::vector< BaseSetLocalKeyStorageType > CompiledLocalKeyVectorType
Definition: mapper.hh:53
static const bool discontinuousMapper
Definition: mapper.hh:44
int GlobalKeyType
Definition: mapper.hh:56
PAdaptiveLagrangeMapper< GridPartType, polynomialOrder > DofMapperType
Definition: mapper.hh:47
GridPart GridPartType
Definition: mapper.hh:40
BaseSetLocalKeyStorage< CompiledLocalKeyType > BaseSetLocalKeyStorageType
Definition: mapper.hh:51
static const int polynomialOrder
Definition: mapper.hh:42
LagrangePointSet< GridPartType, polynomialOrder > CompiledLocalKeyType
type of the compiled local key
Definition: mapper.hh:50
GridPartType::template Codim< 0 >::EntityType ElementType
Definition: mapper.hh:46
Definition: mapper.hh:121
PAdaptiveDGMapperTraits< GridPart, polOrder > Traits
Definition: mapper.hh:124
PAdaptiveDGMapper(const GridPartType &gridPart, const int order, CompiledLocalKeyVectorType &compiledLocalKeys)
constructor
Definition: mapper.hh:138
Traits::GridPartType GridPartType
type of the grid part
Definition: mapper.hh:132
PAdaptiveDGMapper(const ThisType &other, const int order, CompiledLocalKeyVectorType &compiledLocalKeys)
sort of copy constructor
Definition: mapper.hh:145
Traits::CompiledLocalKeyVectorType CompiledLocalKeyVectorType
type of compiled local keys vector
Definition: mapper.hh:135
Definition: mapper.hh:104
GridPart::template Codim< 0 >::EntityType ElementType
Definition: mapper.hh:108
static const bool discontinuousMapper
Definition: mapper.hh:106
int SizeType
Definition: mapper.hh:110
int GlobalKeyType
Definition: mapper.hh:111
PAdaptiveDGMapper< GridPart, polOrder > DofMapperType
Definition: mapper.hh:109