FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
schneiders_data.hpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6#pragma once
7
8#include <kernel/geometry/raw_refinement_templates.hpp>
9#include <kernel/geometry/refinement_types.hpp>
10#include <kernel/shape.hpp>
11
12namespace FEAT::Geometry
13{
15 {
16 public:
19
26
28 template<int dim_>
30
32 template<typename Shape__>
34
36 template<int dim_>
37 using TemplateMapByDim = std::unordered_map<RefinementTypeByDim<dim_>, RawTemplate<Shape::Hypercube<dim_>>>;
38
45
52
62 template<typename Shape_>
63 static constexpr bool is_shape_compatible()
64 {
65 return std::is_same_v<Shape_, Shape::Quadrilateral> || std::is_same_v<Shape_, Shape::Hexahedron>;
66 }
67
78 template<int template_dim_, int child_dim_>
79 static constexpr int max_children()
80 {
81 static_assert(template_dim_ <= 3);
82 static_assert(child_dim_ <= 3);
83 const constexpr std::array<std::array<int, 4>, 4> children = {{
84 {0, 0, 0, 0},
85 {2, 3, 0, 0},
86 {4, 12, 9, 0},
87 {8, 36, 54, 27},
88 }};
89 return children[template_dim_][child_dim_];
90 }
91
97 template<int dim_>
99 {
100 if constexpr(dim_ == 1)
101 {
102 return raw_edges();
103 }
104 if constexpr(dim_ == 2)
105 {
106 return raw_faces();
107 }
108 if constexpr(dim_ == 3)
109 {
110 return raw_cells();
111 }
112 XABORTM("SchneidersData supplied no templates of dimension " + stringify(dim_));
113 }
114
117 {
118 using V = typename RawEdgeTemplate::VertexType;
119
120 static EdgeMap result;
121
122 if(result.empty())
123 {
124 result.insert({RefinementTypeByDim<1>(0b00), RawEdgeTemplate()});
125
126 result.insert(
128 RawEdgeTemplate().add_entity(V{0.0}, V{1.0 / 3.0}).add_entity(V{1.0 / 3.0}, V{1.0})});
129
130 result.insert(
132 RawEdgeTemplate().add_entity(V{0.0}, V{2.0 / 3.0}).add_entity(V{2.0 / 3.0}, V{1.0})});
133
134 result.insert(
137 .add_entity(V{0.0}, V{1.0 / 3.0})
138 .add_entity(V{1.0 / 3.0}, V{2.0 / 3.0})
139 .add_entity(V{2.0 / 3.0}, V{1.0})});
140 }
141
142 return result;
143 }
144
147 {
148 using V = typename RawFaceTemplate::VertexType;
149
150 static FaceMap result;
151
152 if(result.empty())
153 {
154 // Add base types
155 result.insert({RefinementTypeByDim<2>(0b0000), RawFaceTemplate()});
156
157 result.insert(
158 {RefinementTypeByDim<2>(0b0001),
160 .add_entity(V{0.0, 1.0 / 3.0}, V{1.0 / 3.0, 1.0 / 3.0}, V{0.0, 1.0}, V{1.0, 1.0})
161 .add_entity(V{0.0, 0.0}, V{1.0 / 3.0, 0.0}, V{0.0, 1.0 / 3.0}, V{1.0 / 3.0, 1.0 / 3.0})
162 .add_entity(V{1.0 / 3.0, 0.0}, V{1.0, 0.0}, V{1.0 / 3.0, 1.0 / 3.0}, V{1.0, 1.0})});
163
164 result.insert(
165 {RefinementTypeByDim<2>(0b0011),
167 .add_entity(V{1.0 / 3.0, 2.0 / 3.0}, V{2.0 / 3.0, 2.0 / 3.0}, V{0.0, 1.0}, V{1.0, 1.0})
168 .add_entity(V{0.0, 1.0 / 3.0}, V{1.0 / 3.0, 1.0 / 3.0}, V{0.0, 1.0}, V{1.0 / 3.0, 2.0 / 3.0})
169 .add_entity(
170 V{1.0 / 3.0, 1.0 / 3.0},
171 V{2.0 / 3.0, 1.0 / 3.0},
172 V{1.0 / 3.0, 2.0 / 3.0},
173 V{2.0 / 3.0, 2.0 / 3.0})
174 .add_entity(V{2.0 / 3.0, 1.0 / 3.0}, V{1.0, 1.0 / 3.0}, V{2.0 / 3.0, 2.0 / 3.0}, V{1.0, 1.0})
175 .add_entity(V{0.0, 0.0}, V{1.0 / 3.0, 0.0}, V{0.0, 1.0 / 3.0}, V{1.0 / 3.0, 1.0 / 3.0})
176 .add_entity(V{1.0 / 3.0, 0.0}, V{2.0 / 3.0, 0.0}, V{1.0 / 3.0, 1.0 / 3.0}, V{2.0 / 3.0, 1.0 / 3.0})
177 .add_entity(V{2.0 / 3.0, 0.0}, V{1.0, 0.0}, V{2.0 / 3.0, 1.0 / 3.0}, V{1.0, 1.0 / 3.0})});
178
179 result.insert(
180 {RefinementTypeByDim<2>(0b1001),
182 .add_entity(V{1.0 / 3.0, 2.0 / 3.0}, V{2.0 / 3.0, 2.0 / 3.0}, V{0.0, 1.0}, V{2.0 / 3.0, 1.0})
183 .add_entity(V{2.0 / 3.0, 2.0 / 3.0}, V{1.0, 2.0 / 3.0}, V{2.0 / 3.0, 1.0}, V{1.0, 1.0})
184 .add_entity(V{0.0, 1.0 / 3.0}, V{1.0 / 3.0, 1.0 / 3.0}, V{0.0, 1.0}, V{1.0 / 3.0, 2.0 / 3.0})
185 .add_entity(
186 V{1.0 / 3.0, 1.0 / 3.0},
187 V{2.0 / 3.0, 1.0 / 3.0},
188 V{1.0 / 3.0, 2.0 / 3.0},
189 V{2.0 / 3.0, 2.0 / 3.0})
190 .add_entity(V{2.0 / 3.0, 1.0 / 3.0}, V{1.0, 0.0}, V{2.0 / 3.0, 2.0 / 3.0}, V{1.0, 2.0 / 3.0})
191 .add_entity(V{0.0, 0.0}, V{1.0 / 3.0, 0.0}, V{0.0, 1.0 / 3.0}, V{1.0 / 3.0, 1.0 / 3.0})
192 .add_entity(V{1.0 / 3.0, 0.0}, V{1.0, 0.0}, V{1.0 / 3.0, 1.0 / 3.0}, V{2.0 / 3.0, 1.0 / 3.0})});
193 result.insert(
194 {RefinementTypeByDim<2>(0b1011),
196 .add_entity(V{1.0 / 3.0, 2.0 / 3.0}, V{2.0 / 3.0, 2.0 / 3.0}, V{0.0, 1.0}, V{2.0 / 3.0, 1.0})
197 .add_entity(V{2.0 / 3.0, 2.0 / 3.0}, V{1.0, 2.0 / 3.0}, V{2.0 / 3.0, 1.0}, V{1.0, 1.0})
198 .add_entity(V{0.0, 1.0 / 3.0}, V{1.0 / 3.0, 1.0 / 3.0}, V{0.0, 1.0}, V{1.0 / 3.0, 2.0 / 3.0})
199 .add_entity(
200 V{1.0 / 3.0, 1.0 / 3.0},
201 V{2.0 / 3.0, 1.0 / 3.0},
202 V{1.0 / 3.0, 2.0 / 3.0},
203 V{2.0 / 3.0, 2.0 / 3.0})
204 .add_entity(V{2.0 / 3.0, 1.0 / 3.0}, V{1.0, 1.0 / 3.0}, V{2.0 / 3.0, 2.0 / 3.0}, V{1.0, 2.0 / 3.0})
205 .add_entity(V{0.0, 0.0}, V{1.0 / 3.0, 0.0}, V{0.0, 1.0 / 3.0}, V{1.0 / 3.0, 1.0 / 3.0})
206 .add_entity(V{1.0 / 3.0, 0.0}, V{2.0 / 3.0, 0.0}, V{1.0 / 3.0, 1.0 / 3.0}, V{2.0 / 3.0, 1.0 / 3.0})
207 .add_entity(V{2.0 / 3.0, 0.0}, V{1.0, 0.0}, V{2.0 / 3.0, 1.0 / 3.0}, V{1.0, 1.0 / 3.0})});
208
209 result.insert(
210 {RefinementTypeByDim<2>(0b1111),
212 .add_entity(V{0.0, 2.0 / 3.0}, V{1.0 / 3.0, 2.0 / 3.0}, V{0.0, 1.0}, V{1.0 / 3.0, 1.0})
213 .add_entity(V{1.0 / 3.0, 2.0 / 3.0}, V{2.0 / 3.0, 2.0 / 3.0}, V{1.0 / 3.0, 1.0}, V{2.0 / 3.0, 1.0})
214 .add_entity(V{2.0 / 3.0, 2.0 / 3.0}, V{1.0, 2.0 / 3.0}, V{2.0 / 3.0, 1.0}, V{1.0, 1.0})
215 .add_entity(V{0.0, 1.0 / 3.0}, V{1.0 / 3.0, 1.0 / 3.0}, V{0.0, 2.0 / 3.0}, V{1.0 / 3.0, 2.0 / 3.0})
216 .add_entity(
217 V{1.0 / 3.0, 1.0 / 3.0},
218 V{2.0 / 3.0, 1.0 / 3.0},
219 V{1.0 / 3.0, 2.0 / 3.0},
220 V{2.0 / 3.0, 2.0 / 3.0})
221 .add_entity(V{2.0 / 3.0, 1.0 / 3.0}, V{1.0, 1.0 / 3.0}, V{2.0 / 3.0, 2.0 / 3.0}, V{1.0, 2.0 / 3.0})
222 .add_entity(V{0.0, 0.0}, V{1.0 / 3.0, 0.0}, V{0.0, 1.0 / 3.0}, V{1.0 / 3.0, 1.0 / 3.0})
223 .add_entity(V{1.0 / 3.0, 0.0}, V{2.0 / 3.0, 0.0}, V{1.0 / 3.0, 1.0 / 3.0}, V{2.0 / 3.0, 1.0 / 3.0})
224 .add_entity(V{2.0 / 3.0, 0.0}, V{1.0, 0.0}, V{2.0 / 3.0, 1.0 / 3.0}, V{1.0, 1.0 / 3.0})});
225
226 // Rotate base templates to find remaining types
230
231 result.insert({RefinementTypeByDim<2>(10), rotate_template_2d(result[RefinementTypeByDim<2>(3)])});
232 result.insert({RefinementTypeByDim<2>(12), rotate_template_2d(result[RefinementTypeByDim<2>(10)])});
233 result.insert({RefinementTypeByDim<2>(5), rotate_template_2d(result[RefinementTypeByDim<2>(12)])});
234
236
237 result.insert({RefinementTypeByDim<2>(14), rotate_template_2d(result[RefinementTypeByDim<2>(11)])});
238 result.insert({RefinementTypeByDim<2>(13), rotate_template_2d(result[RefinementTypeByDim<2>(14)])});
239 result.insert({RefinementTypeByDim<2>(7), rotate_template_2d(result[RefinementTypeByDim<2>(13)])});
240 }
241
242 return result;
243 }
244
247 {
248 using V = typename RawCellTemplate::VertexType;
249
250 static CellMap result;
251
252 if(result.empty())
253 {
254 // Add base types
255 result.insert({RefinementTypeByDim<3>(0b00000000), RawCellTemplate()});
256
257 // Vertex refinement
258 result.insert(
259 {RefinementTypeByDim<3>(0b00100000),
261 .add_entity(
262 V{2.0 / 3.0, 0.0, 2.0 / 3.0},
263 V{1.0, 0.0, 2.0 / 3.0},
264 V{2.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
265 V{1.0, 1.0 / 3.0, 2.0 / 3.0},
266 V{2.0 / 3.0, 0.0, 1.0},
267 V{1.0, 0.0, 1.0},
268 V{2.0 / 3.0, 1.0 / 3.0, 1.0},
269 V{1.0, 1.0 / 3.0, 1.0})
270 .add_entity(
271 V{0.0, 0.0, 0.0},
272 V{2.0 / 3.0, 0.0, 2.0 / 3.0},
273 V{0.0, 1.0, 0.0},
274 V{2.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
275 V{0.0, 0.0, 1.0},
276 V{2.0 / 3.0, 0.0, 1.0},
277 V{0.0, 1.0, 1.0},
278 V{2.0 / 3.0, 1.0 / 3.0, 1.0})
279 .add_entity(
280 V{2.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
281 V{1.0, 1.0 / 3.0, 2.0 / 3.0},
282 V{0.0, 1.0, 0.0},
283 V{1.0, 1.0, 0.0},
284 V{2.0 / 3.0, 1.0 / 3.0, 1.0},
285 V{1.0, 1.0 / 3.0, 1.0},
286 V{0.0, 1.0, 1.0},
287 V{1.0, 1.0, 1.0})
288 .add_entity(
289 V{0.0, 0.0, 0.0},
290 V{1.0, 0.0, 0.0},
291 V{0.0, 1.0, 0.0},
292 V{1.0, 1.0, 0.0},
293 V{2.0 / 3.0, 0.0, 2.0 / 3.0},
294 V{1.0, 0.0, 2.0 / 3.0},
295 V{2.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
296 V{1.0, 1.0 / 3.0, 2.0 / 3.0})});
297
298 // Edge refinement
299 result.insert(
300 {RefinementTypeByDim<3>(0b00110000),
302 .add_entity(
303 V{0.0, 0.0, 2.0 / 3.0},
304 V{1.0 / 3.0, 0.0, 2.0 / 3.0},
305 V{0.0, 1.0 / 3.0, 2.0 / 3.0},
306 V{1.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
307 V{0.0, 0.0, 1.0},
308 V{1.0 / 3.0, 0.0, 1.0},
309 V{0.0, 1.0 / 3.0, 1.0},
310 V{1.0 / 3.0, 1.0 / 3.0, 1.0})
311 .add_entity(
312 V{1.0 / 3.0, 0.0, 2.0 / 3.0},
313 V{2.0 / 3.0, 0.0, 2.0 / 3.0},
314 V{1.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
315 V{2.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
316 V{1.0 / 3.0, 0.0, 1.0},
317 V{2.0 / 3.0, 0.0, 1.0},
318 V{1.0 / 3.0, 1.0 / 3.0, 1.0},
319 V{2.0 / 3.0, 1.0 / 3.0, 1.0})
320 .add_entity(
321 V{2.0 / 3.0, 0.0, 2.0 / 3.0},
322 V{1.0, 0.0, 2.0 / 3.0},
323 V{2.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
324 V{1.0, 1.0 / 3.0, 2.0 / 3.0},
325 V{2.0 / 3.0, 0.0, 1.0},
326 V{1.0, 0.0, 1.0},
327 V{2.0 / 3.0, 1.0 / 3.0, 1.0},
328 V{1.0, 1.0 / 3.0, 1.0})
329 .add_entity(
330 V{0.0, 0.0, 0.0},
331 V{1.0 / 3.0, 0.0, 1.0 / 3.0},
332 V{0.0, 1.0, 0.0},
333 V{1.0 / 3.0, 2.0 / 3.0, 1.0 / 3.0},
334 V{0.0, 0.0, 2.0 / 3.0},
335 V{1.0 / 3.0, 0.0, 2.0 / 3.0},
336 V{0.0, 1.0 / 3.0, 2.0 / 3.0},
337 V{1.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0})
338 .add_entity(
339 V{1.0 / 3.0, 0.0, 1.0 / 3.0},
340 V{2.0 / 3.0, 0.0, 1.0 / 3.0},
341 V{1.0 / 3.0, 2.0 / 3.0, 1.0 / 3.0},
342 V{2.0 / 3.0, 2.0 / 3.0, 1.0 / 3.0},
343 V{1.0 / 3.0, 0.0, 2.0 / 3.0},
344 V{2.0 / 3.0, 0.0, 2.0 / 3.0},
345 V{1.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
346 V{2.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0})
347 .add_entity(
348 V{2.0 / 3.0, 0.0, 1.0 / 3.0},
349 V{1.0, 0.0, 0.0},
350 V{2.0 / 3.0, 2.0 / 3.0, 1.0 / 3.0},
351 V{1.0, 1.0, 0.0},
352 V{2.0 / 3.0, 0.0, 2.0 / 3.0},
353 V{1.0, 0.0, 2.0 / 3.0},
354 V{2.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
355 V{1.0, 1.0 / 3.0, 2.0 / 3.0})
356 .add_entity(
357 V{0.0, 1.0 / 3.0, 2.0 / 3.0},
358 V{1.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
359 V{0.0, 1.0, 0.0},
360 V{1.0 / 3.0, 2.0 / 3.0, 1.0 / 3.0},
361 V{0.0, 1.0 / 3.0, 1.0},
362 V{1.0 / 3.0, 1.0 / 3.0, 1.0},
363 V{0.0, 1.0, 1.0},
364 V{1.0 / 3.0, 2.0 / 3.0, 1.0})
365 .add_entity(
366 V{1.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
367 V{2.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
368 V{1.0 / 3.0, 2.0 / 3.0, 1.0 / 3.0},
369 V{2.0 / 3.0, 2.0 / 3.0, 1.0 / 3.0},
370 V{1.0 / 3.0, 1.0 / 3.0, 1.0},
371 V{2.0 / 3.0, 1.0 / 3.0, 1.0},
372 V{1.0 / 3.0, 2.0 / 3.0, 1.0},
373 V{2.0 / 3.0, 2.0 / 3.0, 1.0})
374 .add_entity(
375 V{2.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
376 V{1.0, 1.0 / 3.0, 2.0 / 3.0},
377 V{2.0 / 3.0, 2.0 / 3.0, 1.0 / 3.0},
378 V{1.0, 1.0, 0.0},
379 V{2.0 / 3.0, 1.0 / 3.0, 1.0},
380 V{1.0, 1.0 / 3.0, 1.0},
381 V{2.0 / 3.0, 2.0 / 3.0, 1.0},
382 V{1.0, 1.0, 1.0})
383 .add_entity(
384 V{0.0, 0.0, 0.0},
385 V{1.0, 0.0, 0.0},
386 V{0.0, 1.0, 0.0},
387 V{1.0, 1.0, 0.0},
388 V{1.0 / 3.0, 0.0, 1.0 / 3.0},
389 V{2.0 / 3.0, 0.0, 1.0 / 3.0},
390 V{1.0 / 3.0, 2.0 / 3.0, 1.0 / 3.0},
391 V{2.0 / 3.0, 2.0 / 3.0, 1.0 / 3.0})
392 .add_entity(
393 V{1.0 / 3.0, 2.0 / 3.0, 1.0 / 3.0},
394 V{2.0 / 3.0, 2.0 / 3.0, 1.0 / 3.0},
395 V{0.0, 1.0, 0.0},
396 V{1.0, 1.0, 0.0},
397 V{1.0 / 3.0, 2.0 / 3.0, 1.0},
398 V{2.0 / 3.0, 2.0 / 3.0, 1.0},
399 V{0.0, 1.0, 1.0},
400 V{1.0, 1.0, 1.0})});
401
402 // Face refinement
403 result.insert(
404 {RefinementTypeByDim<3>(0b11110000),
406 .add_entity(
407 V{0.0, 0.0, 2.0 / 3.0},
408 V{1.0 / 3.0, 0.0, 2.0 / 3.0},
409 V{0.0, 1.0 / 3.0, 2.0 / 3.0},
410 V{1.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
411 V{0.0, 0.0, 1.0},
412 V{1.0 / 3.0, 0.0, 1.0},
413 V{0.0, 1.0 / 3.0, 1.0},
414 V{1.0 / 3.0, 1.0 / 3.0, 1.0})
415 .add_entity(
416 V{1.0 / 3.0, 0.0, 2.0 / 3.0},
417 V{2.0 / 3.0, 0.0, 2.0 / 3.0},
418 V{1.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
419 V{2.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
420 V{1.0 / 3.0, 0.0, 1.0},
421 V{2.0 / 3.0, 0.0, 1.0},
422 V{1.0 / 3.0, 1.0 / 3.0, 1.0},
423 V{2.0 / 3.0, 1.0 / 3.0, 1.0})
424 .add_entity(
425 V{2.0 / 3.0, 0.0, 2.0 / 3.0},
426 V{1.0, 0.0, 2.0 / 3.0},
427 V{2.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
428 V{1.0, 1.0 / 3.0, 2.0 / 3.0},
429 V{2.0 / 3.0, 0.0, 1.0},
430 V{1.0, 0.0, 1.0},
431 V{2.0 / 3.0, 1.0 / 3.0, 1.0},
432 V{1.0, 1.0 / 3.0, 1.0})
433 .add_entity(
434 V{0.0, 1.0 / 3.0, 2.0 / 3.0},
435 V{1.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
436 V{0.0, 2.0 / 3.0, 2.0 / 3.0},
437 V{1.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0},
438 V{0.0, 1.0 / 3.0, 1.0},
439 V{1.0 / 3.0, 1.0 / 3.0, 1.0},
440 V{0.0, 2.0 / 3.0, 1.0},
441 V{1.0 / 3.0, 2.0 / 3.0, 1.0})
442 .add_entity(
443 V{1.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
444 V{2.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
445 V{1.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0},
446 V{2.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0},
447 V{1.0 / 3.0, 1.0 / 3.0, 1.0},
448 V{2.0 / 3.0, 1.0 / 3.0, 1.0},
449 V{1.0 / 3.0, 2.0 / 3.0, 1.0},
450 V{2.0 / 3.0, 2.0 / 3.0, 1.0})
451 .add_entity(
452 V{2.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
453 V{1.0, 1.0 / 3.0, 2.0 / 3.0},
454 V{2.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0},
455 V{1.0, 2.0 / 3.0, 2.0 / 3.0},
456 V{2.0 / 3.0, 1.0 / 3.0, 1.0},
457 V{1.0, 1.0 / 3.0, 1.0},
458 V{2.0 / 3.0, 2.0 / 3.0, 1.0},
459 V{1.0, 2.0 / 3.0, 1.0})
460 .add_entity(
461 V{0.0, 2.0 / 3.0, 2.0 / 3.0},
462 V{1.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0},
463 V{0.0, 1.0, 2.0 / 3.0},
464 V{1.0 / 3.0, 1.0, 2.0 / 3.0},
465 V{0.0, 2.0 / 3.0, 1.0},
466 V{1.0 / 3.0, 2.0 / 3.0, 1.0},
467 V{0.0, 1.0, 1.0},
468 V{1.0 / 3.0, 1.0, 1.0})
469 .add_entity(
470 V{1.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0},
471 V{2.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0},
472 V{1.0 / 3.0, 1.0, 2.0 / 3.0},
473 V{2.0 / 3.0, 1.0, 2.0 / 3.0},
474 V{1.0 / 3.0, 2.0 / 3.0, 1.0},
475 V{2.0 / 3.0, 2.0 / 3.0, 1.0},
476 V{1.0 / 3.0, 1.0, 1.0},
477 V{2.0 / 3.0, 1.0, 1.0})
478 .add_entity(
479 V{2.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0},
480 V{1.0, 2.0 / 3.0, 2.0 / 3.0},
481 V{2.0 / 3.0, 1.0, 2.0 / 3.0},
482 V{1.0, 1.0, 2.0 / 3.0},
483 V{2.0 / 3.0, 2.0 / 3.0, 1.0},
484 V{1.0, 2.0 / 3.0, 1.0},
485 V{2.0 / 3.0, 1.0, 1.0},
486 V{1.0, 1.0, 1.0})
487 .add_entity(
488 V{0.0, 0.0, 0.0},
489 V{1.0 / 3.0, 0.0, 1.0 / 3.0},
490 V{0.0, 1.0 / 3.0, 1.0 / 3.0},
491 V{1.0 / 3.0, 1.0 / 3.0, 1.0 / 2.0},
492 V{0.0, 0.0, 2.0 / 3.0},
493 V{1.0 / 3.0, 0.0, 2.0 / 3.0},
494 V{0.0, 1.0 / 3.0, 2.0 / 3.0},
495 V{1.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0})
496 .add_entity(
497 V{1.0 / 3.0, 0.0, 1.0 / 3.0},
498 V{2.0 / 3.0, 0.0, 1.0 / 3.0},
499 V{1.0 / 3.0, 1.0 / 3.0, 1.0 / 2.0},
500 V{2.0 / 3.0, 1.0 / 3.0, 1.0 / 2.0},
501 V{1.0 / 3.0, 0.0, 2.0 / 3.0},
502 V{2.0 / 3.0, 0.0, 2.0 / 3.0},
503 V{1.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
504 V{2.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0})
505 .add_entity(
506 V{2.0 / 3.0, 0.0, 1.0 / 3.0},
507 V{1.0, 0.0, 0.0},
508 V{2.0 / 3.0, 1.0 / 3.0, 1.0 / 2.0},
509 V{1.0, 1.0 / 3.0, 1.0 / 3.0},
510 V{2.0 / 3.0, 0.0, 2.0 / 3.0},
511 V{1.0, 0.0, 2.0 / 3.0},
512 V{2.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
513 V{1.0, 1.0 / 3.0, 2.0 / 3.0})
514 .add_entity(
515 V{2.0 / 3.0, 1.0 / 3.0, 1.0 / 2.0},
516 V{1.0, 1.0 / 3.0, 1.0 / 3.0},
517 V{2.0 / 3.0, 2.0 / 3.0, 1.0 / 2.0},
518 V{1.0, 2.0 / 3.0, 1.0 / 3.0},
519 V{2.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
520 V{1.0, 1.0 / 3.0, 2.0 / 3.0},
521 V{2.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0},
522 V{1.0, 2.0 / 3.0, 2.0 / 3.0})
523 .add_entity(
524 V{2.0 / 3.0, 2.0 / 3.0, 1.0 / 2.0},
525 V{1.0, 2.0 / 3.0, 1.0 / 3.0},
526 V{2.0 / 3.0, 1.0, 1.0 / 3.0},
527 V{1.0, 1.0, 0.0},
528 V{2.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0},
529 V{1.0, 2.0 / 3.0, 2.0 / 3.0},
530 V{2.0 / 3.0, 1.0, 2.0 / 3.0},
531 V{1.0, 1.0, 2.0 / 3.0})
532 .add_entity(
533 V{1.0 / 3.0, 2.0 / 3.0, 1.0 / 2.0},
534 V{2.0 / 3.0, 2.0 / 3.0, 1.0 / 2.0},
535 V{1.0 / 3.0, 1.0, 1.0 / 3.0},
536 V{2.0 / 3.0, 1.0, 1.0 / 3.0},
537 V{1.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0},
538 V{2.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0},
539 V{1.0 / 3.0, 1.0, 2.0 / 3.0},
540 V{2.0 / 3.0, 1.0, 2.0 / 3.0})
541 .add_entity(
542 V{0.0, 2.0 / 3.0, 1.0 / 3.0},
543 V{1.0 / 3.0, 2.0 / 3.0, 1.0 / 2.0},
544 V{0.0, 1.0, 0.0},
545 V{1.0 / 3.0, 1.0, 1.0 / 3.0},
546 V{0.0, 2.0 / 3.0, 2.0 / 3.0},
547 V{1.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0},
548 V{0.0, 1.0, 2.0 / 3.0},
549 V{1.0 / 3.0, 1.0, 2.0 / 3.0})
550 .add_entity(
551 V{0.0, 1.0 / 3.0, 1.0 / 3.0},
552 V{1.0 / 3.0, 1.0 / 3.0, 1.0 / 2.0},
553 V{0.0, 2.0 / 3.0, 1.0 / 3.0},
554 V{1.0 / 3.0, 2.0 / 3.0, 1.0 / 2.0},
555 V{0.0, 1.0 / 3.0, 2.0 / 3.0},
556 V{1.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0},
557 V{0.0, 2.0 / 3.0, 2.0 / 3.0},
558 V{1.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0})
559 .add_entity(
560 V{0.0, 0.0, 0.0},
561 V{1.0, 0.0, 0.0},
562 V{0.0, 1.0, 0.0},
563 V{1.0, 1.0, 0.0},
564 V{1.0 / 3.0, 0.0, 1.0 / 3.0},
565 V{2.0 / 3.0, 0.0, 1.0 / 3.0},
566 V{1.0 / 3.0, 1.0, 1.0 / 3.0},
567 V{2.0 / 3.0, 1.0, 1.0 / 3.0})
568 .add_entity(
569 V{0.0, 0.0, 0.0},
570 V{1.0 / 3.0, 0.0, 1.0 / 3.0},
571 V{0.0, 1.0, 0.0},
572 V{1.0 / 3.0, 1.0, 1.0 / 3.0},
573 V{0.0, 1.0 / 3.0, 1.0 / 3.0},
574 V{1.0 / 3.0, 1.0 / 3.0, 1.0 / 2.0},
575 V{0.0, 2.0 / 3.0, 1.0 / 3.0},
576 V{1.0 / 3.0, 2.0 / 3.0, 1.0 / 2.0})
577 .add_entity(
578 V{2.0 / 3.0, 0.0, 1.0 / 3.0},
579 V{1.0, 0.0, 0.0},
580 V{2.0 / 3.0, 1.0, 1.0 / 3.0},
581 V{1.0, 1.0, 0.0},
582 V{2.0 / 3.0, 1.0 / 3.0, 1.0 / 2.0},
583 V{1.0, 1.0 / 3.0, 1.0 / 3.0},
584 V{2.0 / 3.0, 2.0 / 3.0, 1.0 / 2.0},
585 V{1.0, 2.0 / 3.0, 1.0 / 3.0})
586 .add_entity(
587 V{1.0 / 3.0, 0.0, 1.0 / 3.0},
588 V{2.0 / 3.0, 0.0, 1.0 / 3.0},
589 V{1.0 / 3.0, 1.0, 1.0 / 3.0},
590 V{2.0 / 3.0, 1.0, 1.0 / 3.0},
591 V{1.0 / 3.0, 1.0 / 3.0, 1.0 / 2.0},
592 V{2.0 / 3.0, 1.0 / 3.0, 1.0 / 2.0},
593 V{1.0 / 3.0, 2.0 / 3.0, 1.0 / 2.0},
594 V{2.0 / 3.0, 2.0 / 3.0, 1.0 / 2.0})});
595
596 // Cell refinement
597 result.insert(
598 {RefinementTypeByDim<3>(0b11111111), RawCellTemplate().grid({3, 3, 3}, V{1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0})});
599
603
608
616 auto tmp = rotate_template_zaxis(result[RefinementTypeByDim<3>(48)]);
621
627 }
628
629 return result;
630 }
631 };
632} // namespace FEAT::Geometry
#define XABORTM(msg)
Abortion macro definition with custom message.
Definition: assertion.hpp:192
static FaceMap & raw_faces()
Returns the raw templates for faces of this template set.
RawTemplate< Shape::Hypercube< 2 > > RawFaceTemplate
Raw face template type.
RawTemplate< Shape::Hypercube< 1 > > RawEdgeTemplate
Raw edge template type.
static constexpr bool is_shape_compatible()
Shape compatability test.
TemplateMapByDim< 2 > FaceMap
Type of map from face refinement types to raw templates.
std::unordered_map< RefinementTypeByDim< dim_ >, RawTemplate< Shape::Hypercube< dim_ > > > TemplateMapByDim
Type of map from refinement type to raw templates.
RawTemplate< Shape::Hypercube< 3 > > RawCellTemplate
Raw cell template type.
TemplateMapByDim< 3 > CellMap
Type of map from cell refinement types to raw templates.
static constexpr int max_children()
Constexpr function for retrieving maximum number of children for any template of this template set.
static CellMap & raw_cells()
Returns the raw templates for cells of this template set.
static EdgeMap & raw_edges()
Returns the raw templates for edges of this template set.
static TemplateMapByDim< dim_ > & raw_templates()
Accessor for raw template maps.
TemplateMapByDim< 1 > EdgeMap
Type of map from edge refinement types to raw templates.
Geometry namespace.
static RawTemplate< Shape_ > rotate_template_yaxis(RawTemplate< Shape_ > &tmplt)
Rotates a raw template 90 degrees counterclockwise around the y-axis.
static RawTemplate< Shape_ > rotate_template_zaxis(RawTemplate< Shape_ > &tmplt)
Rotates a raw template 90 degrees counterclockwise around the z-axis.
static RawTemplate< Shape_ > rotate_template_2d(RawTemplate< Shape_ > &tmplt)
Rotates a raw template 90 degrees counterclockwise around (0.5, 0.5)
static RawTemplate< Shape_ > rotate_template_xaxis(RawTemplate< Shape_ > &tmplt)
Rotates a raw template 90 degrees counterclockwise around the x-axis.
String stringify(const T_ &item)
Converts an item into a String.
Definition: string.hpp:944
Hypercube shape tag struct template.
Definition: shape.hpp:64