b2api
B2000++ API Reference Manual, VERSION 4.6
 
Loading...
Searching...
No Matches
b2element_klt_compute_shape_t_impl.H
1//------------------------------------------------------------------------
2// b2element_klt_compute_shape_t_impl.H --
3//
4// !! GENERATED by b2element_klt_compute_shape_t.py !!
5//
6// Compute the shape functions of the Bezier triangle.
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_T_IMPL_H_
25#define B2ELEMENT_KLT_COMPUTE_SHAPE_T_IMPL_H_
26
27#include <cassert>
28#include <cmath>
29
30#include "b2element_klt_compute_shape_t.H"
31#include "utils/b2linear_algebra.H"
33
34namespace b2000::klt {
35
36struct TriangleT6Data {
37 static constexpr int node_indices_edge_c1[3][5] = {
38 {0, 3, 1, 4, 5},
39 {1, 5, 2, 3, 4},
40 {2, 4, 0, 5, 3},
41 };
42
43 static constexpr int node_indices_edge_c2[3][6] = {
44 {0, 3, 1, 4, 5, 2},
45 {1, 5, 2, 3, 4, 0},
46 {2, 4, 0, 5, 3, 1},
47 };
48
49 static constexpr int node_indices_vertex_coupling[3][4] = {
50 {0, 3, 4, 5},
51 {1, 5, 3, 4},
52 {2, 4, 5, 3},
53 };
54
55 static constexpr int node_indices_vertex_c2[3][6] = {
56 {0, 3, 4, 5, 1, 2},
57 {1, 5, 3, 4, 2, 0},
58 {2, 4, 5, 3, 0, 1},
59 };
60};
61
62class TriangleT6 : public TriangleBezier<2, TriangleT6Data> {
63public:
64 void compute_polynomial_basis_functions_internal(
65 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
66
67 static const char name[];
68};
69
70struct TriangleT10Data {
71 static constexpr int node_indices_edge_c1[3][7] = {
72 {0, 3, 4, 1, 5, 6, 7},
73 {1, 7, 9, 2, 4, 6, 8},
74 {2, 8, 5, 0, 9, 6, 3},
75 };
76
77 static constexpr int node_indices_edge_c2[3][9] = {
78 {0, 3, 4, 1, 5, 6, 7, 8, 9},
79 {1, 7, 9, 2, 4, 6, 8, 3, 5},
80 {2, 8, 5, 0, 9, 6, 3, 7, 4},
81 };
82
83 static constexpr int node_indices_vertex_coupling[3][4] = {
84 {0, 3, 5, 6},
85 {1, 7, 4, 6},
86 {2, 8, 9, 6},
87 };
88
89 static constexpr int node_indices_vertex_c2[3][6] = {
90 {0, 3, 5, 6, 4, 8},
91 {1, 7, 4, 6, 9, 3},
92 {2, 8, 9, 6, 5, 7},
93 };
94};
95
96class TriangleT10 : public TriangleBezier<3, TriangleT10Data> {
97public:
98 void compute_polynomial_basis_functions_internal(
99 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
100
101 static const char name[];
102};
103
104struct TriangleT15Data {
105 static constexpr int node_indices_edge_c1[3][9] = {
106 {0, 3, 4, 5, 1, 6, 7, 8, 9},
107 {1, 9, 12, 14, 2, 5, 8, 11, 13},
108 {2, 13, 10, 6, 0, 14, 11, 7, 3},
109 };
110
111 static constexpr int node_indices_edge_c2[3][12] = {
112 {0, 3, 4, 5, 1, 6, 7, 8, 9, 10, 11, 12},
113 {1, 9, 12, 14, 2, 5, 8, 11, 13, 4, 7, 10},
114 {2, 13, 10, 6, 0, 14, 11, 7, 3, 12, 8, 4},
115 };
116
117 static constexpr int node_indices_midedge_coupling[3][1] = {
118 {4},
119 {12},
120 {10},
121 };
122
123 static constexpr int node_indices_vertex_coupling[3][4] = {
124 {0, 3, 6, 7},
125 {1, 9, 5, 8},
126 {2, 13, 14, 11},
127 };
128
129 static constexpr int node_indices_vertex_c2[3][6] = {
130 {0, 3, 6, 7, 4, 10},
131 {1, 9, 5, 8, 12, 4},
132 {2, 13, 14, 11, 10, 12},
133 };
134};
135
136class TriangleT15 : public TriangleBezier<4, TriangleT15Data> {
137public:
138 void compute_polynomial_basis_functions_internal(
139 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
140
141 static const char name[];
142};
143
144struct TriangleT21Data {
145 static constexpr int node_indices_edge_c1[3][11] = {
146 {0, 3, 4, 5, 6, 1, 7, 8, 9, 10, 11},
147 {1, 11, 15, 18, 20, 2, 6, 10, 14, 17, 19},
148 {2, 19, 16, 12, 7, 0, 20, 17, 13, 8, 3},
149 };
150
151 static constexpr int node_indices_edge_c2[3][15] = {
152 {0, 3, 4, 5, 6, 1, 7, 8, 9, 10, 11, 12, 13, 14, 15},
153 {1, 11, 15, 18, 20, 2, 6, 10, 14, 17, 19, 5, 9, 13, 16},
154 {2, 19, 16, 12, 7, 0, 20, 17, 13, 8, 3, 18, 14, 9, 4},
155 };
156
157 static constexpr int node_indices_midedge_coupling[3][3] = {
158 {4, 5, 9},
159 {15, 18, 14},
160 {16, 12, 13},
161 };
162
163 static constexpr int node_indices_vertex_coupling[3][4] = {
164 {0, 3, 7, 8},
165 {1, 11, 6, 10},
166 {2, 19, 20, 17},
167 };
168
169 static constexpr int node_indices_vertex_c2[3][6] = {
170 {0, 3, 7, 8, 4, 12},
171 {1, 11, 6, 10, 15, 5},
172 {2, 19, 20, 17, 16, 18},
173 };
174};
175
176class TriangleT21 : public TriangleBezier<5, TriangleT21Data> {
177public:
178 void compute_polynomial_basis_functions_internal(
179 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
180
181 static const char name[];
182};
183
184struct TriangleT28Data {
185 static constexpr int node_indices_edge_c1[3][13] = {
186 {0, 3, 4, 5, 6, 7, 1, 8, 9, 10, 11, 12, 13},
187 {1, 13, 18, 22, 25, 27, 2, 7, 12, 17, 21, 24, 26},
188 {2, 26, 23, 19, 14, 8, 0, 27, 24, 20, 15, 9, 3},
189 };
190
191 static constexpr int node_indices_edge_c2[3][18] = {
192 {0, 3, 4, 5, 6, 7, 1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18},
193 {1, 13, 18, 22, 25, 27, 2, 7, 12, 17, 21, 24, 26, 6, 11, 16, 20, 23},
194 {2, 26, 23, 19, 14, 8, 0, 27, 24, 20, 15, 9, 3, 25, 21, 16, 10, 4},
195 };
196
197 static constexpr int node_indices_midedge_coupling[3][5] = {
198 {4, 5, 6, 10, 11},
199 {18, 22, 25, 17, 21},
200 {23, 19, 14, 20, 15},
201 };
202
203 static constexpr int node_indices_vertex_coupling[3][4] = {
204 {0, 3, 8, 9},
205 {1, 13, 7, 12},
206 {2, 26, 27, 24},
207 };
208
209 static constexpr int node_indices_vertex_c2[3][6] = {
210 {0, 3, 8, 9, 4, 14},
211 {1, 13, 7, 12, 18, 6},
212 {2, 26, 27, 24, 23, 25},
213 };
214};
215
216class TriangleT28 : public TriangleBezier<6, TriangleT28Data> {
217public:
218 void compute_polynomial_basis_functions_internal(
219 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
220
221 static const char name[];
222};
223
224struct TriangleT36Data {
225 static constexpr int node_indices_edge_c1[3][15] = {
226 {0, 3, 4, 5, 6, 7, 8, 1, 9, 10, 11, 12, 13, 14, 15},
227 {1, 15, 21, 26, 30, 33, 35, 2, 8, 14, 20, 25, 29, 32, 34},
228 {2, 34, 31, 27, 22, 16, 9, 0, 35, 32, 28, 23, 17, 10, 3},
229 };
230
231 static constexpr int node_indices_edge_c2[3][21] = {
232 {0, 3, 4, 5, 6, 7, 8, 1, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21},
233 {1, 15, 21, 26, 30, 33, 35, 2, 8, 14, 20, 25, 29, 32, 34, 7, 13, 19, 24, 28, 31},
234 {2, 34, 31, 27, 22, 16, 9, 0, 35, 32, 28, 23, 17, 10, 3, 33, 29, 24, 18, 11, 4},
235 };
236
237 static constexpr int node_indices_midedge_coupling[3][7] = {
238 {4, 5, 6, 7, 11, 12, 13},
239 {21, 26, 30, 33, 20, 25, 29},
240 {31, 27, 22, 16, 28, 23, 17},
241 };
242
243 static constexpr int node_indices_vertex_coupling[3][4] = {
244 {0, 3, 9, 10},
245 {1, 15, 8, 14},
246 {2, 34, 35, 32},
247 };
248
249 static constexpr int node_indices_vertex_c2[3][6] = {
250 {0, 3, 9, 10, 4, 16},
251 {1, 15, 8, 14, 21, 7},
252 {2, 34, 35, 32, 31, 33},
253 };
254};
255
256class TriangleT36 : public TriangleBezier<7, TriangleT36Data> {
257public:
258 void compute_polynomial_basis_functions_internal(
259 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
260
261 static const char name[];
262};
263
264struct TriangleT45Data {
265 static constexpr int node_indices_edge_c1[3][17] = {
266 {0, 3, 4, 5, 6, 7, 8, 9, 1, 10, 11, 12, 13, 14, 15, 16, 17},
267 {1, 17, 24, 30, 35, 39, 42, 44, 2, 9, 16, 23, 29, 34, 38, 41, 43},
268 {2, 43, 40, 36, 31, 25, 18, 10, 0, 44, 41, 37, 32, 26, 19, 11, 3},
269 };
270
271 static constexpr int node_indices_edge_c2[3][24] = {
272 {0, 3, 4, 5, 6, 7, 8, 9, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24},
273 {1, 17, 24, 30, 35, 39, 42, 44, 2, 9, 16, 23,
274 29, 34, 38, 41, 43, 8, 15, 22, 28, 33, 37, 40},
275 {2, 43, 40, 36, 31, 25, 18, 10, 0, 44, 41, 37,
276 32, 26, 19, 11, 3, 42, 38, 33, 27, 20, 12, 4},
277 };
278
279 static constexpr int node_indices_midedge_coupling[3][9] = {
280 {4, 5, 6, 7, 8, 12, 13, 14, 15},
281 {24, 30, 35, 39, 42, 23, 29, 34, 38},
282 {40, 36, 31, 25, 18, 37, 32, 26, 19},
283 };
284
285 static constexpr int node_indices_vertex_coupling[3][4] = {
286 {0, 3, 10, 11},
287 {1, 17, 9, 16},
288 {2, 43, 44, 41},
289 };
290
291 static constexpr int node_indices_vertex_c2[3][6] = {
292 {0, 3, 10, 11, 4, 18},
293 {1, 17, 9, 16, 24, 8},
294 {2, 43, 44, 41, 40, 42},
295 };
296};
297
298class TriangleT45 : public TriangleBezier<8, TriangleT45Data> {
299public:
300 void compute_polynomial_basis_functions_internal(
301 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
302
303 static const char name[];
304};
305
306struct TriangleT55Data {
307 static constexpr int node_indices_edge_c1[3][19] = {
308 {0, 3, 4, 5, 6, 7, 8, 9, 10, 1, 11, 12, 13, 14, 15, 16, 17, 18, 19},
309 {1, 19, 27, 34, 40, 45, 49, 52, 54, 2, 10, 18, 26, 33, 39, 44, 48, 51, 53},
310 {2, 53, 50, 46, 41, 35, 28, 20, 11, 0, 54, 51, 47, 42, 36, 29, 21, 12, 3},
311 };
312
313 static constexpr int node_indices_edge_c2[3][27] = {
314 {0, 3, 4, 5, 6, 7, 8, 9, 10, 1, 11, 12, 13, 14,
315 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27},
316 {1, 19, 27, 34, 40, 45, 49, 52, 54, 2, 10, 18, 26, 33,
317 39, 44, 48, 51, 53, 9, 17, 25, 32, 38, 43, 47, 50},
318 {2, 53, 50, 46, 41, 35, 28, 20, 11, 0, 54, 51, 47, 42,
319 36, 29, 21, 12, 3, 52, 48, 43, 37, 30, 22, 13, 4},
320 };
321
322 static constexpr int node_indices_midedge_coupling[3][11] = {
323 {4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17},
324 {27, 34, 40, 45, 49, 52, 26, 33, 39, 44, 48},
325 {50, 46, 41, 35, 28, 20, 47, 42, 36, 29, 21},
326 };
327
328 static constexpr int node_indices_vertex_coupling[3][4] = {
329 {0, 3, 11, 12},
330 {1, 19, 10, 18},
331 {2, 53, 54, 51},
332 };
333
334 static constexpr int node_indices_vertex_c2[3][6] = {
335 {0, 3, 11, 12, 4, 20},
336 {1, 19, 10, 18, 27, 9},
337 {2, 53, 54, 51, 50, 52},
338 };
339};
340
341class TriangleT55 : public TriangleBezier<9, TriangleT55Data> {
342public:
343 void compute_polynomial_basis_functions_internal(
344 const double xi[2], b2linalg::Matrix<double, b2linalg::Mrectangle>& N) const;
345
346 static const char name[];
347};
348
349} // namespace b2000::klt
350
351#endif // B2ELEMENT_KLT_COMPUTE_SHAPE_T_IMPL_H_