PolyFEM
Loading...
Searching...
No Matches
auto_p_bases.cpp
Go to the documentation of this file.
1#include "auto_p_bases.hpp"
2
3namespace polyfem
4{
5 namespace autogen
6 {
7 namespace
8 {
9 void p_0_basis_value_2d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &result_0)
10 {
11
12 auto x = uv.col(0).array();
13 auto y = uv.col(1).array();
14
15 result_0.resize(x.size(), 1);
16 switch (local_index)
17 {
18 case 0:
19 {
20 result_0.setOnes();
21 }
22 break;
23 default:
24 assert(false);
25 }
26 }
27 void p_0_basis_grad_value_2d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
28 {
29
30 auto x = uv.col(0).array();
31 auto y = uv.col(1).array();
32
33 val.resize(uv.rows(), uv.cols());
34 Eigen::ArrayXd result_0(uv.rows());
35 switch (local_index)
36 {
37 case 0:
38 {
39 {
40 result_0.setZero();
41 val.col(0) = result_0;
42 }
43 {
44 result_0.setZero();
45 val.col(1) = result_0;
46 }
47 }
48 break;
49 default:
50 assert(false);
51 }
52 }
53
54 void p_0_nodes_2d(Eigen::MatrixXd &res)
55 {
56 res.resize(1, 2);
57 res << 0.33333333333333331, 0.33333333333333331;
58 }
59
60 void p_1_basis_value_2d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &result_0)
61 {
62
63 auto x = uv.col(0).array();
64 auto y = uv.col(1).array();
65
66 switch (local_index)
67 {
68 case 0:
69 {
70 result_0 = -x - y + 1;
71 }
72 break;
73 case 1:
74 {
75 result_0 = x;
76 }
77 break;
78 case 2:
79 {
80 result_0 = y;
81 }
82 break;
83 default:
84 assert(false);
85 }
86 }
87 void p_1_basis_grad_value_2d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
88 {
89
90 auto x = uv.col(0).array();
91 auto y = uv.col(1).array();
92
93 val.resize(uv.rows(), uv.cols());
94 Eigen::ArrayXd result_0(uv.rows());
95 switch (local_index)
96 {
97 case 0:
98 {
99 {
100 result_0.setConstant(-1);
101 val.col(0) = result_0;
102 }
103 {
104 result_0.setConstant(-1);
105 val.col(1) = result_0;
106 }
107 }
108 break;
109 case 1:
110 {
111 {
112 result_0.setOnes();
113 val.col(0) = result_0;
114 }
115 {
116 result_0.setZero();
117 val.col(1) = result_0;
118 }
119 }
120 break;
121 case 2:
122 {
123 {
124 result_0.setZero();
125 val.col(0) = result_0;
126 }
127 {
128 result_0.setOnes();
129 val.col(1) = result_0;
130 }
131 }
132 break;
133 default:
134 assert(false);
135 }
136 }
137
138 void p_1_nodes_2d(Eigen::MatrixXd &res)
139 {
140 res.resize(3, 2);
141 res << 0, 0,
142 1, 0,
143 0, 1;
144 }
145
146 void p_2_basis_value_2d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &result_0)
147 {
148
149 auto x = uv.col(0).array();
150 auto y = uv.col(1).array();
151
152 switch (local_index)
153 {
154 case 0:
155 {
156 result_0 = (x + y - 1) * (2 * x + 2 * y - 1);
157 }
158 break;
159 case 1:
160 {
161 result_0 = x * (2 * x - 1);
162 }
163 break;
164 case 2:
165 {
166 result_0 = y * (2 * y - 1);
167 }
168 break;
169 case 3:
170 {
171 result_0 = -4 * x * (x + y - 1);
172 }
173 break;
174 case 4:
175 {
176 result_0 = 4 * x * y;
177 }
178 break;
179 case 5:
180 {
181 result_0 = -4 * y * (x + y - 1);
182 }
183 break;
184 default:
185 assert(false);
186 }
187 }
188 void p_2_basis_grad_value_2d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
189 {
190
191 auto x = uv.col(0).array();
192 auto y = uv.col(1).array();
193
194 val.resize(uv.rows(), uv.cols());
195 Eigen::ArrayXd result_0(uv.rows());
196 switch (local_index)
197 {
198 case 0:
199 {
200 {
201 result_0 = 4 * x + 4 * y - 3;
202 val.col(0) = result_0;
203 }
204 {
205 result_0 = 4 * x + 4 * y - 3;
206 val.col(1) = result_0;
207 }
208 }
209 break;
210 case 1:
211 {
212 {
213 result_0 = 4 * x - 1;
214 val.col(0) = result_0;
215 }
216 {
217 result_0.setZero();
218 val.col(1) = result_0;
219 }
220 }
221 break;
222 case 2:
223 {
224 {
225 result_0.setZero();
226 val.col(0) = result_0;
227 }
228 {
229 result_0 = 4 * y - 1;
230 val.col(1) = result_0;
231 }
232 }
233 break;
234 case 3:
235 {
236 {
237 result_0 = 4 * (-2 * x - y + 1);
238 val.col(0) = result_0;
239 }
240 {
241 result_0 = -4 * x;
242 val.col(1) = result_0;
243 }
244 }
245 break;
246 case 4:
247 {
248 {
249 result_0 = 4 * y;
250 val.col(0) = result_0;
251 }
252 {
253 result_0 = 4 * x;
254 val.col(1) = result_0;
255 }
256 }
257 break;
258 case 5:
259 {
260 {
261 result_0 = -4 * y;
262 val.col(0) = result_0;
263 }
264 {
265 result_0 = 4 * (-x - 2 * y + 1);
266 val.col(1) = result_0;
267 }
268 }
269 break;
270 default:
271 assert(false);
272 }
273 }
274
275 void p_2_nodes_2d(Eigen::MatrixXd &res)
276 {
277 res.resize(6, 2);
278 res << 0, 0,
279 1, 0,
280 0, 1,
281 1.0 / 2.0, 0,
282 1.0 / 2.0, 1.0 / 2.0,
283 0, 1.0 / 2.0;
284 }
285
286 void p_3_basis_value_2d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &result_0)
287 {
288
289 auto x = uv.col(0).array();
290 auto y = uv.col(1).array();
291
292 switch (local_index)
293 {
294 case 0:
295 {
296 const auto helper_0 = pow(x, 2);
297 const auto helper_1 = pow(y, 2);
298 result_0 = -27.0 / 2.0 * helper_0 * y + 9 * helper_0 - 27.0 / 2.0 * helper_1 * x + 9 * helper_1 - 9.0 / 2.0 * pow(x, 3) + 18 * x * y - 11.0 / 2.0 * x - 9.0 / 2.0 * pow(y, 3) - 11.0 / 2.0 * y + 1;
299 }
300 break;
301 case 1:
302 {
303 result_0 = (1.0 / 2.0) * x * (9 * pow(x, 2) - 9 * x + 2);
304 }
305 break;
306 case 2:
307 {
308 result_0 = (1.0 / 2.0) * y * (9 * pow(y, 2) - 9 * y + 2);
309 }
310 break;
311 case 3:
312 {
313 result_0 = (9.0 / 2.0) * x * (x + y - 1) * (3 * x + 3 * y - 2);
314 }
315 break;
316 case 4:
317 {
318 result_0 = -9.0 / 2.0 * x * (3 * pow(x, 2) + 3 * x * y - 4 * x - y + 1);
319 }
320 break;
321 case 5:
322 {
323 result_0 = (9.0 / 2.0) * x * y * (3 * x - 1);
324 }
325 break;
326 case 6:
327 {
328 result_0 = (9.0 / 2.0) * x * y * (3 * y - 1);
329 }
330 break;
331 case 7:
332 {
333 result_0 = -9.0 / 2.0 * y * (3 * x * y - x + 3 * pow(y, 2) - 4 * y + 1);
334 }
335 break;
336 case 8:
337 {
338 result_0 = (9.0 / 2.0) * y * (x + y - 1) * (3 * x + 3 * y - 2);
339 }
340 break;
341 case 9:
342 {
343 result_0 = -27 * x * y * (x + y - 1);
344 }
345 break;
346 default:
347 assert(false);
348 }
349 }
350 void p_3_basis_grad_value_2d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
351 {
352
353 auto x = uv.col(0).array();
354 auto y = uv.col(1).array();
355
356 val.resize(uv.rows(), uv.cols());
357 Eigen::ArrayXd result_0(uv.rows());
358 switch (local_index)
359 {
360 case 0:
361 {
362 {
363 result_0 = -27.0 / 2.0 * pow(x, 2) - 27 * x * y + 18 * x - 27.0 / 2.0 * pow(y, 2) + 18 * y - 11.0 / 2.0;
364 val.col(0) = result_0;
365 }
366 {
367 result_0 = -27.0 / 2.0 * pow(x, 2) - 27 * x * y + 18 * x - 27.0 / 2.0 * pow(y, 2) + 18 * y - 11.0 / 2.0;
368 val.col(1) = result_0;
369 }
370 }
371 break;
372 case 1:
373 {
374 {
375 result_0 = (27.0 / 2.0) * pow(x, 2) - 9 * x + 1;
376 val.col(0) = result_0;
377 }
378 {
379 result_0.setZero();
380 val.col(1) = result_0;
381 }
382 }
383 break;
384 case 2:
385 {
386 {
387 result_0.setZero();
388 val.col(0) = result_0;
389 }
390 {
391 result_0 = (27.0 / 2.0) * pow(y, 2) - 9 * y + 1;
392 val.col(1) = result_0;
393 }
394 }
395 break;
396 case 3:
397 {
398 {
399 result_0 = 9 * ((9.0 / 2.0) * pow(x, 2) + 6 * x * y - 5 * x + (3.0 / 2.0) * pow(y, 2) - 5.0 / 2.0 * y + 1);
400 val.col(0) = result_0;
401 }
402 {
403 result_0 = (9.0 / 2.0) * x * (6 * x + 6 * y - 5);
404 val.col(1) = result_0;
405 }
406 }
407 break;
408 case 4:
409 {
410 {
411 result_0 = 9 * (-9.0 / 2.0 * pow(x, 2) - 3 * x * y + 4 * x + (1.0 / 2.0) * y - 1.0 / 2.0);
412 val.col(0) = result_0;
413 }
414 {
415 result_0 = -9.0 / 2.0 * x * (3 * x - 1);
416 val.col(1) = result_0;
417 }
418 }
419 break;
420 case 5:
421 {
422 {
423 result_0 = (9.0 / 2.0) * y * (6 * x - 1);
424 val.col(0) = result_0;
425 }
426 {
427 result_0 = (9.0 / 2.0) * x * (3 * x - 1);
428 val.col(1) = result_0;
429 }
430 }
431 break;
432 case 6:
433 {
434 {
435 result_0 = (9.0 / 2.0) * y * (3 * y - 1);
436 val.col(0) = result_0;
437 }
438 {
439 result_0 = (9.0 / 2.0) * x * (6 * y - 1);
440 val.col(1) = result_0;
441 }
442 }
443 break;
444 case 7:
445 {
446 {
447 result_0 = -9.0 / 2.0 * y * (3 * y - 1);
448 val.col(0) = result_0;
449 }
450 {
451 result_0 = 9 * (-3 * x * y + (1.0 / 2.0) * x - 9.0 / 2.0 * pow(y, 2) + 4 * y - 1.0 / 2.0);
452 val.col(1) = result_0;
453 }
454 }
455 break;
456 case 8:
457 {
458 {
459 result_0 = (9.0 / 2.0) * y * (6 * x + 6 * y - 5);
460 val.col(0) = result_0;
461 }
462 {
463 result_0 = 9 * ((3.0 / 2.0) * pow(x, 2) + 6 * x * y - 5.0 / 2.0 * x + (9.0 / 2.0) * pow(y, 2) - 5 * y + 1);
464 val.col(1) = result_0;
465 }
466 }
467 break;
468 case 9:
469 {
470 {
471 result_0 = -27 * y * (2 * x + y - 1);
472 val.col(0) = result_0;
473 }
474 {
475 result_0 = -27 * x * (x + 2 * y - 1);
476 val.col(1) = result_0;
477 }
478 }
479 break;
480 default:
481 assert(false);
482 }
483 }
484
485 void p_3_nodes_2d(Eigen::MatrixXd &res)
486 {
487 res.resize(10, 2);
488 res << 0, 0,
489 1, 0,
490 0, 1,
491 1.0 / 3.0, 0,
492 2.0 / 3.0, 0,
493 2.0 / 3.0, 1.0 / 3.0,
494 1.0 / 3.0, 2.0 / 3.0,
495 0, 2.0 / 3.0,
496 0, 1.0 / 3.0,
497 1.0 / 3.0, 1.0 / 3.0;
498 }
499
500 void p_4_basis_value_2d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &result_0)
501 {
502
503 auto x = uv.col(0).array();
504 auto y = uv.col(1).array();
505
506 switch (local_index)
507 {
508 case 0:
509 {
510 const auto helper_0 = pow(x, 2);
511 const auto helper_1 = pow(x, 3);
512 const auto helper_2 = pow(y, 2);
513 const auto helper_3 = pow(y, 3);
514 result_0 = 64 * helper_0 * helper_2 - 80 * helper_0 * y + (70.0 / 3.0) * helper_0 + (128.0 / 3.0) * helper_1 * y - 80.0 / 3.0 * helper_1 - 80 * helper_2 * x + (70.0 / 3.0) * helper_2 + (128.0 / 3.0) * helper_3 * x - 80.0 / 3.0 * helper_3 + (32.0 / 3.0) * pow(x, 4) + (140.0 / 3.0) * x * y - 25.0 / 3.0 * x + (32.0 / 3.0) * pow(y, 4) - 25.0 / 3.0 * y + 1;
515 }
516 break;
517 case 1:
518 {
519 result_0 = (1.0 / 3.0) * x * (32 * pow(x, 3) - 48 * pow(x, 2) + 22 * x - 3);
520 }
521 break;
522 case 2:
523 {
524 result_0 = (1.0 / 3.0) * y * (32 * pow(y, 3) - 48 * pow(y, 2) + 22 * y - 3);
525 }
526 break;
527 case 3:
528 {
529 const auto helper_0 = pow(x, 2);
530 const auto helper_1 = pow(y, 2);
531 result_0 = -16.0 / 3.0 * x * (24 * helper_0 * y - 18 * helper_0 + 24 * helper_1 * x - 18 * helper_1 + 8 * pow(x, 3) - 36 * x * y + 13 * x + 8 * pow(y, 3) + 13 * y - 3);
532 }
533 break;
534 case 4:
535 {
536 const auto helper_0 = 32 * pow(x, 2);
537 const auto helper_1 = pow(y, 2);
538 result_0 = 4 * x * (helper_0 * y - helper_0 + 16 * helper_1 * x - 4 * helper_1 + 16 * pow(x, 3) - 36 * x * y + 19 * x + 7 * y - 3);
539 }
540 break;
541 case 5:
542 {
543 const auto helper_0 = pow(x, 2);
544 result_0 = -16.0 / 3.0 * x * (8 * helper_0 * y - 14 * helper_0 + 8 * pow(x, 3) - 6 * x * y + 7 * x + y - 1);
545 }
546 break;
547 case 6:
548 {
549 result_0 = (16.0 / 3.0) * x * y * (8 * pow(x, 2) - 6 * x + 1);
550 }
551 break;
552 case 7:
553 {
554 const auto helper_0 = 4 * x;
555 result_0 = helper_0 * y * (-helper_0 + 16 * x * y - 4 * y + 1);
556 }
557 break;
558 case 8:
559 {
560 result_0 = (16.0 / 3.0) * x * y * (8 * pow(y, 2) - 6 * y + 1);
561 }
562 break;
563 case 9:
564 {
565 const auto helper_0 = pow(y, 2);
566 result_0 = -16.0 / 3.0 * y * (8 * helper_0 * x - 14 * helper_0 - 6 * x * y + x + 8 * pow(y, 3) + 7 * y - 1);
567 }
568 break;
569 case 10:
570 {
571 const auto helper_0 = pow(x, 2);
572 const auto helper_1 = 32 * pow(y, 2);
573 result_0 = 4 * y * (16 * helper_0 * y - 4 * helper_0 + helper_1 * x - helper_1 - 36 * x * y + 7 * x + 16 * pow(y, 3) + 19 * y - 3);
574 }
575 break;
576 case 11:
577 {
578 const auto helper_0 = pow(x, 2);
579 const auto helper_1 = pow(y, 2);
580 result_0 = -16.0 / 3.0 * y * (24 * helper_0 * y - 18 * helper_0 + 24 * helper_1 * x - 18 * helper_1 + 8 * pow(x, 3) - 36 * x * y + 13 * x + 8 * pow(y, 3) + 13 * y - 3);
581 }
582 break;
583 case 12:
584 {
585 result_0 = 32 * x * y * (x + y - 1) * (4 * x + 4 * y - 3);
586 }
587 break;
588 case 13:
589 {
590 result_0 = -32 * x * y * (4 * y - 1) * (x + y - 1);
591 }
592 break;
593 case 14:
594 {
595 result_0 = -32 * x * y * (4 * x - 1) * (x + y - 1);
596 }
597 break;
598 default:
599 assert(false);
600 }
601 }
602 void p_4_basis_grad_value_2d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
603 {
604
605 auto x = uv.col(0).array();
606 auto y = uv.col(1).array();
607
608 val.resize(uv.rows(), uv.cols());
609 Eigen::ArrayXd result_0(uv.rows());
610 switch (local_index)
611 {
612 case 0:
613 {
614 {
615 const auto helper_0 = pow(x, 2);
616 const auto helper_1 = pow(y, 2);
617 result_0 = 128 * helper_0 * y - 80 * helper_0 + 128 * helper_1 * x - 80 * helper_1 + (128.0 / 3.0) * pow(x, 3) - 160 * x * y + (140.0 / 3.0) * x + (128.0 / 3.0) * pow(y, 3) + (140.0 / 3.0) * y - 25.0 / 3.0;
618 val.col(0) = result_0;
619 }
620 {
621 const auto helper_0 = pow(x, 2);
622 const auto helper_1 = pow(y, 2);
623 result_0 = 128 * helper_0 * y - 80 * helper_0 + 128 * helper_1 * x - 80 * helper_1 + (128.0 / 3.0) * pow(x, 3) - 160 * x * y + (140.0 / 3.0) * x + (128.0 / 3.0) * pow(y, 3) + (140.0 / 3.0) * y - 25.0 / 3.0;
624 val.col(1) = result_0;
625 }
626 }
627 break;
628 case 1:
629 {
630 {
631 result_0 = (128.0 / 3.0) * pow(x, 3) - 48 * pow(x, 2) + (44.0 / 3.0) * x - 1;
632 val.col(0) = result_0;
633 }
634 {
635 result_0.setZero();
636 val.col(1) = result_0;
637 }
638 }
639 break;
640 case 2:
641 {
642 {
643 result_0.setZero();
644 val.col(0) = result_0;
645 }
646 {
647 result_0 = (128.0 / 3.0) * pow(y, 3) - 48 * pow(y, 2) + (44.0 / 3.0) * y - 1;
648 val.col(1) = result_0;
649 }
650 }
651 break;
652 case 3:
653 {
654 {
655 const auto helper_0 = pow(x, 2);
656 const auto helper_1 = pow(y, 2);
657 result_0 = -384 * helper_0 * y + 288 * helper_0 - 256 * helper_1 * x + 96 * helper_1 - 512.0 / 3.0 * pow(x, 3) + 384 * x * y - 416.0 / 3.0 * x - 128.0 / 3.0 * pow(y, 3) - 208.0 / 3.0 * y + 16;
658 val.col(0) = result_0;
659 }
660 {
661 result_0 = -16.0 / 3.0 * x * (24 * pow(x, 2) + 48 * x * y - 36 * x + 24 * pow(y, 2) - 36 * y + 13);
662 val.col(1) = result_0;
663 }
664 }
665 break;
666 case 4:
667 {
668 {
669 const auto helper_0 = 96 * pow(x, 2);
670 const auto helper_1 = pow(y, 2);
671 result_0 = 4 * helper_0 * y - 4 * helper_0 + 128 * helper_1 * x - 16 * helper_1 + 256 * pow(x, 3) - 288 * x * y + 152 * x + 28 * y - 12;
672 val.col(0) = result_0;
673 }
674 {
675 result_0 = 4 * x * (32 * pow(x, 2) + 32 * x * y - 36 * x - 8 * y + 7);
676 val.col(1) = result_0;
677 }
678 }
679 break;
680 case 5:
681 {
682 {
683 const auto helper_0 = pow(x, 2);
684 result_0 = -128 * helper_0 * y + 224 * helper_0 - 512.0 / 3.0 * pow(x, 3) + 64 * x * y - 224.0 / 3.0 * x - 16.0 / 3.0 * y + 16.0 / 3.0;
685 val.col(0) = result_0;
686 }
687 {
688 result_0 = -16.0 / 3.0 * x * (8 * pow(x, 2) - 6 * x + 1);
689 val.col(1) = result_0;
690 }
691 }
692 break;
693 case 6:
694 {
695 {
696 result_0 = (16.0 / 3.0) * y * (24 * pow(x, 2) - 12 * x + 1);
697 val.col(0) = result_0;
698 }
699 {
700 result_0 = (16.0 / 3.0) * x * (8 * pow(x, 2) - 6 * x + 1);
701 val.col(1) = result_0;
702 }
703 }
704 break;
705 case 7:
706 {
707 {
708 const auto helper_0 = 4 * y;
709 result_0 = helper_0 * (-helper_0 + 32 * x * y - 8 * x + 1);
710 val.col(0) = result_0;
711 }
712 {
713 const auto helper_0 = 4 * x;
714 result_0 = helper_0 * (-helper_0 + 32 * x * y - 8 * y + 1);
715 val.col(1) = result_0;
716 }
717 }
718 break;
719 case 8:
720 {
721 {
722 result_0 = (16.0 / 3.0) * y * (8 * pow(y, 2) - 6 * y + 1);
723 val.col(0) = result_0;
724 }
725 {
726 result_0 = (16.0 / 3.0) * x * (24 * pow(y, 2) - 12 * y + 1);
727 val.col(1) = result_0;
728 }
729 }
730 break;
731 case 9:
732 {
733 {
734 result_0 = -16.0 / 3.0 * y * (8 * pow(y, 2) - 6 * y + 1);
735 val.col(0) = result_0;
736 }
737 {
738 const auto helper_0 = pow(y, 2);
739 result_0 = -128 * helper_0 * x + 224 * helper_0 + 64 * x * y - 16.0 / 3.0 * x - 512.0 / 3.0 * pow(y, 3) - 224.0 / 3.0 * y + 16.0 / 3.0;
740 val.col(1) = result_0;
741 }
742 }
743 break;
744 case 10:
745 {
746 {
747 result_0 = 4 * y * (32 * x * y - 8 * x + 32 * pow(y, 2) - 36 * y + 7);
748 val.col(0) = result_0;
749 }
750 {
751 const auto helper_0 = pow(x, 2);
752 const auto helper_1 = 96 * pow(y, 2);
753 result_0 = 128 * helper_0 * y - 16 * helper_0 + 4 * helper_1 * x - 4 * helper_1 - 288 * x * y + 28 * x + 256 * pow(y, 3) + 152 * y - 12;
754 val.col(1) = result_0;
755 }
756 }
757 break;
758 case 11:
759 {
760 {
761 result_0 = -16.0 / 3.0 * y * (24 * pow(x, 2) + 48 * x * y - 36 * x + 24 * pow(y, 2) - 36 * y + 13);
762 val.col(0) = result_0;
763 }
764 {
765 const auto helper_0 = pow(x, 2);
766 const auto helper_1 = pow(y, 2);
767 result_0 = -256 * helper_0 * y + 96 * helper_0 - 384 * helper_1 * x + 288 * helper_1 - 128.0 / 3.0 * pow(x, 3) + 384 * x * y - 208.0 / 3.0 * x - 512.0 / 3.0 * pow(y, 3) - 416.0 / 3.0 * y + 16;
768 val.col(1) = result_0;
769 }
770 }
771 break;
772 case 12:
773 {
774 {
775 result_0 = 32 * y * (12 * pow(x, 2) + 16 * x * y - 14 * x + 4 * pow(y, 2) - 7 * y + 3);
776 val.col(0) = result_0;
777 }
778 {
779 result_0 = 32 * x * (4 * pow(x, 2) + 16 * x * y - 7 * x + 12 * pow(y, 2) - 14 * y + 3);
780 val.col(1) = result_0;
781 }
782 }
783 break;
784 case 13:
785 {
786 {
787 result_0 = -32 * y * (8 * x * y - 2 * x + 4 * pow(y, 2) - 5 * y + 1);
788 val.col(0) = result_0;
789 }
790 {
791 result_0 = -32 * x * (8 * x * y - x + 12 * pow(y, 2) - 10 * y + 1);
792 val.col(1) = result_0;
793 }
794 }
795 break;
796 case 14:
797 {
798 {
799 result_0 = -32 * y * (12 * pow(x, 2) + 8 * x * y - 10 * x - y + 1);
800 val.col(0) = result_0;
801 }
802 {
803 result_0 = -32 * x * (4 * pow(x, 2) + 8 * x * y - 5 * x - 2 * y + 1);
804 val.col(1) = result_0;
805 }
806 }
807 break;
808 default:
809 assert(false);
810 }
811 }
812
813 void p_4_nodes_2d(Eigen::MatrixXd &res)
814 {
815 res.resize(15, 2);
816 res << 0, 0,
817 1, 0,
818 0, 1,
819 1.0 / 4.0, 0,
820 1.0 / 2.0, 0,
821 3.0 / 4.0, 0,
822 3.0 / 4.0, 1.0 / 4.0,
823 1.0 / 2.0, 1.0 / 2.0,
824 1.0 / 4.0, 3.0 / 4.0,
825 0, 3.0 / 4.0,
826 0, 1.0 / 2.0,
827 0, 1.0 / 4.0,
828 1.0 / 4.0, 1.0 / 4.0,
829 1.0 / 4.0, 1.0 / 2.0,
830 1.0 / 2.0, 1.0 / 4.0;
831 }
832
833 } // namespace
834
835 void p_nodes_2d(const int p, Eigen::MatrixXd &val)
836 {
837 switch (p)
838 {
839 case 0:
840 p_0_nodes_2d(val);
841 break;
842 case 1:
843 p_1_nodes_2d(val);
844 break;
845 case 2:
846 p_2_nodes_2d(val);
847 break;
848 case 3:
849 p_3_nodes_2d(val);
850 break;
851 case 4:
852 p_4_nodes_2d(val);
853 break;
854 default:
855 p_n_nodes_2d(p, val);
856 }
857 }
858 void p_basis_value_2d(const int p, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
859 {
860 switch (p)
861 {
862 case 0:
863 p_0_basis_value_2d(local_index, uv, val);
864 break;
865 case 1:
866 p_1_basis_value_2d(local_index, uv, val);
867 break;
868 case 2:
869 p_2_basis_value_2d(local_index, uv, val);
870 break;
871 case 3:
872 p_3_basis_value_2d(local_index, uv, val);
873 break;
874 case 4:
875 p_4_basis_value_2d(local_index, uv, val);
876 break;
877 default:
878 p_n_basis_value_2d(p, local_index, uv, val);
879 }
880 }
881
882 void p_grad_basis_value_2d(const int p, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
883 {
884 switch (p)
885 {
886 case 0:
887 p_0_basis_grad_value_2d(local_index, uv, val);
888 break;
889 case 1:
890 p_1_basis_grad_value_2d(local_index, uv, val);
891 break;
892 case 2:
893 p_2_basis_grad_value_2d(local_index, uv, val);
894 break;
895 case 3:
896 p_3_basis_grad_value_2d(local_index, uv, val);
897 break;
898 case 4:
899 p_4_basis_grad_value_2d(local_index, uv, val);
900 break;
901 default:
902 p_n_basis_grad_value_2d(p, local_index, uv, val);
903 }
904 }
905
906 namespace
907 {
908 void p_0_basis_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &result_0)
909 {
910
911 auto x = uv.col(0).array();
912 auto y = uv.col(1).array();
913 auto z = uv.col(2).array();
914
915 result_0.resize(x.size(), 1);
916 switch (local_index)
917 {
918 case 0:
919 {
920 result_0.setOnes();
921 }
922 break;
923 default:
924 assert(false);
925 }
926 }
927 void p_0_basis_grad_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
928 {
929
930 auto x = uv.col(0).array();
931 auto y = uv.col(1).array();
932 auto z = uv.col(2).array();
933
934 val.resize(uv.rows(), uv.cols());
935 Eigen::ArrayXd result_0(uv.rows());
936 switch (local_index)
937 {
938 case 0:
939 {
940 {
941 result_0.setZero();
942 val.col(0) = result_0;
943 }
944 {
945 result_0.setZero();
946 val.col(1) = result_0;
947 }
948 {
949 result_0.setZero();
950 val.col(2) = result_0;
951 }
952 }
953 break;
954 default:
955 assert(false);
956 }
957 }
958
959 void p_0_nodes_3d(Eigen::MatrixXd &res)
960 {
961 res.resize(1, 3);
962 res << 0.33333333333333331, 0.33333333333333331, 0.33333333333333331;
963 }
964
965 void p_1_basis_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &result_0)
966 {
967
968 auto x = uv.col(0).array();
969 auto y = uv.col(1).array();
970 auto z = uv.col(2).array();
971
972 switch (local_index)
973 {
974 case 0:
975 {
976 result_0 = -x - y - z + 1;
977 }
978 break;
979 case 1:
980 {
981 result_0 = x;
982 }
983 break;
984 case 2:
985 {
986 result_0 = y;
987 }
988 break;
989 case 3:
990 {
991 result_0 = z;
992 }
993 break;
994 default:
995 assert(false);
996 }
997 }
998 void p_1_basis_grad_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
999 {
1000
1001 auto x = uv.col(0).array();
1002 auto y = uv.col(1).array();
1003 auto z = uv.col(2).array();
1004
1005 val.resize(uv.rows(), uv.cols());
1006 Eigen::ArrayXd result_0(uv.rows());
1007 switch (local_index)
1008 {
1009 case 0:
1010 {
1011 {
1012 result_0.setConstant(-1);
1013 val.col(0) = result_0;
1014 }
1015 {
1016 result_0.setConstant(-1);
1017 val.col(1) = result_0;
1018 }
1019 {
1020 result_0.setConstant(-1);
1021 val.col(2) = result_0;
1022 }
1023 }
1024 break;
1025 case 1:
1026 {
1027 {
1028 result_0.setOnes();
1029 val.col(0) = result_0;
1030 }
1031 {
1032 result_0.setZero();
1033 val.col(1) = result_0;
1034 }
1035 {
1036 result_0.setZero();
1037 val.col(2) = result_0;
1038 }
1039 }
1040 break;
1041 case 2:
1042 {
1043 {
1044 result_0.setZero();
1045 val.col(0) = result_0;
1046 }
1047 {
1048 result_0.setOnes();
1049 val.col(1) = result_0;
1050 }
1051 {
1052 result_0.setZero();
1053 val.col(2) = result_0;
1054 }
1055 }
1056 break;
1057 case 3:
1058 {
1059 {
1060 result_0.setZero();
1061 val.col(0) = result_0;
1062 }
1063 {
1064 result_0.setZero();
1065 val.col(1) = result_0;
1066 }
1067 {
1068 result_0.setOnes();
1069 val.col(2) = result_0;
1070 }
1071 }
1072 break;
1073 default:
1074 assert(false);
1075 }
1076 }
1077
1078 void p_1_nodes_3d(Eigen::MatrixXd &res)
1079 {
1080 res.resize(4, 3);
1081 res << 0, 0, 0,
1082 1, 0, 0,
1083 0, 1, 0,
1084 0, 0, 1;
1085 }
1086
1087 void p_2_basis_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &result_0)
1088 {
1089
1090 auto x = uv.col(0).array();
1091 auto y = uv.col(1).array();
1092 auto z = uv.col(2).array();
1093
1094 switch (local_index)
1095 {
1096 case 0:
1097 {
1098 result_0 = (x + y + z - 1) * (2 * x + 2 * y + 2 * z - 1);
1099 }
1100 break;
1101 case 1:
1102 {
1103 result_0 = x * (2 * x - 1);
1104 }
1105 break;
1106 case 2:
1107 {
1108 result_0 = y * (2 * y - 1);
1109 }
1110 break;
1111 case 3:
1112 {
1113 result_0 = z * (2 * z - 1);
1114 }
1115 break;
1116 case 4:
1117 {
1118 result_0 = -4 * x * (x + y + z - 1);
1119 }
1120 break;
1121 case 5:
1122 {
1123 result_0 = 4 * x * y;
1124 }
1125 break;
1126 case 6:
1127 {
1128 result_0 = -4 * y * (x + y + z - 1);
1129 }
1130 break;
1131 case 7:
1132 {
1133 result_0 = -4 * z * (x + y + z - 1);
1134 }
1135 break;
1136 case 8:
1137 {
1138 result_0 = 4 * x * z;
1139 }
1140 break;
1141 case 9:
1142 {
1143 result_0 = 4 * y * z;
1144 }
1145 break;
1146 default:
1147 assert(false);
1148 }
1149 }
1150 void p_2_basis_grad_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
1151 {
1152
1153 auto x = uv.col(0).array();
1154 auto y = uv.col(1).array();
1155 auto z = uv.col(2).array();
1156
1157 val.resize(uv.rows(), uv.cols());
1158 Eigen::ArrayXd result_0(uv.rows());
1159 switch (local_index)
1160 {
1161 case 0:
1162 {
1163 {
1164 result_0 = 4 * x + 4 * y + 4 * z - 3;
1165 val.col(0) = result_0;
1166 }
1167 {
1168 result_0 = 4 * x + 4 * y + 4 * z - 3;
1169 val.col(1) = result_0;
1170 }
1171 {
1172 result_0 = 4 * x + 4 * y + 4 * z - 3;
1173 val.col(2) = result_0;
1174 }
1175 }
1176 break;
1177 case 1:
1178 {
1179 {
1180 result_0 = 4 * x - 1;
1181 val.col(0) = result_0;
1182 }
1183 {
1184 result_0.setZero();
1185 val.col(1) = result_0;
1186 }
1187 {
1188 result_0.setZero();
1189 val.col(2) = result_0;
1190 }
1191 }
1192 break;
1193 case 2:
1194 {
1195 {
1196 result_0.setZero();
1197 val.col(0) = result_0;
1198 }
1199 {
1200 result_0 = 4 * y - 1;
1201 val.col(1) = result_0;
1202 }
1203 {
1204 result_0.setZero();
1205 val.col(2) = result_0;
1206 }
1207 }
1208 break;
1209 case 3:
1210 {
1211 {
1212 result_0.setZero();
1213 val.col(0) = result_0;
1214 }
1215 {
1216 result_0.setZero();
1217 val.col(1) = result_0;
1218 }
1219 {
1220 result_0 = 4 * z - 1;
1221 val.col(2) = result_0;
1222 }
1223 }
1224 break;
1225 case 4:
1226 {
1227 {
1228 result_0 = 4 * (-2 * x - y - z + 1);
1229 val.col(0) = result_0;
1230 }
1231 {
1232 result_0 = -4 * x;
1233 val.col(1) = result_0;
1234 }
1235 {
1236 result_0 = -4 * x;
1237 val.col(2) = result_0;
1238 }
1239 }
1240 break;
1241 case 5:
1242 {
1243 {
1244 result_0 = 4 * y;
1245 val.col(0) = result_0;
1246 }
1247 {
1248 result_0 = 4 * x;
1249 val.col(1) = result_0;
1250 }
1251 {
1252 result_0.setZero();
1253 val.col(2) = result_0;
1254 }
1255 }
1256 break;
1257 case 6:
1258 {
1259 {
1260 result_0 = -4 * y;
1261 val.col(0) = result_0;
1262 }
1263 {
1264 result_0 = 4 * (-x - 2 * y - z + 1);
1265 val.col(1) = result_0;
1266 }
1267 {
1268 result_0 = -4 * y;
1269 val.col(2) = result_0;
1270 }
1271 }
1272 break;
1273 case 7:
1274 {
1275 {
1276 result_0 = -4 * z;
1277 val.col(0) = result_0;
1278 }
1279 {
1280 result_0 = -4 * z;
1281 val.col(1) = result_0;
1282 }
1283 {
1284 result_0 = 4 * (-x - y - 2 * z + 1);
1285 val.col(2) = result_0;
1286 }
1287 }
1288 break;
1289 case 8:
1290 {
1291 {
1292 result_0 = 4 * z;
1293 val.col(0) = result_0;
1294 }
1295 {
1296 result_0.setZero();
1297 val.col(1) = result_0;
1298 }
1299 {
1300 result_0 = 4 * x;
1301 val.col(2) = result_0;
1302 }
1303 }
1304 break;
1305 case 9:
1306 {
1307 {
1308 result_0.setZero();
1309 val.col(0) = result_0;
1310 }
1311 {
1312 result_0 = 4 * z;
1313 val.col(1) = result_0;
1314 }
1315 {
1316 result_0 = 4 * y;
1317 val.col(2) = result_0;
1318 }
1319 }
1320 break;
1321 default:
1322 assert(false);
1323 }
1324 }
1325
1326 void p_2_nodes_3d(Eigen::MatrixXd &res)
1327 {
1328 res.resize(10, 3);
1329 res << 0, 0, 0,
1330 1, 0, 0,
1331 0, 1, 0,
1332 0, 0, 1,
1333 1.0 / 2.0, 0, 0,
1334 1.0 / 2.0, 1.0 / 2.0, 0,
1335 0, 1.0 / 2.0, 0,
1336 0, 0, 1.0 / 2.0,
1337 1.0 / 2.0, 0, 1.0 / 2.0,
1338 0, 1.0 / 2.0, 1.0 / 2.0;
1339 }
1340
1341 void p_3_basis_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &result_0)
1342 {
1343
1344 auto x = uv.col(0).array();
1345 auto y = uv.col(1).array();
1346 auto z = uv.col(2).array();
1347
1348 switch (local_index)
1349 {
1350 case 0:
1351 {
1352 const auto helper_0 = pow(x, 2);
1353 const auto helper_1 = pow(y, 2);
1354 const auto helper_2 = pow(z, 2);
1355 const auto helper_3 = (27.0 / 2.0) * x;
1356 const auto helper_4 = (27.0 / 2.0) * y;
1357 const auto helper_5 = (27.0 / 2.0) * z;
1358 result_0 = -helper_0 * helper_4 - helper_0 * helper_5 + 9 * helper_0 - helper_1 * helper_3 - helper_1 * helper_5 + 9 * helper_1 - helper_2 * helper_3 - helper_2 * helper_4 + 9 * helper_2 - 9.0 / 2.0 * pow(x, 3) - 27 * x * y * z + 18 * x * y + 18 * x * z - 11.0 / 2.0 * x - 9.0 / 2.0 * pow(y, 3) + 18 * y * z - 11.0 / 2.0 * y - 9.0 / 2.0 * pow(z, 3) - 11.0 / 2.0 * z + 1;
1359 }
1360 break;
1361 case 1:
1362 {
1363 result_0 = (1.0 / 2.0) * x * (9 * pow(x, 2) - 9 * x + 2);
1364 }
1365 break;
1366 case 2:
1367 {
1368 result_0 = (1.0 / 2.0) * y * (9 * pow(y, 2) - 9 * y + 2);
1369 }
1370 break;
1371 case 3:
1372 {
1373 result_0 = (1.0 / 2.0) * z * (9 * pow(z, 2) - 9 * z + 2);
1374 }
1375 break;
1376 case 4:
1377 {
1378 result_0 = (9.0 / 2.0) * x * (x + y + z - 1) * (3 * x + 3 * y + 3 * z - 2);
1379 }
1380 break;
1381 case 5:
1382 {
1383 const auto helper_0 = 3 * x;
1384 result_0 = -9.0 / 2.0 * x * (helper_0 * y + helper_0 * z + 3 * pow(x, 2) - 4 * x - y - z + 1);
1385 }
1386 break;
1387 case 6:
1388 {
1389 result_0 = (9.0 / 2.0) * x * y * (3 * x - 1);
1390 }
1391 break;
1392 case 7:
1393 {
1394 result_0 = (9.0 / 2.0) * x * y * (3 * y - 1);
1395 }
1396 break;
1397 case 8:
1398 {
1399 const auto helper_0 = 3 * y;
1400 result_0 = -9.0 / 2.0 * y * (helper_0 * x + helper_0 * z - x + 3 * pow(y, 2) - 4 * y - z + 1);
1401 }
1402 break;
1403 case 9:
1404 {
1405 result_0 = (9.0 / 2.0) * y * (x + y + z - 1) * (3 * x + 3 * y + 3 * z - 2);
1406 }
1407 break;
1408 case 10:
1409 {
1410 result_0 = (9.0 / 2.0) * z * (x + y + z - 1) * (3 * x + 3 * y + 3 * z - 2);
1411 }
1412 break;
1413 case 11:
1414 {
1415 const auto helper_0 = 3 * z;
1416 result_0 = -9.0 / 2.0 * z * (helper_0 * x + helper_0 * y - x - y + 3 * pow(z, 2) - 4 * z + 1);
1417 }
1418 break;
1419 case 12:
1420 {
1421 result_0 = (9.0 / 2.0) * x * z * (3 * x - 1);
1422 }
1423 break;
1424 case 13:
1425 {
1426 result_0 = (9.0 / 2.0) * x * z * (3 * z - 1);
1427 }
1428 break;
1429 case 14:
1430 {
1431 result_0 = (9.0 / 2.0) * y * z * (3 * y - 1);
1432 }
1433 break;
1434 case 15:
1435 {
1436 result_0 = (9.0 / 2.0) * y * z * (3 * z - 1);
1437 }
1438 break;
1439 case 16:
1440 {
1441 result_0 = -27 * x * y * (x + y + z - 1);
1442 }
1443 break;
1444 case 17:
1445 {
1446 result_0 = -27 * x * z * (x + y + z - 1);
1447 }
1448 break;
1449 case 18:
1450 {
1451 result_0 = 27 * x * y * z;
1452 }
1453 break;
1454 case 19:
1455 {
1456 result_0 = -27 * y * z * (x + y + z - 1);
1457 }
1458 break;
1459 default:
1460 assert(false);
1461 }
1462 }
1463 void p_3_basis_grad_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
1464 {
1465
1466 auto x = uv.col(0).array();
1467 auto y = uv.col(1).array();
1468 auto z = uv.col(2).array();
1469
1470 val.resize(uv.rows(), uv.cols());
1471 Eigen::ArrayXd result_0(uv.rows());
1472 switch (local_index)
1473 {
1474 case 0:
1475 {
1476 {
1477 const auto helper_0 = 27 * x;
1478 result_0 = -helper_0 * y - helper_0 * z - 27.0 / 2.0 * pow(x, 2) + 18 * x - 27.0 / 2.0 * pow(y, 2) - 27 * y * z + 18 * y - 27.0 / 2.0 * pow(z, 2) + 18 * z - 11.0 / 2.0;
1479 val.col(0) = result_0;
1480 }
1481 {
1482 const auto helper_0 = 27 * x;
1483 result_0 = -helper_0 * y - helper_0 * z - 27.0 / 2.0 * pow(x, 2) + 18 * x - 27.0 / 2.0 * pow(y, 2) - 27 * y * z + 18 * y - 27.0 / 2.0 * pow(z, 2) + 18 * z - 11.0 / 2.0;
1484 val.col(1) = result_0;
1485 }
1486 {
1487 const auto helper_0 = 27 * x;
1488 result_0 = -helper_0 * y - helper_0 * z - 27.0 / 2.0 * pow(x, 2) + 18 * x - 27.0 / 2.0 * pow(y, 2) - 27 * y * z + 18 * y - 27.0 / 2.0 * pow(z, 2) + 18 * z - 11.0 / 2.0;
1489 val.col(2) = result_0;
1490 }
1491 }
1492 break;
1493 case 1:
1494 {
1495 {
1496 result_0 = (27.0 / 2.0) * pow(x, 2) - 9 * x + 1;
1497 val.col(0) = result_0;
1498 }
1499 {
1500 result_0.setZero();
1501 val.col(1) = result_0;
1502 }
1503 {
1504 result_0.setZero();
1505 val.col(2) = result_0;
1506 }
1507 }
1508 break;
1509 case 2:
1510 {
1511 {
1512 result_0.setZero();
1513 val.col(0) = result_0;
1514 }
1515 {
1516 result_0 = (27.0 / 2.0) * pow(y, 2) - 9 * y + 1;
1517 val.col(1) = result_0;
1518 }
1519 {
1520 result_0.setZero();
1521 val.col(2) = result_0;
1522 }
1523 }
1524 break;
1525 case 3:
1526 {
1527 {
1528 result_0.setZero();
1529 val.col(0) = result_0;
1530 }
1531 {
1532 result_0.setZero();
1533 val.col(1) = result_0;
1534 }
1535 {
1536 result_0 = (27.0 / 2.0) * pow(z, 2) - 9 * z + 1;
1537 val.col(2) = result_0;
1538 }
1539 }
1540 break;
1541 case 4:
1542 {
1543 {
1544 const auto helper_0 = 6 * x;
1545 result_0 = 9 * helper_0 * y + 9 * helper_0 * z + (81.0 / 2.0) * pow(x, 2) - 45 * x + (27.0 / 2.0) * pow(y, 2) + 27 * y * z - 45.0 / 2.0 * y + (27.0 / 2.0) * pow(z, 2) - 45.0 / 2.0 * z + 9;
1546 val.col(0) = result_0;
1547 }
1548 {
1549 result_0 = (9.0 / 2.0) * x * (6 * x + 6 * y + 6 * z - 5);
1550 val.col(1) = result_0;
1551 }
1552 {
1553 result_0 = (9.0 / 2.0) * x * (6 * x + 6 * y + 6 * z - 5);
1554 val.col(2) = result_0;
1555 }
1556 }
1557 break;
1558 case 5:
1559 {
1560 {
1561 const auto helper_0 = 3 * x;
1562 result_0 = -9 * helper_0 * y - 9 * helper_0 * z - 81.0 / 2.0 * pow(x, 2) + 36 * x + (9.0 / 2.0) * y + (9.0 / 2.0) * z - 9.0 / 2.0;
1563 val.col(0) = result_0;
1564 }
1565 {
1566 result_0 = -9.0 / 2.0 * x * (3 * x - 1);
1567 val.col(1) = result_0;
1568 }
1569 {
1570 result_0 = -9.0 / 2.0 * x * (3 * x - 1);
1571 val.col(2) = result_0;
1572 }
1573 }
1574 break;
1575 case 6:
1576 {
1577 {
1578 result_0 = (9.0 / 2.0) * y * (6 * x - 1);
1579 val.col(0) = result_0;
1580 }
1581 {
1582 result_0 = (9.0 / 2.0) * x * (3 * x - 1);
1583 val.col(1) = result_0;
1584 }
1585 {
1586 result_0.setZero();
1587 val.col(2) = result_0;
1588 }
1589 }
1590 break;
1591 case 7:
1592 {
1593 {
1594 result_0 = (9.0 / 2.0) * y * (3 * y - 1);
1595 val.col(0) = result_0;
1596 }
1597 {
1598 result_0 = (9.0 / 2.0) * x * (6 * y - 1);
1599 val.col(1) = result_0;
1600 }
1601 {
1602 result_0.setZero();
1603 val.col(2) = result_0;
1604 }
1605 }
1606 break;
1607 case 8:
1608 {
1609 {
1610 result_0 = -9.0 / 2.0 * y * (3 * y - 1);
1611 val.col(0) = result_0;
1612 }
1613 {
1614 const auto helper_0 = 3 * y;
1615 result_0 = -9 * helper_0 * x - 9 * helper_0 * z + (9.0 / 2.0) * x - 81.0 / 2.0 * pow(y, 2) + 36 * y + (9.0 / 2.0) * z - 9.0 / 2.0;
1616 val.col(1) = result_0;
1617 }
1618 {
1619 result_0 = -9.0 / 2.0 * y * (3 * y - 1);
1620 val.col(2) = result_0;
1621 }
1622 }
1623 break;
1624 case 9:
1625 {
1626 {
1627 result_0 = (9.0 / 2.0) * y * (6 * x + 6 * y + 6 * z - 5);
1628 val.col(0) = result_0;
1629 }
1630 {
1631 const auto helper_0 = 6 * y;
1632 result_0 = 9 * helper_0 * x + 9 * helper_0 * z + (27.0 / 2.0) * pow(x, 2) + 27 * x * z - 45.0 / 2.0 * x + (81.0 / 2.0) * pow(y, 2) - 45 * y + (27.0 / 2.0) * pow(z, 2) - 45.0 / 2.0 * z + 9;
1633 val.col(1) = result_0;
1634 }
1635 {
1636 result_0 = (9.0 / 2.0) * y * (6 * x + 6 * y + 6 * z - 5);
1637 val.col(2) = result_0;
1638 }
1639 }
1640 break;
1641 case 10:
1642 {
1643 {
1644 result_0 = (9.0 / 2.0) * z * (6 * x + 6 * y + 6 * z - 5);
1645 val.col(0) = result_0;
1646 }
1647 {
1648 result_0 = (9.0 / 2.0) * z * (6 * x + 6 * y + 6 * z - 5);
1649 val.col(1) = result_0;
1650 }
1651 {
1652 const auto helper_0 = 6 * z;
1653 result_0 = 9 * helper_0 * x + 9 * helper_0 * y + (27.0 / 2.0) * pow(x, 2) + 27 * x * y - 45.0 / 2.0 * x + (27.0 / 2.0) * pow(y, 2) - 45.0 / 2.0 * y + (81.0 / 2.0) * pow(z, 2) - 45 * z + 9;
1654 val.col(2) = result_0;
1655 }
1656 }
1657 break;
1658 case 11:
1659 {
1660 {
1661 result_0 = -9.0 / 2.0 * z * (3 * z - 1);
1662 val.col(0) = result_0;
1663 }
1664 {
1665 result_0 = -9.0 / 2.0 * z * (3 * z - 1);
1666 val.col(1) = result_0;
1667 }
1668 {
1669 const auto helper_0 = 3 * z;
1670 result_0 = -9 * helper_0 * x - 9 * helper_0 * y + (9.0 / 2.0) * x + (9.0 / 2.0) * y - 81.0 / 2.0 * pow(z, 2) + 36 * z - 9.0 / 2.0;
1671 val.col(2) = result_0;
1672 }
1673 }
1674 break;
1675 case 12:
1676 {
1677 {
1678 result_0 = (9.0 / 2.0) * z * (6 * x - 1);
1679 val.col(0) = result_0;
1680 }
1681 {
1682 result_0.setZero();
1683 val.col(1) = result_0;
1684 }
1685 {
1686 result_0 = (9.0 / 2.0) * x * (3 * x - 1);
1687 val.col(2) = result_0;
1688 }
1689 }
1690 break;
1691 case 13:
1692 {
1693 {
1694 result_0 = (9.0 / 2.0) * z * (3 * z - 1);
1695 val.col(0) = result_0;
1696 }
1697 {
1698 result_0.setZero();
1699 val.col(1) = result_0;
1700 }
1701 {
1702 result_0 = (9.0 / 2.0) * x * (6 * z - 1);
1703 val.col(2) = result_0;
1704 }
1705 }
1706 break;
1707 case 14:
1708 {
1709 {
1710 result_0.setZero();
1711 val.col(0) = result_0;
1712 }
1713 {
1714 result_0 = (9.0 / 2.0) * z * (6 * y - 1);
1715 val.col(1) = result_0;
1716 }
1717 {
1718 result_0 = (9.0 / 2.0) * y * (3 * y - 1);
1719 val.col(2) = result_0;
1720 }
1721 }
1722 break;
1723 case 15:
1724 {
1725 {
1726 result_0.setZero();
1727 val.col(0) = result_0;
1728 }
1729 {
1730 result_0 = (9.0 / 2.0) * z * (3 * z - 1);
1731 val.col(1) = result_0;
1732 }
1733 {
1734 result_0 = (9.0 / 2.0) * y * (6 * z - 1);
1735 val.col(2) = result_0;
1736 }
1737 }
1738 break;
1739 case 16:
1740 {
1741 {
1742 result_0 = -27 * y * (2 * x + y + z - 1);
1743 val.col(0) = result_0;
1744 }
1745 {
1746 result_0 = -27 * x * (x + 2 * y + z - 1);
1747 val.col(1) = result_0;
1748 }
1749 {
1750 result_0 = -27 * x * y;
1751 val.col(2) = result_0;
1752 }
1753 }
1754 break;
1755 case 17:
1756 {
1757 {
1758 result_0 = -27 * z * (2 * x + y + z - 1);
1759 val.col(0) = result_0;
1760 }
1761 {
1762 result_0 = -27 * x * z;
1763 val.col(1) = result_0;
1764 }
1765 {
1766 result_0 = -27 * x * (x + y + 2 * z - 1);
1767 val.col(2) = result_0;
1768 }
1769 }
1770 break;
1771 case 18:
1772 {
1773 {
1774 result_0 = 27 * y * z;
1775 val.col(0) = result_0;
1776 }
1777 {
1778 result_0 = 27 * x * z;
1779 val.col(1) = result_0;
1780 }
1781 {
1782 result_0 = 27 * x * y;
1783 val.col(2) = result_0;
1784 }
1785 }
1786 break;
1787 case 19:
1788 {
1789 {
1790 result_0 = -27 * y * z;
1791 val.col(0) = result_0;
1792 }
1793 {
1794 result_0 = -27 * z * (x + 2 * y + z - 1);
1795 val.col(1) = result_0;
1796 }
1797 {
1798 result_0 = -27 * y * (x + y + 2 * z - 1);
1799 val.col(2) = result_0;
1800 }
1801 }
1802 break;
1803 default:
1804 assert(false);
1805 }
1806 }
1807
1808 void p_3_nodes_3d(Eigen::MatrixXd &res)
1809 {
1810 res.resize(20, 3);
1811 res << 0, 0, 0,
1812 1, 0, 0,
1813 0, 1, 0,
1814 0, 0, 1,
1815 1.0 / 3.0, 0, 0,
1816 2.0 / 3.0, 0, 0,
1817 2.0 / 3.0, 1.0 / 3.0, 0,
1818 1.0 / 3.0, 2.0 / 3.0, 0,
1819 0, 2.0 / 3.0, 0,
1820 0, 1.0 / 3.0, 0,
1821 0, 0, 1.0 / 3.0,
1822 0, 0, 2.0 / 3.0,
1823 2.0 / 3.0, 0, 1.0 / 3.0,
1824 1.0 / 3.0, 0, 2.0 / 3.0,
1825 0, 2.0 / 3.0, 1.0 / 3.0,
1826 0, 1.0 / 3.0, 2.0 / 3.0,
1827 1.0 / 3.0, 1.0 / 3.0, 0,
1828 1.0 / 3.0, 0, 1.0 / 3.0,
1829 1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0,
1830 0, 1.0 / 3.0, 1.0 / 3.0;
1831 }
1832
1833 void p_4_basis_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &result_0)
1834 {
1835
1836 auto x = uv.col(0).array();
1837 auto y = uv.col(1).array();
1838 auto z = uv.col(2).array();
1839
1840 switch (local_index)
1841 {
1842 case 0:
1843 {
1844 const auto helper_0 = x + y + z - 1;
1845 const auto helper_1 = x * y;
1846 const auto helper_2 = pow(y, 2);
1847 const auto helper_3 = 9 * x;
1848 const auto helper_4 = pow(z, 2);
1849 const auto helper_5 = pow(x, 2);
1850 const auto helper_6 = 9 * y;
1851 const auto helper_7 = 9 * z;
1852 const auto helper_8 = 26 * helper_0;
1853 const auto helper_9 = helper_8 * z;
1854 const auto helper_10 = 13 * pow(helper_0, 2);
1855 const auto helper_11 = 13 * helper_0;
1856 result_0 = (1.0 / 3.0) * helper_0 * (3 * pow(helper_0, 3) + helper_1 * helper_8 + 18 * helper_1 * z + helper_10 * x + helper_10 * y + helper_10 * z + helper_11 * helper_2 + helper_11 * helper_4 + helper_11 * helper_5 + helper_2 * helper_3 + helper_2 * helper_7 + helper_3 * helper_4 + helper_4 * helper_6 + helper_5 * helper_6 + helper_5 * helper_7 + helper_9 * x + helper_9 * y + 3 * pow(x, 3) + 3 * pow(y, 3) + 3 * pow(z, 3));
1857 }
1858 break;
1859 case 1:
1860 {
1861 result_0 = (1.0 / 3.0) * x * (32 * pow(x, 3) - 48 * pow(x, 2) + 22 * x - 3);
1862 }
1863 break;
1864 case 2:
1865 {
1866 result_0 = (1.0 / 3.0) * y * (32 * pow(y, 3) - 48 * pow(y, 2) + 22 * y - 3);
1867 }
1868 break;
1869 case 3:
1870 {
1871 result_0 = (1.0 / 3.0) * z * (32 * pow(z, 3) - 48 * pow(z, 2) + 22 * z - 3);
1872 }
1873 break;
1874 case 4:
1875 {
1876 const auto helper_0 = 36 * x;
1877 const auto helper_1 = y * z;
1878 const auto helper_2 = pow(x, 2);
1879 const auto helper_3 = pow(y, 2);
1880 const auto helper_4 = pow(z, 2);
1881 const auto helper_5 = 24 * x;
1882 const auto helper_6 = 24 * y;
1883 const auto helper_7 = 24 * z;
1884 result_0 = -16.0 / 3.0 * x * (-helper_0 * y - helper_0 * z + 48 * helper_1 * x - 36 * helper_1 + helper_2 * helper_6 + helper_2 * helper_7 - 18 * helper_2 + helper_3 * helper_5 + helper_3 * helper_7 - 18 * helper_3 + helper_4 * helper_5 + helper_4 * helper_6 - 18 * helper_4 + 8 * pow(x, 3) + 13 * x + 8 * pow(y, 3) + 13 * y + 8 * pow(z, 3) + 13 * z - 3);
1885 }
1886 break;
1887 case 5:
1888 {
1889 const auto helper_0 = 2 * y;
1890 const auto helper_1 = 2 * z;
1891 const auto helper_2 = x + y + z - 1;
1892 const auto helper_3 = helper_2 * x;
1893 result_0 = 4 * helper_3 * (-helper_0 * helper_2 + helper_0 * x - helper_0 * z - helper_1 * helper_2 + helper_1 * x + 3 * pow(helper_2, 2) + 10 * helper_3 + 3 * pow(x, 2) - pow(y, 2) - pow(z, 2));
1894 }
1895 break;
1896 case 6:
1897 {
1898 const auto helper_0 = 6 * x;
1899 const auto helper_1 = pow(x, 2);
1900 const auto helper_2 = 8 * helper_1;
1901 result_0 = -16.0 / 3.0 * x * (-helper_0 * y - helper_0 * z - 14 * helper_1 + helper_2 * y + helper_2 * z + 8 * pow(x, 3) + 7 * x + y + z - 1);
1902 }
1903 break;
1904 case 7:
1905 {
1906 result_0 = (16.0 / 3.0) * x * y * (8 * pow(x, 2) - 6 * x + 1);
1907 }
1908 break;
1909 case 8:
1910 {
1911 const auto helper_0 = 4 * x;
1912 result_0 = helper_0 * y * (-helper_0 + 16 * x * y - 4 * y + 1);
1913 }
1914 break;
1915 case 9:
1916 {
1917 result_0 = (16.0 / 3.0) * x * y * (8 * pow(y, 2) - 6 * y + 1);
1918 }
1919 break;
1920 case 10:
1921 {
1922 const auto helper_0 = 6 * y;
1923 const auto helper_1 = pow(y, 2);
1924 const auto helper_2 = 8 * helper_1;
1925 result_0 = -16.0 / 3.0 * y * (-helper_0 * x - helper_0 * z - 14 * helper_1 + helper_2 * x + helper_2 * z + x + 8 * pow(y, 3) + 7 * y + z - 1);
1926 }
1927 break;
1928 case 11:
1929 {
1930 const auto helper_0 = 2 * y;
1931 const auto helper_1 = 2 * x;
1932 const auto helper_2 = x + y + z - 1;
1933 const auto helper_3 = helper_2 * y;
1934 result_0 = -4 * helper_3 * (-helper_0 * x - helper_0 * z + helper_1 * helper_2 + helper_1 * z - 3 * pow(helper_2, 2) + 2 * helper_2 * z - 10 * helper_3 + pow(x, 2) - 3 * pow(y, 2) + pow(z, 2));
1935 }
1936 break;
1937 case 12:
1938 {
1939 const auto helper_0 = 36 * x;
1940 const auto helper_1 = y * z;
1941 const auto helper_2 = pow(x, 2);
1942 const auto helper_3 = pow(y, 2);
1943 const auto helper_4 = pow(z, 2);
1944 const auto helper_5 = 24 * x;
1945 const auto helper_6 = 24 * y;
1946 const auto helper_7 = 24 * z;
1947 result_0 = -16.0 / 3.0 * y * (-helper_0 * y - helper_0 * z + 48 * helper_1 * x - 36 * helper_1 + helper_2 * helper_6 + helper_2 * helper_7 - 18 * helper_2 + helper_3 * helper_5 + helper_3 * helper_7 - 18 * helper_3 + helper_4 * helper_5 + helper_4 * helper_6 - 18 * helper_4 + 8 * pow(x, 3) + 13 * x + 8 * pow(y, 3) + 13 * y + 8 * pow(z, 3) + 13 * z - 3);
1948 }
1949 break;
1950 case 13:
1951 {
1952 const auto helper_0 = 36 * x;
1953 const auto helper_1 = y * z;
1954 const auto helper_2 = pow(x, 2);
1955 const auto helper_3 = pow(y, 2);
1956 const auto helper_4 = pow(z, 2);
1957 const auto helper_5 = 24 * x;
1958 const auto helper_6 = 24 * y;
1959 const auto helper_7 = 24 * z;
1960 result_0 = -16.0 / 3.0 * z * (-helper_0 * y - helper_0 * z + 48 * helper_1 * x - 36 * helper_1 + helper_2 * helper_6 + helper_2 * helper_7 - 18 * helper_2 + helper_3 * helper_5 + helper_3 * helper_7 - 18 * helper_3 + helper_4 * helper_5 + helper_4 * helper_6 - 18 * helper_4 + 8 * pow(x, 3) + 13 * x + 8 * pow(y, 3) + 13 * y + 8 * pow(z, 3) + 13 * z - 3);
1961 }
1962 break;
1963 case 14:
1964 {
1965 const auto helper_0 = 2 * x;
1966 const auto helper_1 = 2 * z;
1967 const auto helper_2 = x + y + z - 1;
1968 const auto helper_3 = helper_2 * z;
1969 result_0 = -4 * helper_3 * (helper_0 * helper_2 + helper_0 * y - helper_1 * x - helper_1 * y - 3 * pow(helper_2, 2) + 2 * helper_2 * y - 10 * helper_3 + pow(x, 2) + pow(y, 2) - 3 * pow(z, 2));
1970 }
1971 break;
1972 case 15:
1973 {
1974 const auto helper_0 = 6 * z;
1975 const auto helper_1 = pow(z, 2);
1976 const auto helper_2 = 8 * helper_1;
1977 result_0 = -16.0 / 3.0 * z * (-helper_0 * x - helper_0 * y - 14 * helper_1 + helper_2 * x + helper_2 * y + x + y + 8 * pow(z, 3) + 7 * z - 1);
1978 }
1979 break;
1980 case 16:
1981 {
1982 result_0 = (16.0 / 3.0) * x * z * (8 * pow(x, 2) - 6 * x + 1);
1983 }
1984 break;
1985 case 17:
1986 {
1987 const auto helper_0 = 4 * x;
1988 result_0 = helper_0 * z * (-helper_0 + 16 * x * z - 4 * z + 1);
1989 }
1990 break;
1991 case 18:
1992 {
1993 result_0 = (16.0 / 3.0) * x * z * (8 * pow(z, 2) - 6 * z + 1);
1994 }
1995 break;
1996 case 19:
1997 {
1998 result_0 = (16.0 / 3.0) * y * z * (8 * pow(y, 2) - 6 * y + 1);
1999 }
2000 break;
2001 case 20:
2002 {
2003 const auto helper_0 = 4 * y;
2004 result_0 = helper_0 * z * (-helper_0 + 16 * y * z - 4 * z + 1);
2005 }
2006 break;
2007 case 21:
2008 {
2009 result_0 = (16.0 / 3.0) * y * z * (8 * pow(z, 2) - 6 * z + 1);
2010 }
2011 break;
2012 case 22:
2013 {
2014 result_0 = 32 * x * y * (x + y + z - 1) * (4 * x + 4 * y + 4 * z - 3);
2015 }
2016 break;
2017 case 23:
2018 {
2019 result_0 = -32 * x * y * (4 * y - 1) * (x + y + z - 1);
2020 }
2021 break;
2022 case 24:
2023 {
2024 result_0 = -32 * x * y * (4 * x - 1) * (x + y + z - 1);
2025 }
2026 break;
2027 case 25:
2028 {
2029 result_0 = 32 * x * z * (x + y + z - 1) * (4 * x + 4 * y + 4 * z - 3);
2030 }
2031 break;
2032 case 26:
2033 {
2034 result_0 = -32 * x * z * (4 * z - 1) * (x + y + z - 1);
2035 }
2036 break;
2037 case 27:
2038 {
2039 result_0 = -32 * x * z * (4 * x - 1) * (x + y + z - 1);
2040 }
2041 break;
2042 case 28:
2043 {
2044 result_0 = 32 * x * y * z * (4 * x - 1);
2045 }
2046 break;
2047 case 29:
2048 {
2049 result_0 = 32 * x * y * z * (4 * z - 1);
2050 }
2051 break;
2052 case 30:
2053 {
2054 result_0 = 32 * x * y * z * (4 * y - 1);
2055 }
2056 break;
2057 case 31:
2058 {
2059 result_0 = -32 * y * z * (4 * y - 1) * (x + y + z - 1);
2060 }
2061 break;
2062 case 32:
2063 {
2064 result_0 = -32 * y * z * (4 * z - 1) * (x + y + z - 1);
2065 }
2066 break;
2067 case 33:
2068 {
2069 result_0 = 32 * y * z * (x + y + z - 1) * (4 * x + 4 * y + 4 * z - 3);
2070 }
2071 break;
2072 case 34:
2073 {
2074 result_0 = -256 * x * y * z * (x + y + z - 1);
2075 }
2076 break;
2077 default:
2078 assert(false);
2079 }
2080 }
2081 void p_4_basis_grad_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
2082 {
2083
2084 auto x = uv.col(0).array();
2085 auto y = uv.col(1).array();
2086 auto z = uv.col(2).array();
2087
2088 val.resize(uv.rows(), uv.cols());
2089 Eigen::ArrayXd result_0(uv.rows());
2090 switch (local_index)
2091 {
2092 case 0:
2093 {
2094 {
2095 const auto helper_0 = 160 * x;
2096 const auto helper_1 = y * z;
2097 const auto helper_2 = pow(x, 2);
2098 const auto helper_3 = pow(y, 2);
2099 const auto helper_4 = pow(z, 2);
2100 const auto helper_5 = 128 * x;
2101 const auto helper_6 = 128 * y;
2102 const auto helper_7 = 128 * z;
2103 result_0 = -helper_0 * y - helper_0 * z + 256 * helper_1 * x - 160 * helper_1 + helper_2 * helper_6 + helper_2 * helper_7 - 80 * helper_2 + helper_3 * helper_5 + helper_3 * helper_7 - 80 * helper_3 + helper_4 * helper_5 + helper_4 * helper_6 - 80 * helper_4 + (128.0 / 3.0) * pow(x, 3) + (140.0 / 3.0) * x + (128.0 / 3.0) * pow(y, 3) + (140.0 / 3.0) * y + (128.0 / 3.0) * pow(z, 3) + (140.0 / 3.0) * z - 25.0 / 3.0;
2104 val.col(0) = result_0;
2105 }
2106 {
2107 const auto helper_0 = 160 * x;
2108 const auto helper_1 = y * z;
2109 const auto helper_2 = pow(x, 2);
2110 const auto helper_3 = pow(y, 2);
2111 const auto helper_4 = pow(z, 2);
2112 const auto helper_5 = 128 * x;
2113 const auto helper_6 = 128 * y;
2114 const auto helper_7 = 128 * z;
2115 result_0 = -helper_0 * y - helper_0 * z + 256 * helper_1 * x - 160 * helper_1 + helper_2 * helper_6 + helper_2 * helper_7 - 80 * helper_2 + helper_3 * helper_5 + helper_3 * helper_7 - 80 * helper_3 + helper_4 * helper_5 + helper_4 * helper_6 - 80 * helper_4 + (128.0 / 3.0) * pow(x, 3) + (140.0 / 3.0) * x + (128.0 / 3.0) * pow(y, 3) + (140.0 / 3.0) * y + (128.0 / 3.0) * pow(z, 3) + (140.0 / 3.0) * z - 25.0 / 3.0;
2116 val.col(1) = result_0;
2117 }
2118 {
2119 const auto helper_0 = 160 * x;
2120 const auto helper_1 = y * z;
2121 const auto helper_2 = pow(x, 2);
2122 const auto helper_3 = pow(y, 2);
2123 const auto helper_4 = pow(z, 2);
2124 const auto helper_5 = 128 * x;
2125 const auto helper_6 = 128 * y;
2126 const auto helper_7 = 128 * z;
2127 result_0 = -helper_0 * y - helper_0 * z + 256 * helper_1 * x - 160 * helper_1 + helper_2 * helper_6 + helper_2 * helper_7 - 80 * helper_2 + helper_3 * helper_5 + helper_3 * helper_7 - 80 * helper_3 + helper_4 * helper_5 + helper_4 * helper_6 - 80 * helper_4 + (128.0 / 3.0) * pow(x, 3) + (140.0 / 3.0) * x + (128.0 / 3.0) * pow(y, 3) + (140.0 / 3.0) * y + (128.0 / 3.0) * pow(z, 3) + (140.0 / 3.0) * z - 25.0 / 3.0;
2128 val.col(2) = result_0;
2129 }
2130 }
2131 break;
2132 case 1:
2133 {
2134 {
2135 result_0 = (128.0 / 3.0) * pow(x, 3) - 48 * pow(x, 2) + (44.0 / 3.0) * x - 1;
2136 val.col(0) = result_0;
2137 }
2138 {
2139 result_0.setZero();
2140 val.col(1) = result_0;
2141 }
2142 {
2143 result_0.setZero();
2144 val.col(2) = result_0;
2145 }
2146 }
2147 break;
2148 case 2:
2149 {
2150 {
2151 result_0.setZero();
2152 val.col(0) = result_0;
2153 }
2154 {
2155 result_0 = (128.0 / 3.0) * pow(y, 3) - 48 * pow(y, 2) + (44.0 / 3.0) * y - 1;
2156 val.col(1) = result_0;
2157 }
2158 {
2159 result_0.setZero();
2160 val.col(2) = result_0;
2161 }
2162 }
2163 break;
2164 case 3:
2165 {
2166 {
2167 result_0.setZero();
2168 val.col(0) = result_0;
2169 }
2170 {
2171 result_0.setZero();
2172 val.col(1) = result_0;
2173 }
2174 {
2175 result_0 = (128.0 / 3.0) * pow(z, 3) - 48 * pow(z, 2) + (44.0 / 3.0) * z - 1;
2176 val.col(2) = result_0;
2177 }
2178 }
2179 break;
2180 case 4:
2181 {
2182 {
2183 const auto helper_0 = pow(x, 2);
2184 const auto helper_1 = pow(y, 2);
2185 const auto helper_2 = pow(z, 2);
2186 const auto helper_3 = 16 * x;
2187 const auto helper_4 = 24 * helper_0;
2188 result_0 = 288 * helper_0 - 16 * helper_1 * helper_3 - 128 * helper_1 * z + 96 * helper_1 - 16 * helper_2 * helper_3 - 128 * helper_2 * y + 96 * helper_2 - 16 * helper_4 * y - 16 * helper_4 * z - 512.0 / 3.0 * pow(x, 3) - 512 * x * y * z + 384 * x * y + 384 * x * z - 416.0 / 3.0 * x - 128.0 / 3.0 * pow(y, 3) + 192 * y * z - 208.0 / 3.0 * y - 128.0 / 3.0 * pow(z, 3) - 208.0 / 3.0 * z + 16;
2189 val.col(0) = result_0;
2190 }
2191 {
2192 const auto helper_0 = 48 * x;
2193 result_0 = -16.0 / 3.0 * x * (helper_0 * y + helper_0 * z + 24 * pow(x, 2) - 36 * x + 24 * pow(y, 2) + 48 * y * z - 36 * y + 24 * pow(z, 2) - 36 * z + 13);
2194 val.col(1) = result_0;
2195 }
2196 {
2197 const auto helper_0 = 48 * x;
2198 result_0 = -16.0 / 3.0 * x * (helper_0 * y + helper_0 * z + 24 * pow(x, 2) - 36 * x + 24 * pow(y, 2) + 48 * y * z - 36 * y + 24 * pow(z, 2) - 36 * z + 13);
2199 val.col(2) = result_0;
2200 }
2201 }
2202 break;
2203 case 5:
2204 {
2205 {
2206 const auto helper_0 = 72 * x;
2207 const auto helper_1 = y * z;
2208 const auto helper_2 = 96 * pow(x, 2);
2209 const auto helper_3 = pow(y, 2);
2210 const auto helper_4 = pow(z, 2);
2211 const auto helper_5 = 32 * x;
2212 result_0 = -4 * helper_0 * y - 4 * helper_0 * z + 256 * helper_1 * x - 32 * helper_1 + 4 * helper_2 * y + 4 * helper_2 * z - 4 * helper_2 + 4 * helper_3 * helper_5 - 16 * helper_3 + 4 * helper_4 * helper_5 - 16 * helper_4 + 256 * pow(x, 3) + 152 * x + 28 * y + 28 * z - 12;
2213 val.col(0) = result_0;
2214 }
2215 {
2216 const auto helper_0 = 32 * x;
2217 result_0 = 4 * x * (helper_0 * y + helper_0 * z + 32 * pow(x, 2) - 36 * x - 8 * y - 8 * z + 7);
2218 val.col(1) = result_0;
2219 }
2220 {
2221 const auto helper_0 = 32 * x;
2222 result_0 = 4 * x * (helper_0 * y + helper_0 * z + 32 * pow(x, 2) - 36 * x - 8 * y - 8 * z + 7);
2223 val.col(2) = result_0;
2224 }
2225 }
2226 break;
2227 case 6:
2228 {
2229 {
2230 const auto helper_0 = pow(x, 2);
2231 const auto helper_1 = 8 * helper_0;
2232 result_0 = 224 * helper_0 - 16 * helper_1 * y - 16 * helper_1 * z - 512.0 / 3.0 * pow(x, 3) + 64 * x * y + 64 * x * z - 224.0 / 3.0 * x - 16.0 / 3.0 * y - 16.0 / 3.0 * z + 16.0 / 3.0;
2233 val.col(0) = result_0;
2234 }
2235 {
2236 result_0 = -16.0 / 3.0 * x * (8 * pow(x, 2) - 6 * x + 1);
2237 val.col(1) = result_0;
2238 }
2239 {
2240 result_0 = -16.0 / 3.0 * x * (8 * pow(x, 2) - 6 * x + 1);
2241 val.col(2) = result_0;
2242 }
2243 }
2244 break;
2245 case 7:
2246 {
2247 {
2248 result_0 = (16.0 / 3.0) * y * (24 * pow(x, 2) - 12 * x + 1);
2249 val.col(0) = result_0;
2250 }
2251 {
2252 result_0 = (16.0 / 3.0) * x * (8 * pow(x, 2) - 6 * x + 1);
2253 val.col(1) = result_0;
2254 }
2255 {
2256 result_0.setZero();
2257 val.col(2) = result_0;
2258 }
2259 }
2260 break;
2261 case 8:
2262 {
2263 {
2264 const auto helper_0 = 4 * y;
2265 result_0 = helper_0 * (-helper_0 + 32 * x * y - 8 * x + 1);
2266 val.col(0) = result_0;
2267 }
2268 {
2269 const auto helper_0 = 4 * x;
2270 result_0 = helper_0 * (-helper_0 + 32 * x * y - 8 * y + 1);
2271 val.col(1) = result_0;
2272 }
2273 {
2274 result_0.setZero();
2275 val.col(2) = result_0;
2276 }
2277 }
2278 break;
2279 case 9:
2280 {
2281 {
2282 result_0 = (16.0 / 3.0) * y * (8 * pow(y, 2) - 6 * y + 1);
2283 val.col(0) = result_0;
2284 }
2285 {
2286 result_0 = (16.0 / 3.0) * x * (24 * pow(y, 2) - 12 * y + 1);
2287 val.col(1) = result_0;
2288 }
2289 {
2290 result_0.setZero();
2291 val.col(2) = result_0;
2292 }
2293 }
2294 break;
2295 case 10:
2296 {
2297 {
2298 result_0 = -16.0 / 3.0 * y * (8 * pow(y, 2) - 6 * y + 1);
2299 val.col(0) = result_0;
2300 }
2301 {
2302 const auto helper_0 = pow(y, 2);
2303 const auto helper_1 = 8 * helper_0;
2304 result_0 = 224 * helper_0 - 16 * helper_1 * x - 16 * helper_1 * z + 64 * x * y - 16.0 / 3.0 * x - 512.0 / 3.0 * pow(y, 3) + 64 * y * z - 224.0 / 3.0 * y - 16.0 / 3.0 * z + 16.0 / 3.0;
2305 val.col(1) = result_0;
2306 }
2307 {
2308 result_0 = -16.0 / 3.0 * y * (8 * pow(y, 2) - 6 * y + 1);
2309 val.col(2) = result_0;
2310 }
2311 }
2312 break;
2313 case 11:
2314 {
2315 {
2316 const auto helper_0 = 32 * y;
2317 result_0 = 4 * y * (helper_0 * x + helper_0 * z - 8 * x + 32 * pow(y, 2) - 36 * y - 8 * z + 7);
2318 val.col(0) = result_0;
2319 }
2320 {
2321 const auto helper_0 = 72 * y;
2322 const auto helper_1 = x * z;
2323 const auto helper_2 = pow(x, 2);
2324 const auto helper_3 = 96 * pow(y, 2);
2325 const auto helper_4 = pow(z, 2);
2326 const auto helper_5 = 32 * y;
2327 result_0 = -4 * helper_0 * x - 4 * helper_0 * z + 256 * helper_1 * y - 32 * helper_1 + 4 * helper_2 * helper_5 - 16 * helper_2 + 4 * helper_3 * x + 4 * helper_3 * z - 4 * helper_3 + 4 * helper_4 * helper_5 - 16 * helper_4 + 28 * x + 256 * pow(y, 3) + 152 * y + 28 * z - 12;
2328 val.col(1) = result_0;
2329 }
2330 {
2331 const auto helper_0 = 32 * y;
2332 result_0 = 4 * y * (helper_0 * x + helper_0 * z - 8 * x + 32 * pow(y, 2) - 36 * y - 8 * z + 7);
2333 val.col(2) = result_0;
2334 }
2335 }
2336 break;
2337 case 12:
2338 {
2339 {
2340 const auto helper_0 = 48 * x;
2341 result_0 = -16.0 / 3.0 * y * (helper_0 * y + helper_0 * z + 24 * pow(x, 2) - 36 * x + 24 * pow(y, 2) + 48 * y * z - 36 * y + 24 * pow(z, 2) - 36 * z + 13);
2342 val.col(0) = result_0;
2343 }
2344 {
2345 const auto helper_0 = pow(x, 2);
2346 const auto helper_1 = pow(y, 2);
2347 const auto helper_2 = pow(z, 2);
2348 const auto helper_3 = 24 * helper_1;
2349 const auto helper_4 = 16 * y;
2350 result_0 = -16 * helper_0 * helper_4 - 128 * helper_0 * z + 96 * helper_0 + 288 * helper_1 - 16 * helper_2 * helper_4 - 128 * helper_2 * x + 96 * helper_2 - 16 * helper_3 * x - 16 * helper_3 * z - 128.0 / 3.0 * pow(x, 3) - 512 * x * y * z + 384 * x * y + 192 * x * z - 208.0 / 3.0 * x - 512.0 / 3.0 * pow(y, 3) + 384 * y * z - 416.0 / 3.0 * y - 128.0 / 3.0 * pow(z, 3) - 208.0 / 3.0 * z + 16;
2351 val.col(1) = result_0;
2352 }
2353 {
2354 const auto helper_0 = 48 * x;
2355 result_0 = -16.0 / 3.0 * y * (helper_0 * y + helper_0 * z + 24 * pow(x, 2) - 36 * x + 24 * pow(y, 2) + 48 * y * z - 36 * y + 24 * pow(z, 2) - 36 * z + 13);
2356 val.col(2) = result_0;
2357 }
2358 }
2359 break;
2360 case 13:
2361 {
2362 {
2363 const auto helper_0 = 48 * x;
2364 result_0 = -16.0 / 3.0 * z * (helper_0 * y + helper_0 * z + 24 * pow(x, 2) - 36 * x + 24 * pow(y, 2) + 48 * y * z - 36 * y + 24 * pow(z, 2) - 36 * z + 13);
2365 val.col(0) = result_0;
2366 }
2367 {
2368 const auto helper_0 = 48 * x;
2369 result_0 = -16.0 / 3.0 * z * (helper_0 * y + helper_0 * z + 24 * pow(x, 2) - 36 * x + 24 * pow(y, 2) + 48 * y * z - 36 * y + 24 * pow(z, 2) - 36 * z + 13);
2370 val.col(1) = result_0;
2371 }
2372 {
2373 const auto helper_0 = pow(x, 2);
2374 const auto helper_1 = pow(y, 2);
2375 const auto helper_2 = pow(z, 2);
2376 const auto helper_3 = 24 * helper_2;
2377 const auto helper_4 = 16 * z;
2378 result_0 = -16 * helper_0 * helper_4 - 128 * helper_0 * y + 96 * helper_0 - 16 * helper_1 * helper_4 - 128 * helper_1 * x + 96 * helper_1 + 288 * helper_2 - 16 * helper_3 * x - 16 * helper_3 * y - 128.0 / 3.0 * pow(x, 3) - 512 * x * y * z + 192 * x * y + 384 * x * z - 208.0 / 3.0 * x - 128.0 / 3.0 * pow(y, 3) + 384 * y * z - 208.0 / 3.0 * y - 512.0 / 3.0 * pow(z, 3) - 416.0 / 3.0 * z + 16;
2379 val.col(2) = result_0;
2380 }
2381 }
2382 break;
2383 case 14:
2384 {
2385 {
2386 const auto helper_0 = 32 * z;
2387 result_0 = 4 * z * (helper_0 * x + helper_0 * y - 8 * x - 8 * y + 32 * pow(z, 2) - 36 * z + 7);
2388 val.col(0) = result_0;
2389 }
2390 {
2391 const auto helper_0 = 32 * z;
2392 result_0 = 4 * z * (helper_0 * x + helper_0 * y - 8 * x - 8 * y + 32 * pow(z, 2) - 36 * z + 7);
2393 val.col(1) = result_0;
2394 }
2395 {
2396 const auto helper_0 = x * y;
2397 const auto helper_1 = 72 * z;
2398 const auto helper_2 = pow(x, 2);
2399 const auto helper_3 = pow(y, 2);
2400 const auto helper_4 = 96 * pow(z, 2);
2401 const auto helper_5 = 32 * z;
2402 result_0 = 256 * helper_0 * z - 32 * helper_0 - 4 * helper_1 * x - 4 * helper_1 * y + 4 * helper_2 * helper_5 - 16 * helper_2 + 4 * helper_3 * helper_5 - 16 * helper_3 + 4 * helper_4 * x + 4 * helper_4 * y - 4 * helper_4 + 28 * x + 28 * y + 256 * pow(z, 3) + 152 * z - 12;
2403 val.col(2) = result_0;
2404 }
2405 }
2406 break;
2407 case 15:
2408 {
2409 {
2410 result_0 = -16.0 / 3.0 * z * (8 * pow(z, 2) - 6 * z + 1);
2411 val.col(0) = result_0;
2412 }
2413 {
2414 result_0 = -16.0 / 3.0 * z * (8 * pow(z, 2) - 6 * z + 1);
2415 val.col(1) = result_0;
2416 }
2417 {
2418 const auto helper_0 = pow(z, 2);
2419 const auto helper_1 = 8 * helper_0;
2420 result_0 = 224 * helper_0 - 16 * helper_1 * x - 16 * helper_1 * y + 64 * x * z - 16.0 / 3.0 * x + 64 * y * z - 16.0 / 3.0 * y - 512.0 / 3.0 * pow(z, 3) - 224.0 / 3.0 * z + 16.0 / 3.0;
2421 val.col(2) = result_0;
2422 }
2423 }
2424 break;
2425 case 16:
2426 {
2427 {
2428 result_0 = (16.0 / 3.0) * z * (24 * pow(x, 2) - 12 * x + 1);
2429 val.col(0) = result_0;
2430 }
2431 {
2432 result_0.setZero();
2433 val.col(1) = result_0;
2434 }
2435 {
2436 result_0 = (16.0 / 3.0) * x * (8 * pow(x, 2) - 6 * x + 1);
2437 val.col(2) = result_0;
2438 }
2439 }
2440 break;
2441 case 17:
2442 {
2443 {
2444 const auto helper_0 = 4 * z;
2445 result_0 = helper_0 * (-helper_0 + 32 * x * z - 8 * x + 1);
2446 val.col(0) = result_0;
2447 }
2448 {
2449 result_0.setZero();
2450 val.col(1) = result_0;
2451 }
2452 {
2453 const auto helper_0 = 4 * x;
2454 result_0 = helper_0 * (-helper_0 + 32 * x * z - 8 * z + 1);
2455 val.col(2) = result_0;
2456 }
2457 }
2458 break;
2459 case 18:
2460 {
2461 {
2462 result_0 = (16.0 / 3.0) * z * (8 * pow(z, 2) - 6 * z + 1);
2463 val.col(0) = result_0;
2464 }
2465 {
2466 result_0.setZero();
2467 val.col(1) = result_0;
2468 }
2469 {
2470 result_0 = (16.0 / 3.0) * x * (24 * pow(z, 2) - 12 * z + 1);
2471 val.col(2) = result_0;
2472 }
2473 }
2474 break;
2475 case 19:
2476 {
2477 {
2478 result_0.setZero();
2479 val.col(0) = result_0;
2480 }
2481 {
2482 result_0 = (16.0 / 3.0) * z * (24 * pow(y, 2) - 12 * y + 1);
2483 val.col(1) = result_0;
2484 }
2485 {
2486 result_0 = (16.0 / 3.0) * y * (8 * pow(y, 2) - 6 * y + 1);
2487 val.col(2) = result_0;
2488 }
2489 }
2490 break;
2491 case 20:
2492 {
2493 {
2494 result_0.setZero();
2495 val.col(0) = result_0;
2496 }
2497 {
2498 const auto helper_0 = 4 * z;
2499 result_0 = helper_0 * (-helper_0 + 32 * y * z - 8 * y + 1);
2500 val.col(1) = result_0;
2501 }
2502 {
2503 const auto helper_0 = 4 * y;
2504 result_0 = helper_0 * (-helper_0 + 32 * y * z - 8 * z + 1);
2505 val.col(2) = result_0;
2506 }
2507 }
2508 break;
2509 case 21:
2510 {
2511 {
2512 result_0.setZero();
2513 val.col(0) = result_0;
2514 }
2515 {
2516 result_0 = (16.0 / 3.0) * z * (8 * pow(z, 2) - 6 * z + 1);
2517 val.col(1) = result_0;
2518 }
2519 {
2520 result_0 = (16.0 / 3.0) * y * (24 * pow(z, 2) - 12 * z + 1);
2521 val.col(2) = result_0;
2522 }
2523 }
2524 break;
2525 case 22:
2526 {
2527 {
2528 const auto helper_0 = 16 * x;
2529 result_0 = 32 * y * (helper_0 * y + helper_0 * z + 12 * pow(x, 2) - 14 * x + 4 * pow(y, 2) + 8 * y * z - 7 * y + 4 * pow(z, 2) - 7 * z + 3);
2530 val.col(0) = result_0;
2531 }
2532 {
2533 const auto helper_0 = 16 * y;
2534 result_0 = 32 * x * (helper_0 * x + helper_0 * z + 4 * pow(x, 2) + 8 * x * z - 7 * x + 12 * pow(y, 2) - 14 * y + 4 * pow(z, 2) - 7 * z + 3);
2535 val.col(1) = result_0;
2536 }
2537 {
2538 result_0 = 32 * x * y * (8 * x + 8 * y + 8 * z - 7);
2539 val.col(2) = result_0;
2540 }
2541 }
2542 break;
2543 case 23:
2544 {
2545 {
2546 result_0 = -32 * y * (8 * x * y - 2 * x + 4 * pow(y, 2) + 4 * y * z - 5 * y - z + 1);
2547 val.col(0) = result_0;
2548 }
2549 {
2550 const auto helper_0 = 8 * y;
2551 result_0 = -32 * x * (helper_0 * x + helper_0 * z - x + 12 * pow(y, 2) - 10 * y - z + 1);
2552 val.col(1) = result_0;
2553 }
2554 {
2555 result_0 = -32 * x * y * (4 * y - 1);
2556 val.col(2) = result_0;
2557 }
2558 }
2559 break;
2560 case 24:
2561 {
2562 {
2563 const auto helper_0 = 8 * x;
2564 result_0 = -32 * y * (helper_0 * y + helper_0 * z + 12 * pow(x, 2) - 10 * x - y - z + 1);
2565 val.col(0) = result_0;
2566 }
2567 {
2568 result_0 = -32 * x * (4 * pow(x, 2) + 8 * x * y + 4 * x * z - 5 * x - 2 * y - z + 1);
2569 val.col(1) = result_0;
2570 }
2571 {
2572 result_0 = -32 * x * y * (4 * x - 1);
2573 val.col(2) = result_0;
2574 }
2575 }
2576 break;
2577 case 25:
2578 {
2579 {
2580 const auto helper_0 = 16 * x;
2581 result_0 = 32 * z * (helper_0 * y + helper_0 * z + 12 * pow(x, 2) - 14 * x + 4 * pow(y, 2) + 8 * y * z - 7 * y + 4 * pow(z, 2) - 7 * z + 3);
2582 val.col(0) = result_0;
2583 }
2584 {
2585 result_0 = 32 * x * z * (8 * x + 8 * y + 8 * z - 7);
2586 val.col(1) = result_0;
2587 }
2588 {
2589 const auto helper_0 = 16 * z;
2590 result_0 = 32 * x * (helper_0 * x + helper_0 * y + 4 * pow(x, 2) + 8 * x * y - 7 * x + 4 * pow(y, 2) - 7 * y + 12 * pow(z, 2) - 14 * z + 3);
2591 val.col(2) = result_0;
2592 }
2593 }
2594 break;
2595 case 26:
2596 {
2597 {
2598 result_0 = -32 * z * (8 * x * z - 2 * x + 4 * y * z - y + 4 * pow(z, 2) - 5 * z + 1);
2599 val.col(0) = result_0;
2600 }
2601 {
2602 result_0 = -32 * x * z * (4 * z - 1);
2603 val.col(1) = result_0;
2604 }
2605 {
2606 const auto helper_0 = 8 * z;
2607 result_0 = -32 * x * (helper_0 * x + helper_0 * y - x - y + 12 * pow(z, 2) - 10 * z + 1);
2608 val.col(2) = result_0;
2609 }
2610 }
2611 break;
2612 case 27:
2613 {
2614 {
2615 const auto helper_0 = 8 * x;
2616 result_0 = -32 * z * (helper_0 * y + helper_0 * z + 12 * pow(x, 2) - 10 * x - y - z + 1);
2617 val.col(0) = result_0;
2618 }
2619 {
2620 result_0 = -32 * x * z * (4 * x - 1);
2621 val.col(1) = result_0;
2622 }
2623 {
2624 result_0 = -32 * x * (4 * pow(x, 2) + 4 * x * y + 8 * x * z - 5 * x - y - 2 * z + 1);
2625 val.col(2) = result_0;
2626 }
2627 }
2628 break;
2629 case 28:
2630 {
2631 {
2632 result_0 = 32 * y * z * (8 * x - 1);
2633 val.col(0) = result_0;
2634 }
2635 {
2636 result_0 = 32 * x * z * (4 * x - 1);
2637 val.col(1) = result_0;
2638 }
2639 {
2640 result_0 = 32 * x * y * (4 * x - 1);
2641 val.col(2) = result_0;
2642 }
2643 }
2644 break;
2645 case 29:
2646 {
2647 {
2648 result_0 = 32 * y * z * (4 * z - 1);
2649 val.col(0) = result_0;
2650 }
2651 {
2652 result_0 = 32 * x * z * (4 * z - 1);
2653 val.col(1) = result_0;
2654 }
2655 {
2656 result_0 = 32 * x * y * (8 * z - 1);
2657 val.col(2) = result_0;
2658 }
2659 }
2660 break;
2661 case 30:
2662 {
2663 {
2664 result_0 = 32 * y * z * (4 * y - 1);
2665 val.col(0) = result_0;
2666 }
2667 {
2668 result_0 = 32 * x * z * (8 * y - 1);
2669 val.col(1) = result_0;
2670 }
2671 {
2672 result_0 = 32 * x * y * (4 * y - 1);
2673 val.col(2) = result_0;
2674 }
2675 }
2676 break;
2677 case 31:
2678 {
2679 {
2680 result_0 = -32 * y * z * (4 * y - 1);
2681 val.col(0) = result_0;
2682 }
2683 {
2684 const auto helper_0 = 8 * y;
2685 result_0 = -32 * z * (helper_0 * x + helper_0 * z - x + 12 * pow(y, 2) - 10 * y - z + 1);
2686 val.col(1) = result_0;
2687 }
2688 {
2689 result_0 = -32 * y * (4 * x * y - x + 4 * pow(y, 2) + 8 * y * z - 5 * y - 2 * z + 1);
2690 val.col(2) = result_0;
2691 }
2692 }
2693 break;
2694 case 32:
2695 {
2696 {
2697 result_0 = -32 * y * z * (4 * z - 1);
2698 val.col(0) = result_0;
2699 }
2700 {
2701 result_0 = -32 * z * (4 * x * z - x + 8 * y * z - 2 * y + 4 * pow(z, 2) - 5 * z + 1);
2702 val.col(1) = result_0;
2703 }
2704 {
2705 const auto helper_0 = 8 * z;
2706 result_0 = -32 * y * (helper_0 * x + helper_0 * y - x - y + 12 * pow(z, 2) - 10 * z + 1);
2707 val.col(2) = result_0;
2708 }
2709 }
2710 break;
2711 case 33:
2712 {
2713 {
2714 result_0 = 32 * y * z * (8 * x + 8 * y + 8 * z - 7);
2715 val.col(0) = result_0;
2716 }
2717 {
2718 const auto helper_0 = 16 * y;
2719 result_0 = 32 * z * (helper_0 * x + helper_0 * z + 4 * pow(x, 2) + 8 * x * z - 7 * x + 12 * pow(y, 2) - 14 * y + 4 * pow(z, 2) - 7 * z + 3);
2720 val.col(1) = result_0;
2721 }
2722 {
2723 const auto helper_0 = 16 * z;
2724 result_0 = 32 * y * (helper_0 * x + helper_0 * y + 4 * pow(x, 2) + 8 * x * y - 7 * x + 4 * pow(y, 2) - 7 * y + 12 * pow(z, 2) - 14 * z + 3);
2725 val.col(2) = result_0;
2726 }
2727 }
2728 break;
2729 case 34:
2730 {
2731 {
2732 result_0 = -256 * y * z * (2 * x + y + z - 1);
2733 val.col(0) = result_0;
2734 }
2735 {
2736 result_0 = -256 * x * z * (x + 2 * y + z - 1);
2737 val.col(1) = result_0;
2738 }
2739 {
2740 result_0 = -256 * x * y * (x + y + 2 * z - 1);
2741 val.col(2) = result_0;
2742 }
2743 }
2744 break;
2745 default:
2746 assert(false);
2747 }
2748 }
2749
2750 void p_4_nodes_3d(Eigen::MatrixXd &res)
2751 {
2752 res.resize(35, 3);
2753 res << 0, 0, 0,
2754 1, 0, 0,
2755 0, 1, 0,
2756 0, 0, 1,
2757 1.0 / 4.0, 0, 0,
2758 1.0 / 2.0, 0, 0,
2759 3.0 / 4.0, 0, 0,
2760 3.0 / 4.0, 1.0 / 4.0, 0,
2761 1.0 / 2.0, 1.0 / 2.0, 0,
2762 1.0 / 4.0, 3.0 / 4.0, 0,
2763 0, 3.0 / 4.0, 0,
2764 0, 1.0 / 2.0, 0,
2765 0, 1.0 / 4.0, 0,
2766 0, 0, 1.0 / 4.0,
2767 0, 0, 1.0 / 2.0,
2768 0, 0, 3.0 / 4.0,
2769 3.0 / 4.0, 0, 1.0 / 4.0,
2770 1.0 / 2.0, 0, 1.0 / 2.0,
2771 1.0 / 4.0, 0, 3.0 / 4.0,
2772 0, 3.0 / 4.0, 1.0 / 4.0,
2773 0, 1.0 / 2.0, 1.0 / 2.0,
2774 0, 1.0 / 4.0, 3.0 / 4.0,
2775 1.0 / 4.0, 1.0 / 4.0, 0,
2776 1.0 / 4.0, 1.0 / 2.0, 0,
2777 1.0 / 2.0, 1.0 / 4.0, 0,
2778 1.0 / 4.0, 0, 1.0 / 4.0,
2779 1.0 / 4.0, 0, 1.0 / 2.0,
2780 1.0 / 2.0, 0, 1.0 / 4.0,
2781 1.0 / 2.0, 1.0 / 4.0, 1.0 / 4.0,
2782 1.0 / 4.0, 1.0 / 4.0, 1.0 / 2.0,
2783 1.0 / 4.0, 1.0 / 2.0, 1.0 / 4.0,
2784 0, 1.0 / 2.0, 1.0 / 4.0,
2785 0, 1.0 / 4.0, 1.0 / 2.0,
2786 0, 1.0 / 4.0, 1.0 / 4.0,
2787 1.0 / 4.0, 1.0 / 4.0, 1.0 / 4.0;
2788 }
2789
2790 } // namespace
2791
2792 void p_nodes_3d(const int p, Eigen::MatrixXd &val)
2793 {
2794 switch (p)
2795 {
2796 case 0:
2797 p_0_nodes_3d(val);
2798 break;
2799 case 1:
2800 p_1_nodes_3d(val);
2801 break;
2802 case 2:
2803 p_2_nodes_3d(val);
2804 break;
2805 case 3:
2806 p_3_nodes_3d(val);
2807 break;
2808 case 4:
2809 p_4_nodes_3d(val);
2810 break;
2811 default:
2812 p_n_nodes_3d(p, val);
2813 }
2814 }
2815 void p_basis_value_3d(const int p, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
2816 {
2817 switch (p)
2818 {
2819 case 0:
2820 p_0_basis_value_3d(local_index, uv, val);
2821 break;
2822 case 1:
2823 p_1_basis_value_3d(local_index, uv, val);
2824 break;
2825 case 2:
2826 p_2_basis_value_3d(local_index, uv, val);
2827 break;
2828 case 3:
2829 p_3_basis_value_3d(local_index, uv, val);
2830 break;
2831 case 4:
2832 p_4_basis_value_3d(local_index, uv, val);
2833 break;
2834 default:
2835 p_n_basis_value_3d(p, local_index, uv, val);
2836 }
2837 }
2838
2839 void p_grad_basis_value_3d(const int p, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
2840 {
2841 switch (p)
2842 {
2843 case 0:
2844 p_0_basis_grad_value_3d(local_index, uv, val);
2845 break;
2846 case 1:
2847 p_1_basis_grad_value_3d(local_index, uv, val);
2848 break;
2849 case 2:
2850 p_2_basis_grad_value_3d(local_index, uv, val);
2851 break;
2852 case 3:
2853 p_3_basis_grad_value_3d(local_index, uv, val);
2854 break;
2855 case 4:
2856 p_4_basis_grad_value_3d(local_index, uv, val);
2857 break;
2858 default:
2859 p_n_basis_grad_value_3d(p, local_index, uv, val);
2860 }
2861 }
2862
2863 namespace
2864 {
2865
2866 }
2867 } // namespace autogen
2868} // namespace polyfem
double val
Definition Assembler.cpp:86
int y
int z
int x
void p_n_nodes_3d(const int p, Eigen::MatrixXd &val)
Definition p_n_bases.cpp:81
void p_grad_basis_value_2d(const int p, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
void p_n_basis_grad_value_2d(const int p, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
void p_n_basis_grad_value_3d(const int p, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
void p_nodes_2d(const int p, Eigen::MatrixXd &val)
void p_nodes_3d(const int p, Eigen::MatrixXd &val)
void p_n_basis_value_3d(const int p, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
void p_grad_basis_value_3d(const int p, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
void p_n_basis_value_2d(const int p, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
void p_basis_value_3d(const int p, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
void p_basis_value_2d(const int p, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
void p_n_nodes_2d(const int p, Eigen::MatrixXd &val)