DUNE-FEM (unstable)

mapper.hh
1#ifndef DUNE_FEM_SPACE_PADAPTIVE_MAPPER_HH
2#define DUNE_FEM_SPACE_PADAPTIVE_MAPPER_HH
3
5
8
9#include <dune/grid/utility/persistentcontainer.hh>
10
11#include <dune/fem/misc/capabilities.hh>
12#include <dune/fem/misc/metaprogramming.hh>
13#include <dune/fem/space/common/basesetlocalkeystorage.hh>
14#include <dune/fem/space/common/dofmanager.hh>
15#include <dune/fem/space/lagrange/lagrangepoints.hh>
16#include <dune/fem/space/mapper/codimensionmapper.hh>
17#include <dune/fem/space/mapper/dofmapper.hh>
18#include <dune/fem/space/mapper/genericadaptivedofmapper.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 >
38 struct PAdaptiveLagrangeMapperTraits
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;
47 typedef PAdaptiveLagrangeMapper< GridPartType, polynomialOrder > DofMapperType;
48
50 typedef LagrangePointSet< GridPartType, polynomialOrder > CompiledLocalKeyType;
51 typedef BaseSetLocalKeyStorage< CompiledLocalKeyType > BaseSetLocalKeyStorageType;
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 >
65 class PAdaptiveLagrangeMapper
66 : public GenericAdaptiveDofMapper< PAdaptiveLagrangeMapperTraits< GridPart, polOrder > >
67 {
68 public:
69 // my traits class
70 typedef PAdaptiveLagrangeMapperTraits< GridPart, polOrder > Traits;
71
72 private:
73 typedef PAdaptiveLagrangeMapper< GridPart, polOrder > ThisType;
74 typedef GenericAdaptiveDofMapper< Traits > BaseType;
75
76 public:
78 typedef typename Traits::GridPartType GridPartType;
79
81 typedef typename Traits :: CompiledLocalKeyVectorType CompiledLocalKeyVectorType;
82
84 PAdaptiveLagrangeMapper ( const GridPartType &gridPart,
85 const int order,
86 CompiledLocalKeyVectorType &compiledLocalKeys )
87 : BaseType( gridPart, order, compiledLocalKeys )
88 {}
89
91 PAdaptiveLagrangeMapper ( const ThisType& other,
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 >
102 struct PAdaptiveDGMapperTraits
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;
109 typedef PAdaptiveDGMapper< GridPart, polOrder > DofMapperType;
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 >
119 class PAdaptiveDGMapper
120 : public GenericAdaptiveDofMapper< PAdaptiveDGMapperTraits< GridPart, polOrder > >
121 {
122 public:
123 // my traits class
124 typedef PAdaptiveDGMapperTraits< GridPart, polOrder > Traits;
125
126 private:
127 typedef PAdaptiveDGMapper< GridPart, polOrder > ThisType;
128 typedef GenericAdaptiveDofMapper< Traits > BaseType;
129
130 public:
132 typedef typename Traits::GridPartType GridPartType;
133
135 typedef typename Traits :: CompiledLocalKeyVectorType CompiledLocalKeyVectorType;
136
138 PAdaptiveDGMapper ( const GridPartType &gridPart,
139 const int order,
140 CompiledLocalKeyVectorType &compiledLocalKeys )
141 : BaseType( gridPart, order, compiledLocalKeys )
142 {}
143
145 PAdaptiveDGMapper ( const ThisType& other,
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
A few common exception classes.
Dune namespace.
Definition: alignedallocator.hh:13
A unique label for each type of element that can occur in a grid.
Helper classes to provide indices for geometrytypes for use in a vector.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 13, 23:29, 2024)