b2api
B2000++ API Reference Manual, VERSION 4.6
 
Loading...
Searching...
No Matches
b2element_klt_compute_shape_q_impl.H
1//------------------------------------------------------------------------
2// b2element_klt_compute_shape_q_impl.H --
3//
4// !! GENERATED with b2element_klt_compute_shape_q.py !!
5//
6// Compute the shape functions of Bezier quadrilaterals.
7//
8// written by Thomas Ludwig
9// Harald Klimach <harald.klimach@dlr.de>
10// Neda Ebrahimi Pour <neda.ebrahimipour@dlr.de>
11//
12// (c) 2015-2016 SMR Engineering & Development SA
13// 2502 Bienne, Switzerland
14//
15// (c) 2023 Deutsches Zentrum für Luft- und Raumfahrt (DLR) e.V.
16// Linder Höhe, 51147 Köln
17//
18// All Rights Reserved. Proprietary source code. The contents of
19// this file may not be disclosed to third parties, copied or
20// duplicated in any form, in whole or in part, without the prior
21// written permission of SMR.
22//------------------------------------------------------------------------
23
24#ifndef B2ELEMENT_KLT_COMPUTE_SHAPE_Q_IMPL_H_
25#define B2ELEMENT_KLT_COMPUTE_SHAPE_Q_IMPL_H_
26
27#include <cassert>
28#include <cmath>
29
30#include "b2element_klt_compute_shape_q.H"
31#include "utils/b2linear_algebra.H"
33
34namespace b2000::klt {
35
36struct Q2X2Data {
37 static constexpr int node_indices_edge_c1_r[2][6] = {
38 {0, 4, 1, 5, 6, 7},
39 {2, 8, 3, 7, 6, 5},
40 };
41 static constexpr int node_indices_edge_c1_s[2][6] = {
42 {1, 7, 2, 4, 6, 8},
43 {3, 5, 0, 8, 6, 4},
44 };
45 static constexpr int node_indices_edge_c2_r[2][9] = {
46 {0, 4, 1, 5, 6, 7, 3, 8, 2},
47 {2, 8, 3, 7, 6, 5, 1, 4, 0},
48 };
49 static constexpr int node_indices_edge_c2_s[2][9] = {
50 {1, 7, 2, 4, 6, 8, 0, 5, 3},
51 {3, 5, 0, 8, 6, 4, 2, 7, 1},
52 };
53 static constexpr int node_indices_vertex_coupling[4][4] = {
54 {0, 4, 5, 6},
55 {1, 7, 4, 6},
56 {2, 8, 7, 6},
57 {3, 5, 8, 6},
58 };
59 static constexpr int node_indices_vertex_c2[4][6] = {
60 {0, 4, 5, 6, 1, 3},
61 {1, 7, 4, 6, 2, 0},
62 {2, 8, 7, 6, 3, 1},
63 {3, 5, 8, 6, 0, 2},
64 };
65};
66
67class Q2X2 : public QuadBezier<2, 2, Q2X2Data> {
68public:
69 void compute_polynomial_basis_functions_internal(
70 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
71 static const char name[];
72};
73
74struct Q3X3Data {
75 static constexpr int node_indices_edge_c1_r[2][8] = {
76 {0, 4, 5, 1, 6, 7, 8, 9},
77 {2, 15, 14, 3, 13, 12, 11, 10},
78 };
79 static constexpr int node_indices_edge_c1_s[2][8] = {
80 {1, 9, 13, 2, 5, 8, 12, 15},
81 {3, 10, 6, 0, 14, 11, 7, 4},
82 };
83 static constexpr int node_indices_edge_c2_r[2][12] = {
84 {0, 4, 5, 1, 6, 7, 8, 9, 10, 11, 12, 13},
85 {2, 15, 14, 3, 13, 12, 11, 10, 9, 8, 7, 6},
86 };
87 static constexpr int node_indices_edge_c2_s[2][12] = {
88 {1, 9, 13, 2, 5, 8, 12, 15, 4, 7, 11, 14},
89 {3, 10, 6, 0, 14, 11, 7, 4, 15, 12, 8, 5},
90 };
91 static constexpr int node_indices_vertex_coupling[4][4] = {
92 {0, 4, 6, 7},
93 {1, 9, 5, 8},
94 {2, 15, 13, 12},
95 {3, 10, 14, 11},
96 };
97 static constexpr int node_indices_vertex_c2[4][6] = {
98 {0, 4, 6, 7, 5, 10},
99 {1, 9, 5, 8, 13, 4},
100 {2, 15, 13, 12, 14, 9},
101 {3, 10, 14, 11, 6, 15},
102 };
103};
104
105class Q3X3 : public QuadBezier<3, 3, Q3X3Data> {
106public:
107 void compute_polynomial_basis_functions_internal(
108 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
109 static const char name[];
110};
111
112struct Q4X4Data {
113 static constexpr int node_indices_edge_c1_r[2][10] = {
114 {0, 4, 5, 6, 1, 7, 8, 9, 10, 11},
115 {2, 24, 23, 22, 3, 21, 20, 19, 18, 17},
116 };
117 static constexpr int node_indices_edge_c1_s[2][10] = {
118 {1, 11, 16, 21, 2, 6, 10, 15, 20, 24},
119 {3, 17, 12, 7, 0, 22, 18, 13, 8, 4},
120 };
121 static constexpr int node_indices_edge_c2_r[2][15] = {
122 {0, 4, 5, 6, 1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16},
123 {2, 24, 23, 22, 3, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12},
124 };
125 static constexpr int node_indices_edge_c2_s[2][15] = {
126 {1, 11, 16, 21, 2, 6, 10, 15, 20, 24, 5, 9, 14, 19, 23},
127 {3, 17, 12, 7, 0, 22, 18, 13, 8, 4, 23, 19, 14, 9, 5},
128 };
129 static constexpr int node_indices_midedge_coupling_r[2][2] = {
130 {5, 9},
131 {23, 19},
132 };
133 static constexpr int node_indices_midedge_coupling_s[2][2] = {
134 {16, 15},
135 {12, 13},
136 };
137 static constexpr int node_indices_vertex_coupling[4][4] = {
138 {0, 4, 7, 8},
139 {1, 11, 6, 10},
140 {2, 24, 21, 20},
141 {3, 17, 22, 18},
142 };
143 static constexpr int node_indices_vertex_c2[4][6] = {
144 {0, 4, 7, 8, 5, 12},
145 {1, 11, 6, 10, 16, 5},
146 {2, 24, 21, 20, 23, 16},
147 {3, 17, 22, 18, 12, 23},
148 };
149};
150
151class Q4X4 : public QuadBezier<4, 4, Q4X4Data> {
152public:
153 void compute_polynomial_basis_functions_internal(
154 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
155 static const char name[];
156};
157
158struct Q4X3Data {
159 static constexpr int node_indices_edge_c1_r[2][10] = {
160 {0, 4, 5, 6, 1, 7, 8, 9, 10, 11},
161 {2, 19, 18, 17, 3, 16, 15, 14, 13, 12},
162 };
163 static constexpr int node_indices_edge_c1_s[2][8] = {
164 {1, 11, 16, 2, 6, 10, 15, 19},
165 {3, 12, 7, 0, 17, 13, 8, 4},
166 };
167 static constexpr int node_indices_edge_c2_r[2][15] = {
168 {0, 4, 5, 6, 1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16},
169 {2, 19, 18, 17, 3, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7},
170 };
171 static constexpr int node_indices_edge_c2_s[2][12] = {
172 {1, 11, 16, 2, 6, 10, 15, 19, 5, 9, 14, 18},
173 {3, 12, 7, 0, 17, 13, 8, 4, 18, 14, 9, 5},
174 };
175 static constexpr int node_indices_midedge_coupling_r[2][2] = {
176 {5, 9},
177 {18, 14},
178 };
179 static constexpr int node_indices_vertex_coupling[4][4] = {
180 {0, 4, 7, 8},
181 {1, 11, 6, 10},
182 {2, 19, 16, 15},
183 {3, 12, 17, 13},
184 };
185 static constexpr int node_indices_vertex_c2[4][6] = {
186 {0, 4, 7, 8, 5, 12},
187 {1, 11, 6, 10, 16, 5},
188 {2, 19, 16, 15, 18, 11},
189 {3, 12, 17, 13, 7, 18},
190 };
191};
192
193class Q4X3 : public QuadBezier<4, 3, Q4X3Data> {
194public:
195 void compute_polynomial_basis_functions_internal(
196 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
197 static const char name[];
198};
199
200struct Q5X2Data {
201 static constexpr int node_indices_edge_c1_r[2][12] = {
202 {0, 4, 5, 6, 7, 1, 8, 9, 10, 11, 12, 13},
203 {2, 17, 16, 15, 14, 3, 13, 12, 11, 10, 9, 8},
204 };
205 static constexpr int node_indices_edge_c1_s[2][6] = {
206 {1, 13, 2, 7, 12, 17},
207 {3, 8, 0, 14, 9, 4},
208 };
209 static constexpr int node_indices_edge_c2_r[2][18] = {
210 {0, 4, 5, 6, 7, 1, 8, 9, 10, 11, 12, 13, 3, 14, 15, 16, 17, 2},
211 {2, 17, 16, 15, 14, 3, 13, 12, 11, 10, 9, 8, 1, 7, 6, 5, 4, 0},
212 };
213 static constexpr int node_indices_edge_c2_s[2][9] = {
214 {1, 13, 2, 7, 12, 17, 6, 11, 16},
215 {3, 8, 0, 14, 9, 4, 15, 10, 5},
216 };
217 static constexpr int node_indices_midedge_coupling_r[2][4] = {
218 {5, 6, 10, 11},
219 {16, 15, 11, 10},
220 };
221 static constexpr int node_indices_vertex_coupling[4][4] = {
222 {0, 4, 8, 9},
223 {1, 13, 7, 12},
224 {2, 17, 13, 12},
225 {3, 8, 14, 9},
226 };
227 static constexpr int node_indices_vertex_c2[4][6] = {
228 {0, 4, 8, 9, 5, 3},
229 {1, 13, 7, 12, 2, 6},
230 {2, 17, 13, 12, 16, 1},
231 {3, 8, 14, 9, 0, 15},
232 };
233};
234
235class Q5X2 : public QuadBezier<5, 2, Q5X2Data> {
236public:
237 void compute_polynomial_basis_functions_internal(
238 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
239 static const char name[];
240};
241
242struct Q5X3Data {
243 static constexpr int node_indices_edge_c1_r[2][12] = {
244 {0, 4, 5, 6, 7, 1, 8, 9, 10, 11, 12, 13},
245 {2, 23, 22, 21, 20, 3, 19, 18, 17, 16, 15, 14},
246 };
247 static constexpr int node_indices_edge_c1_s[2][8] = {
248 {1, 13, 19, 2, 7, 12, 18, 23},
249 {3, 14, 8, 0, 20, 15, 9, 4},
250 };
251 static constexpr int node_indices_edge_c2_r[2][18] = {
252 {0, 4, 5, 6, 7, 1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19},
253 {2, 23, 22, 21, 20, 3, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8},
254 };
255 static constexpr int node_indices_edge_c2_s[2][12] = {
256 {1, 13, 19, 2, 7, 12, 18, 23, 6, 11, 17, 22},
257 {3, 14, 8, 0, 20, 15, 9, 4, 21, 16, 10, 5},
258 };
259 static constexpr int node_indices_midedge_coupling_r[2][4] = {
260 {5, 6, 10, 11},
261 {22, 21, 17, 16},
262 };
263 static constexpr int node_indices_vertex_coupling[4][4] = {
264 {0, 4, 8, 9},
265 {1, 13, 7, 12},
266 {2, 23, 19, 18},
267 {3, 14, 20, 15},
268 };
269 static constexpr int node_indices_vertex_c2[4][6] = {
270 {0, 4, 8, 9, 5, 14},
271 {1, 13, 7, 12, 19, 6},
272 {2, 23, 19, 18, 22, 13},
273 {3, 14, 20, 15, 8, 21},
274 };
275};
276
277class Q5X3 : public QuadBezier<5, 3, Q5X3Data> {
278public:
279 void compute_polynomial_basis_functions_internal(
280 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
281 static const char name[];
282};
283
284struct Q5X5Data {
285 static constexpr int node_indices_edge_c1_r[2][12] = {
286 {0, 4, 5, 6, 7, 1, 8, 9, 10, 11, 12, 13},
287 {2, 35, 34, 33, 32, 3, 31, 30, 29, 28, 27, 26},
288 };
289 static constexpr int node_indices_edge_c1_s[2][12] = {
290 {1, 13, 19, 25, 31, 2, 7, 12, 18, 24, 30, 35},
291 {3, 26, 20, 14, 8, 0, 32, 27, 21, 15, 9, 4},
292 };
293 static constexpr int node_indices_edge_c2_r[2][18] = {
294 {0, 4, 5, 6, 7, 1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19},
295 {2, 35, 34, 33, 32, 3, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20},
296 };
297 static constexpr int node_indices_edge_c2_s[2][18] = {
298 {1, 13, 19, 25, 31, 2, 7, 12, 18, 24, 30, 35, 6, 11, 17, 23, 29, 34},
299 {3, 26, 20, 14, 8, 0, 32, 27, 21, 15, 9, 4, 33, 28, 22, 16, 10, 5},
300 };
301 static constexpr int node_indices_midedge_coupling_r[2][4] = {
302 {5, 6, 10, 11},
303 {34, 33, 29, 28},
304 };
305 static constexpr int node_indices_midedge_coupling_s[2][4] = {
306 {19, 25, 18, 24},
307 {20, 14, 21, 15},
308 };
309 static constexpr int node_indices_vertex_coupling[4][4] = {
310 {0, 4, 8, 9},
311 {1, 13, 7, 12},
312 {2, 35, 31, 30},
313 {3, 26, 32, 27},
314 };
315 static constexpr int node_indices_vertex_c2[4][6] = {
316 {0, 4, 8, 9, 5, 14},
317 {1, 13, 7, 12, 19, 6},
318 {2, 35, 31, 30, 34, 25},
319 {3, 26, 32, 27, 20, 33},
320 };
321};
322
323class Q5X5 : public QuadBezier<5, 5, Q5X5Data> {
324public:
325 void compute_polynomial_basis_functions_internal(
326 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
327 static const char name[];
328};
329
330struct Q6X6Data {
331 static constexpr int node_indices_edge_c1_r[2][14] = {
332 {0, 4, 5, 6, 7, 8, 1, 9, 10, 11, 12, 13, 14, 15},
333 {2, 48, 47, 46, 45, 44, 3, 43, 42, 41, 40, 39, 38, 37},
334 };
335 static constexpr int node_indices_edge_c1_s[2][14] = {
336 {1, 15, 22, 29, 36, 43, 2, 8, 14, 21, 28, 35, 42, 48},
337 {3, 37, 30, 23, 16, 9, 0, 44, 38, 31, 24, 17, 10, 4},
338 };
339 static constexpr int node_indices_edge_c2_r[2][21] = {
340 {0, 4, 5, 6, 7, 8, 1, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22},
341 {2, 48, 47, 46, 45, 44, 3, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30},
342 };
343 static constexpr int node_indices_edge_c2_s[2][21] = {
344 {1, 15, 22, 29, 36, 43, 2, 8, 14, 21, 28, 35, 42, 48, 7, 13, 20, 27, 34, 41, 47},
345 {3, 37, 30, 23, 16, 9, 0, 44, 38, 31, 24, 17, 10, 4, 45, 39, 32, 25, 18, 11, 5},
346 };
347 static constexpr int node_indices_midedge_coupling_r[2][6] = {
348 {5, 6, 7, 11, 12, 13},
349 {47, 46, 45, 41, 40, 39},
350 };
351 static constexpr int node_indices_midedge_coupling_s[2][6] = {
352 {22, 29, 36, 21, 28, 35},
353 {30, 23, 16, 31, 24, 17},
354 };
355 static constexpr int node_indices_vertex_coupling[4][4] = {
356 {0, 4, 9, 10},
357 {1, 15, 8, 14},
358 {2, 48, 43, 42},
359 {3, 37, 44, 38},
360 };
361 static constexpr int node_indices_vertex_c2[4][6] = {
362 {0, 4, 9, 10, 5, 16},
363 {1, 15, 8, 14, 22, 7},
364 {2, 48, 43, 42, 47, 36},
365 {3, 37, 44, 38, 30, 45},
366 };
367};
368
369class Q6X6 : public QuadBezier<6, 6, Q6X6Data> {
370public:
371 void compute_polynomial_basis_functions_internal(
372 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
373 static const char name[];
374};
375
376struct Q6X3Data {
377 static constexpr int node_indices_edge_c1_r[2][14] = {
378 {0, 4, 5, 6, 7, 8, 1, 9, 10, 11, 12, 13, 14, 15},
379 {2, 27, 26, 25, 24, 23, 3, 22, 21, 20, 19, 18, 17, 16},
380 };
381 static constexpr int node_indices_edge_c1_s[2][8] = {
382 {1, 15, 22, 2, 8, 14, 21, 27},
383 {3, 16, 9, 0, 23, 17, 10, 4},
384 };
385 static constexpr int node_indices_edge_c2_r[2][21] = {
386 {0, 4, 5, 6, 7, 8, 1, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22},
387 {2, 27, 26, 25, 24, 23, 3, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9},
388 };
389 static constexpr int node_indices_edge_c2_s[2][12] = {
390 {1, 15, 22, 2, 8, 14, 21, 27, 7, 13, 20, 26},
391 {3, 16, 9, 0, 23, 17, 10, 4, 24, 18, 11, 5},
392 };
393 static constexpr int node_indices_midedge_coupling_r[2][6] = {
394 {5, 6, 7, 11, 12, 13},
395 {26, 25, 24, 20, 19, 18},
396 };
397 static constexpr int node_indices_vertex_coupling[4][4] = {
398 {0, 4, 9, 10},
399 {1, 15, 8, 14},
400 {2, 27, 22, 21},
401 {3, 16, 23, 17},
402 };
403 static constexpr int node_indices_vertex_c2[4][6] = {
404 {0, 4, 9, 10, 5, 16},
405 {1, 15, 8, 14, 22, 7},
406 {2, 27, 22, 21, 26, 15},
407 {3, 16, 23, 17, 9, 24},
408 };
409};
410
411class Q6X3 : public QuadBezier<6, 3, Q6X3Data> {
412public:
413 void compute_polynomial_basis_functions_internal(
414 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
415 static const char name[];
416};
417
418struct Q7X7Data {
419 static constexpr int node_indices_edge_c1_r[2][16] = {
420 {0, 4, 5, 6, 7, 8, 9, 1, 10, 11, 12, 13, 14, 15, 16, 17},
421 {2, 63, 62, 61, 60, 59, 58, 3, 57, 56, 55, 54, 53, 52, 51, 50},
422 };
423 static constexpr int node_indices_edge_c1_s[2][16] = {
424 {1, 17, 25, 33, 41, 49, 57, 2, 9, 16, 24, 32, 40, 48, 56, 63},
425 {3, 50, 42, 34, 26, 18, 10, 0, 58, 51, 43, 35, 27, 19, 11, 4},
426 };
427 static constexpr int node_indices_edge_c2_r[2][24] = {
428 {0, 4, 5, 6, 7, 8, 9, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25},
429 {2, 63, 62, 61, 60, 59, 58, 3, 57, 56, 55, 54,
430 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42},
431 };
432 static constexpr int node_indices_edge_c2_s[2][24] = {
433 {1, 17, 25, 33, 41, 49, 57, 2, 9, 16, 24, 32,
434 40, 48, 56, 63, 8, 15, 23, 31, 39, 47, 55, 62},
435 {3, 50, 42, 34, 26, 18, 10, 0, 58, 51, 43, 35,
436 27, 19, 11, 4, 59, 52, 44, 36, 28, 20, 12, 5},
437 };
438 static constexpr int node_indices_midedge_coupling_r[2][8] = {
439 {5, 6, 7, 8, 12, 13, 14, 15},
440 {62, 61, 60, 59, 55, 54, 53, 52},
441 };
442 static constexpr int node_indices_midedge_coupling_s[2][8] = {
443 {25, 33, 41, 49, 24, 32, 40, 48},
444 {42, 34, 26, 18, 43, 35, 27, 19},
445 };
446 static constexpr int node_indices_vertex_coupling[4][4] = {
447 {0, 4, 10, 11},
448 {1, 17, 9, 16},
449 {2, 63, 57, 56},
450 {3, 50, 58, 51},
451 };
452 static constexpr int node_indices_vertex_c2[4][6] = {
453 {0, 4, 10, 11, 5, 18},
454 {1, 17, 9, 16, 25, 8},
455 {2, 63, 57, 56, 62, 49},
456 {3, 50, 58, 51, 42, 59},
457 };
458};
459
460class Q7X7 : public QuadBezier<7, 7, Q7X7Data> {
461public:
462 void compute_polynomial_basis_functions_internal(
463 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
464 static const char name[];
465};
466
467struct Q8X8Data {
468 static constexpr int node_indices_edge_c1_r[2][18] = {
469 {0, 4, 5, 6, 7, 8, 9, 10, 1, 11, 12, 13, 14, 15, 16, 17, 18, 19},
470 {2, 80, 79, 78, 77, 76, 75, 74, 3, 73, 72, 71, 70, 69, 68, 67, 66, 65},
471 };
472 static constexpr int node_indices_edge_c1_s[2][18] = {
473 {1, 19, 28, 37, 46, 55, 64, 73, 2, 10, 18, 27, 36, 45, 54, 63, 72, 80},
474 {3, 65, 56, 47, 38, 29, 20, 11, 0, 74, 66, 57, 48, 39, 30, 21, 12, 4},
475 };
476 static constexpr int node_indices_edge_c2_r[2][27] = {
477 {0, 4, 5, 6, 7, 8, 9, 10, 1, 11, 12, 13, 14, 15,
478 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28},
479 {2, 80, 79, 78, 77, 76, 75, 74, 3, 73, 72, 71, 70, 69,
480 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56},
481 };
482 static constexpr int node_indices_edge_c2_s[2][27] = {
483 {1, 19, 28, 37, 46, 55, 64, 73, 2, 10, 18, 27, 36, 45,
484 54, 63, 72, 80, 9, 17, 26, 35, 44, 53, 62, 71, 79},
485 {3, 65, 56, 47, 38, 29, 20, 11, 0, 74, 66, 57, 48, 39,
486 30, 21, 12, 4, 75, 67, 58, 49, 40, 31, 22, 13, 5},
487 };
488 static constexpr int node_indices_midedge_coupling_r[2][10] = {
489 {5, 6, 7, 8, 9, 13, 14, 15, 16, 17},
490 {79, 78, 77, 76, 75, 71, 70, 69, 68, 67},
491 };
492 static constexpr int node_indices_midedge_coupling_s[2][10] = {
493 {28, 37, 46, 55, 64, 27, 36, 45, 54, 63},
494 {56, 47, 38, 29, 20, 57, 48, 39, 30, 21},
495 };
496 static constexpr int node_indices_vertex_coupling[4][4] = {
497 {0, 4, 11, 12},
498 {1, 19, 10, 18},
499 {2, 80, 73, 72},
500 {3, 65, 74, 66},
501 };
502 static constexpr int node_indices_vertex_c2[4][6] = {
503 {0, 4, 11, 12, 5, 20},
504 {1, 19, 10, 18, 28, 9},
505 {2, 80, 73, 72, 79, 64},
506 {3, 65, 74, 66, 56, 75},
507 };
508};
509
510class Q8X8 : public QuadBezier<8, 8, Q8X8Data> {
511public:
512 void compute_polynomial_basis_functions_internal(
513 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
514 static const char name[];
515};
516
517struct Q9X2Data {
518 static constexpr int node_indices_edge_c1_r[2][20] = {
519 {0, 4, 5, 6, 7, 8, 9, 10, 11, 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21},
520 {2, 29, 28, 27, 26, 25, 24, 23, 22, 3, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12},
521 };
522 static constexpr int node_indices_edge_c1_s[2][6] = {
523 {1, 21, 2, 11, 20, 29},
524 {3, 12, 0, 22, 13, 4},
525 };
526 static constexpr int node_indices_edge_c2_r[2][30] = {
527 {0, 4, 5, 6, 7, 8, 9, 10, 11, 1, 12, 13, 14, 15, 16,
528 17, 18, 19, 20, 21, 3, 22, 23, 24, 25, 26, 27, 28, 29, 2},
529 {2, 29, 28, 27, 26, 25, 24, 23, 22, 3, 21, 20, 19, 18, 17,
530 16, 15, 14, 13, 12, 1, 11, 10, 9, 8, 7, 6, 5, 4, 0},
531 };
532 static constexpr int node_indices_edge_c2_s[2][9] = {
533 {1, 21, 2, 11, 20, 29, 10, 19, 28},
534 {3, 12, 0, 22, 13, 4, 23, 14, 5},
535 };
536 static constexpr int node_indices_midedge_coupling_r[2][12] = {
537 {5, 6, 7, 8, 9, 10, 14, 15, 16, 17, 18, 19},
538 {28, 27, 26, 25, 24, 23, 19, 18, 17, 16, 15, 14},
539 };
540 static constexpr int node_indices_vertex_coupling[4][4] = {
541 {0, 4, 12, 13},
542 {1, 21, 11, 20},
543 {2, 29, 21, 20},
544 {3, 12, 22, 13},
545 };
546 static constexpr int node_indices_vertex_c2[4][6] = {
547 {0, 4, 12, 13, 5, 3},
548 {1, 21, 11, 20, 2, 10},
549 {2, 29, 21, 20, 28, 1},
550 {3, 12, 22, 13, 0, 23},
551 };
552};
553
554class Q9X2 : public QuadBezier<9, 2, Q9X2Data> {
555public:
556 void compute_polynomial_basis_functions_internal(
557 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
558 static const char name[];
559};
560
561struct Q9X3Data {
562 static constexpr int node_indices_edge_c1_r[2][20] = {
563 {0, 4, 5, 6, 7, 8, 9, 10, 11, 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21},
564 {2, 39, 38, 37, 36, 35, 34, 33, 32, 3, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22},
565 };
566 static constexpr int node_indices_edge_c1_s[2][8] = {
567 {1, 21, 31, 2, 11, 20, 30, 39},
568 {3, 22, 12, 0, 32, 23, 13, 4},
569 };
570 static constexpr int node_indices_edge_c2_r[2][30] = {
571 {0, 4, 5, 6, 7, 8, 9, 10, 11, 1, 12, 13, 14, 15, 16,
572 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31},
573 {2, 39, 38, 37, 36, 35, 34, 33, 32, 3, 31, 30, 29, 28, 27,
574 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12},
575 };
576 static constexpr int node_indices_edge_c2_s[2][12] = {
577 {1, 21, 31, 2, 11, 20, 30, 39, 10, 19, 29, 38},
578 {3, 22, 12, 0, 32, 23, 13, 4, 33, 24, 14, 5},
579 };
580 static constexpr int node_indices_midedge_coupling_r[2][12] = {
581 {5, 6, 7, 8, 9, 10, 14, 15, 16, 17, 18, 19},
582 {38, 37, 36, 35, 34, 33, 29, 28, 27, 26, 25, 24},
583 };
584 static constexpr int node_indices_vertex_coupling[4][4] = {
585 {0, 4, 12, 13},
586 {1, 21, 11, 20},
587 {2, 39, 31, 30},
588 {3, 22, 32, 23},
589 };
590 static constexpr int node_indices_vertex_c2[4][6] = {
591 {0, 4, 12, 13, 5, 22},
592 {1, 21, 11, 20, 31, 10},
593 {2, 39, 31, 30, 38, 21},
594 {3, 22, 32, 23, 12, 33},
595 };
596};
597
598class Q9X3 : public QuadBezier<9, 3, Q9X3Data> {
599public:
600 void compute_polynomial_basis_functions_internal(
601 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
602 static const char name[];
603};
604
605struct Q9X5Data {
606 static constexpr int node_indices_edge_c1_r[2][20] = {
607 {0, 4, 5, 6, 7, 8, 9, 10, 11, 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21},
608 {2, 59, 58, 57, 56, 55, 54, 53, 52, 3, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42},
609 };
610 static constexpr int node_indices_edge_c1_s[2][12] = {
611 {1, 21, 31, 41, 51, 2, 11, 20, 30, 40, 50, 59},
612 {3, 42, 32, 22, 12, 0, 52, 43, 33, 23, 13, 4},
613 };
614 static constexpr int node_indices_edge_c2_r[2][30] = {
615 {0, 4, 5, 6, 7, 8, 9, 10, 11, 1, 12, 13, 14, 15, 16,
616 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31},
617 {2, 59, 58, 57, 56, 55, 54, 53, 52, 3, 51, 50, 49, 48, 47,
618 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32},
619 };
620 static constexpr int node_indices_edge_c2_s[2][18] = {
621 {1, 21, 31, 41, 51, 2, 11, 20, 30, 40, 50, 59, 10, 19, 29, 39, 49, 58},
622 {3, 42, 32, 22, 12, 0, 52, 43, 33, 23, 13, 4, 53, 44, 34, 24, 14, 5},
623 };
624 static constexpr int node_indices_midedge_coupling_r[2][12] = {
625 {5, 6, 7, 8, 9, 10, 14, 15, 16, 17, 18, 19},
626 {58, 57, 56, 55, 54, 53, 49, 48, 47, 46, 45, 44},
627 };
628 static constexpr int node_indices_midedge_coupling_s[2][4] = {
629 {31, 41, 30, 40},
630 {32, 22, 33, 23},
631 };
632 static constexpr int node_indices_vertex_coupling[4][4] = {
633 {0, 4, 12, 13},
634 {1, 21, 11, 20},
635 {2, 59, 51, 50},
636 {3, 42, 52, 43},
637 };
638 static constexpr int node_indices_vertex_c2[4][6] = {
639 {0, 4, 12, 13, 5, 22},
640 {1, 21, 11, 20, 31, 10},
641 {2, 59, 51, 50, 58, 41},
642 {3, 42, 52, 43, 32, 53},
643 };
644};
645
646class Q9X5 : public QuadBezier<9, 5, Q9X5Data> {
647public:
648 void compute_polynomial_basis_functions_internal(
649 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
650 static const char name[];
651};
652
653struct Q9X9Data {
654 static constexpr int node_indices_edge_c1_r[2][20] = {
655 {0, 4, 5, 6, 7, 8, 9, 10, 11, 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21},
656 {2, 99, 98, 97, 96, 95, 94, 93, 92, 3, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82},
657 };
658 static constexpr int node_indices_edge_c1_s[2][20] = {
659 {1, 21, 31, 41, 51, 61, 71, 81, 91, 2, 11, 20, 30, 40, 50, 60, 70, 80, 90, 99},
660 {3, 82, 72, 62, 52, 42, 32, 22, 12, 0, 92, 83, 73, 63, 53, 43, 33, 23, 13, 4},
661 };
662 static constexpr int node_indices_edge_c2_r[2][30] = {
663 {0, 4, 5, 6, 7, 8, 9, 10, 11, 1, 12, 13, 14, 15, 16,
664 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31},
665 {2, 99, 98, 97, 96, 95, 94, 93, 92, 3, 91, 90, 89, 88, 87,
666 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72},
667 };
668 static constexpr int node_indices_edge_c2_s[2][30] = {
669 {1, 21, 31, 41, 51, 61, 71, 81, 91, 2, 11, 20, 30, 40, 50,
670 60, 70, 80, 90, 99, 10, 19, 29, 39, 49, 59, 69, 79, 89, 98},
671 {3, 82, 72, 62, 52, 42, 32, 22, 12, 0, 92, 83, 73, 63, 53,
672 43, 33, 23, 13, 4, 93, 84, 74, 64, 54, 44, 34, 24, 14, 5},
673 };
674 static constexpr int node_indices_midedge_coupling_r[2][12] = {
675 {5, 6, 7, 8, 9, 10, 14, 15, 16, 17, 18, 19},
676 {98, 97, 96, 95, 94, 93, 89, 88, 87, 86, 85, 84},
677 };
678 static constexpr int node_indices_midedge_coupling_s[2][12] = {
679 {31, 41, 51, 61, 71, 81, 30, 40, 50, 60, 70, 80},
680 {72, 62, 52, 42, 32, 22, 73, 63, 53, 43, 33, 23},
681 };
682 static constexpr int node_indices_vertex_coupling[4][4] = {
683 {0, 4, 12, 13},
684 {1, 21, 11, 20},
685 {2, 99, 91, 90},
686 {3, 82, 92, 83},
687 };
688 static constexpr int node_indices_vertex_c2[4][6] = {
689 {0, 4, 12, 13, 5, 22},
690 {1, 21, 11, 20, 31, 10},
691 {2, 99, 91, 90, 98, 81},
692 {3, 82, 92, 83, 72, 93},
693 };
694};
695
696class Q9X9 : public QuadBezier<9, 9, Q9X9Data> {
697public:
698 void compute_polynomial_basis_functions_internal(
699 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
700 static const char name[];
701};
702
703} // namespace b2000::klt
704
705#endif // B2ELEMENT_KLT_COMPUTE_SHAPE_Q_IMPL_H_