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 = 24 * y;
656 const auto helper_1 = pow(x, 2);
657 const auto helper_2 = pow(y, 2);
658 result_0 = -16 * helper_0 * helper_1 + 16 * helper_0 * x + 288 * helper_1 - 256 * helper_2 * x + 96 * helper_2 - 512.0 / 3.0 * pow(x, 3) - 416.0 / 3.0 * x - 128.0 / 3.0 * pow(y, 3) - 208.0 / 3.0 * y + 16;
659 val.col(0) = result_0;
660 }
661 {
662 result_0 = -16.0 / 3.0 * x * (24 * pow(x, 2) + 48 * x * y - 36 * x + 24 * pow(y, 2) - 36 * y + 13);
663 val.col(1) = result_0;
664 }
665 }
666 break;
667 case 4:
668 {
669 {
670 const auto helper_0 = 96 * pow(x, 2);
671 const auto helper_1 = pow(y, 2);
672 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;
673 val.col(0) = result_0;
674 }
675 {
676 result_0 = 4 * x * (32 * pow(x, 2) + 32 * x * y - 36 * x - 8 * y + 7);
677 val.col(1) = result_0;
678 }
679 }
680 break;
681 case 5:
682 {
683 {
684 const auto helper_0 = pow(x, 2);
685 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;
686 val.col(0) = result_0;
687 }
688 {
689 result_0 = -16.0 / 3.0 * x * (8 * pow(x, 2) - 6 * x + 1);
690 val.col(1) = result_0;
691 }
692 }
693 break;
694 case 6:
695 {
696 {
697 result_0 = (16.0 / 3.0) * y * (24 * pow(x, 2) - 12 * x + 1);
698 val.col(0) = result_0;
699 }
700 {
701 result_0 = (16.0 / 3.0) * x * (8 * pow(x, 2) - 6 * x + 1);
702 val.col(1) = result_0;
703 }
704 }
705 break;
706 case 7:
707 {
708 {
709 const auto helper_0 = 4 * y;
710 result_0 = helper_0 * (-helper_0 + 32 * x * y - 8 * x + 1);
711 val.col(0) = result_0;
712 }
713 {
714 const auto helper_0 = 4 * x;
715 result_0 = helper_0 * (-helper_0 + 32 * x * y - 8 * y + 1);
716 val.col(1) = result_0;
717 }
718 }
719 break;
720 case 8:
721 {
722 {
723 result_0 = (16.0 / 3.0) * y * (8 * pow(y, 2) - 6 * y + 1);
724 val.col(0) = result_0;
725 }
726 {
727 result_0 = (16.0 / 3.0) * x * (24 * pow(y, 2) - 12 * y + 1);
728 val.col(1) = result_0;
729 }
730 }
731 break;
732 case 9:
733 {
734 {
735 result_0 = -16.0 / 3.0 * y * (8 * pow(y, 2) - 6 * y + 1);
736 val.col(0) = result_0;
737 }
738 {
739 const auto helper_0 = pow(y, 2);
740 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;
741 val.col(1) = result_0;
742 }
743 }
744 break;
745 case 10:
746 {
747 {
748 result_0 = 4 * y * (32 * x * y - 8 * x + 32 * pow(y, 2) - 36 * y + 7);
749 val.col(0) = result_0;
750 }
751 {
752 const auto helper_0 = pow(x, 2);
753 const auto helper_1 = 96 * pow(y, 2);
754 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;
755 val.col(1) = result_0;
756 }
757 }
758 break;
759 case 11:
760 {
761 {
762 result_0 = -16.0 / 3.0 * y * (24 * pow(x, 2) + 48 * x * y - 36 * x + 24 * pow(y, 2) - 36 * y + 13);
763 val.col(0) = result_0;
764 }
765 {
766 const auto helper_0 = 24 * x;
767 const auto helper_1 = pow(x, 2);
768 const auto helper_2 = pow(y, 2);
769 result_0 = -16 * helper_0 * helper_2 + 16 * helper_0 * y - 256 * helper_1 * y + 96 * helper_1 + 288 * helper_2 - 128.0 / 3.0 * pow(x, 3) - 208.0 / 3.0 * x - 512.0 / 3.0 * pow(y, 3) - 416.0 / 3.0 * y + 16;
770 val.col(1) = result_0;
771 }
772 }
773 break;
774 case 12:
775 {
776 {
777 result_0 = 32 * y * (12 * pow(x, 2) + 16 * x * y - 14 * x + 4 * pow(y, 2) - 7 * y + 3);
778 val.col(0) = result_0;
779 }
780 {
781 result_0 = 32 * x * (4 * pow(x, 2) + 16 * x * y - 7 * x + 12 * pow(y, 2) - 14 * y + 3);
782 val.col(1) = result_0;
783 }
784 }
785 break;
786 case 13:
787 {
788 {
789 result_0 = -32 * y * (8 * x * y - 2 * x + 4 * pow(y, 2) - 5 * y + 1);
790 val.col(0) = result_0;
791 }
792 {
793 result_0 = -32 * x * (8 * x * y - x + 12 * pow(y, 2) - 10 * y + 1);
794 val.col(1) = result_0;
795 }
796 }
797 break;
798 case 14:
799 {
800 {
801 result_0 = -32 * y * (12 * pow(x, 2) + 8 * x * y - 10 * x - y + 1);
802 val.col(0) = result_0;
803 }
804 {
805 result_0 = -32 * x * (4 * pow(x, 2) + 8 * x * y - 5 * x - 2 * y + 1);
806 val.col(1) = result_0;
807 }
808 }
809 break;
810 default:
811 assert(false);
812 }
813 }
814
815 void p_4_nodes_2d(Eigen::MatrixXd &res)
816 {
817 res.resize(15, 2);
818 res << 0, 0,
819 1, 0,
820 0, 1,
821 1.0 / 4.0, 0,
822 1.0 / 2.0, 0,
823 3.0 / 4.0, 0,
824 3.0 / 4.0, 1.0 / 4.0,
825 1.0 / 2.0, 1.0 / 2.0,
826 1.0 / 4.0, 3.0 / 4.0,
827 0, 3.0 / 4.0,
828 0, 1.0 / 2.0,
829 0, 1.0 / 4.0,
830 1.0 / 4.0, 1.0 / 4.0,
831 1.0 / 4.0, 1.0 / 2.0,
832 1.0 / 2.0, 1.0 / 4.0;
833 }
834
835 } // namespace
836
837 void p_nodes_2d(const int p, Eigen::MatrixXd &val)
838 {
839 switch (p)
840 {
841 case 0:
842 p_0_nodes_2d(val);
843 break;
844 case 1:
845 p_1_nodes_2d(val);
846 break;
847 case 2:
848 p_2_nodes_2d(val);
849 break;
850 case 3:
851 p_3_nodes_2d(val);
852 break;
853 case 4:
854 p_4_nodes_2d(val);
855 break;
856 default:
857 p_n_nodes_2d(p, val);
858 }
859 }
860 void p_basis_value_2d(const int p, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
861 {
862 switch (p)
863 {
864 case 0:
865 p_0_basis_value_2d(local_index, uv, val);
866 break;
867 case 1:
868 p_1_basis_value_2d(local_index, uv, val);
869 break;
870 case 2:
871 p_2_basis_value_2d(local_index, uv, val);
872 break;
873 case 3:
874 p_3_basis_value_2d(local_index, uv, val);
875 break;
876 case 4:
877 p_4_basis_value_2d(local_index, uv, val);
878 break;
879 default:
880 p_n_basis_value_2d(p, local_index, uv, val);
881 }
882 }
883
884 void p_grad_basis_value_2d(const int p, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
885 {
886 switch (p)
887 {
888 case 0:
889 p_0_basis_grad_value_2d(local_index, uv, val);
890 break;
891 case 1:
892 p_1_basis_grad_value_2d(local_index, uv, val);
893 break;
894 case 2:
895 p_2_basis_grad_value_2d(local_index, uv, val);
896 break;
897 case 3:
898 p_3_basis_grad_value_2d(local_index, uv, val);
899 break;
900 case 4:
901 p_4_basis_grad_value_2d(local_index, uv, val);
902 break;
903 default:
904 p_n_basis_grad_value_2d(p, local_index, uv, val);
905 }
906 }
907
908 namespace
909 {
910 void p_0_basis_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &result_0)
911 {
912
913 auto x = uv.col(0).array();
914 auto y = uv.col(1).array();
915 auto z = uv.col(2).array();
916
917 result_0.resize(x.size(), 1);
918 switch (local_index)
919 {
920 case 0:
921 {
922 result_0.setOnes();
923 }
924 break;
925 default:
926 assert(false);
927 }
928 }
929 void p_0_basis_grad_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
930 {
931
932 auto x = uv.col(0).array();
933 auto y = uv.col(1).array();
934 auto z = uv.col(2).array();
935
936 val.resize(uv.rows(), uv.cols());
937 Eigen::ArrayXd result_0(uv.rows());
938 switch (local_index)
939 {
940 case 0:
941 {
942 {
943 result_0.setZero();
944 val.col(0) = result_0;
945 }
946 {
947 result_0.setZero();
948 val.col(1) = result_0;
949 }
950 {
951 result_0.setZero();
952 val.col(2) = result_0;
953 }
954 }
955 break;
956 default:
957 assert(false);
958 }
959 }
960
961 void p_0_nodes_3d(Eigen::MatrixXd &res)
962 {
963 res.resize(1, 3);
964 res << 0.33333333333333331, 0.33333333333333331, 0.33333333333333331;
965 }
966
967 void p_1_basis_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &result_0)
968 {
969
970 auto x = uv.col(0).array();
971 auto y = uv.col(1).array();
972 auto z = uv.col(2).array();
973
974 switch (local_index)
975 {
976 case 0:
977 {
978 result_0 = -x - y - z + 1;
979 }
980 break;
981 case 1:
982 {
983 result_0 = x;
984 }
985 break;
986 case 2:
987 {
988 result_0 = y;
989 }
990 break;
991 case 3:
992 {
993 result_0 = z;
994 }
995 break;
996 default:
997 assert(false);
998 }
999 }
1000 void p_1_basis_grad_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
1001 {
1002
1003 auto x = uv.col(0).array();
1004 auto y = uv.col(1).array();
1005 auto z = uv.col(2).array();
1006
1007 val.resize(uv.rows(), uv.cols());
1008 Eigen::ArrayXd result_0(uv.rows());
1009 switch (local_index)
1010 {
1011 case 0:
1012 {
1013 {
1014 result_0.setConstant(-1);
1015 val.col(0) = result_0;
1016 }
1017 {
1018 result_0.setConstant(-1);
1019 val.col(1) = result_0;
1020 }
1021 {
1022 result_0.setConstant(-1);
1023 val.col(2) = result_0;
1024 }
1025 }
1026 break;
1027 case 1:
1028 {
1029 {
1030 result_0.setOnes();
1031 val.col(0) = result_0;
1032 }
1033 {
1034 result_0.setZero();
1035 val.col(1) = result_0;
1036 }
1037 {
1038 result_0.setZero();
1039 val.col(2) = result_0;
1040 }
1041 }
1042 break;
1043 case 2:
1044 {
1045 {
1046 result_0.setZero();
1047 val.col(0) = result_0;
1048 }
1049 {
1050 result_0.setOnes();
1051 val.col(1) = result_0;
1052 }
1053 {
1054 result_0.setZero();
1055 val.col(2) = result_0;
1056 }
1057 }
1058 break;
1059 case 3:
1060 {
1061 {
1062 result_0.setZero();
1063 val.col(0) = result_0;
1064 }
1065 {
1066 result_0.setZero();
1067 val.col(1) = result_0;
1068 }
1069 {
1070 result_0.setOnes();
1071 val.col(2) = result_0;
1072 }
1073 }
1074 break;
1075 default:
1076 assert(false);
1077 }
1078 }
1079
1080 void p_1_nodes_3d(Eigen::MatrixXd &res)
1081 {
1082 res.resize(4, 3);
1083 res << 0, 0, 0,
1084 1, 0, 0,
1085 0, 1, 0,
1086 0, 0, 1;
1087 }
1088
1089 void p_2_basis_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &result_0)
1090 {
1091
1092 auto x = uv.col(0).array();
1093 auto y = uv.col(1).array();
1094 auto z = uv.col(2).array();
1095
1096 switch (local_index)
1097 {
1098 case 0:
1099 {
1100 result_0 = (x + y + z - 1) * (2 * x + 2 * y + 2 * z - 1);
1101 }
1102 break;
1103 case 1:
1104 {
1105 result_0 = x * (2 * x - 1);
1106 }
1107 break;
1108 case 2:
1109 {
1110 result_0 = y * (2 * y - 1);
1111 }
1112 break;
1113 case 3:
1114 {
1115 result_0 = z * (2 * z - 1);
1116 }
1117 break;
1118 case 4:
1119 {
1120 result_0 = -4 * x * (x + y + z - 1);
1121 }
1122 break;
1123 case 5:
1124 {
1125 result_0 = 4 * x * y;
1126 }
1127 break;
1128 case 6:
1129 {
1130 result_0 = -4 * y * (x + y + z - 1);
1131 }
1132 break;
1133 case 7:
1134 {
1135 result_0 = -4 * z * (x + y + z - 1);
1136 }
1137 break;
1138 case 8:
1139 {
1140 result_0 = 4 * x * z;
1141 }
1142 break;
1143 case 9:
1144 {
1145 result_0 = 4 * y * z;
1146 }
1147 break;
1148 default:
1149 assert(false);
1150 }
1151 }
1152 void p_2_basis_grad_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
1153 {
1154
1155 auto x = uv.col(0).array();
1156 auto y = uv.col(1).array();
1157 auto z = uv.col(2).array();
1158
1159 val.resize(uv.rows(), uv.cols());
1160 Eigen::ArrayXd result_0(uv.rows());
1161 switch (local_index)
1162 {
1163 case 0:
1164 {
1165 {
1166 result_0 = 4 * x + 4 * y + 4 * z - 3;
1167 val.col(0) = result_0;
1168 }
1169 {
1170 result_0 = 4 * x + 4 * y + 4 * z - 3;
1171 val.col(1) = result_0;
1172 }
1173 {
1174 result_0 = 4 * x + 4 * y + 4 * z - 3;
1175 val.col(2) = result_0;
1176 }
1177 }
1178 break;
1179 case 1:
1180 {
1181 {
1182 result_0 = 4 * x - 1;
1183 val.col(0) = result_0;
1184 }
1185 {
1186 result_0.setZero();
1187 val.col(1) = result_0;
1188 }
1189 {
1190 result_0.setZero();
1191 val.col(2) = result_0;
1192 }
1193 }
1194 break;
1195 case 2:
1196 {
1197 {
1198 result_0.setZero();
1199 val.col(0) = result_0;
1200 }
1201 {
1202 result_0 = 4 * y - 1;
1203 val.col(1) = result_0;
1204 }
1205 {
1206 result_0.setZero();
1207 val.col(2) = result_0;
1208 }
1209 }
1210 break;
1211 case 3:
1212 {
1213 {
1214 result_0.setZero();
1215 val.col(0) = result_0;
1216 }
1217 {
1218 result_0.setZero();
1219 val.col(1) = result_0;
1220 }
1221 {
1222 result_0 = 4 * z - 1;
1223 val.col(2) = result_0;
1224 }
1225 }
1226 break;
1227 case 4:
1228 {
1229 {
1230 result_0 = 4 * (-2 * x - y - z + 1);
1231 val.col(0) = result_0;
1232 }
1233 {
1234 result_0 = -4 * x;
1235 val.col(1) = result_0;
1236 }
1237 {
1238 result_0 = -4 * x;
1239 val.col(2) = result_0;
1240 }
1241 }
1242 break;
1243 case 5:
1244 {
1245 {
1246 result_0 = 4 * y;
1247 val.col(0) = result_0;
1248 }
1249 {
1250 result_0 = 4 * x;
1251 val.col(1) = result_0;
1252 }
1253 {
1254 result_0.setZero();
1255 val.col(2) = result_0;
1256 }
1257 }
1258 break;
1259 case 6:
1260 {
1261 {
1262 result_0 = -4 * y;
1263 val.col(0) = result_0;
1264 }
1265 {
1266 result_0 = 4 * (-x - 2 * y - z + 1);
1267 val.col(1) = result_0;
1268 }
1269 {
1270 result_0 = -4 * y;
1271 val.col(2) = result_0;
1272 }
1273 }
1274 break;
1275 case 7:
1276 {
1277 {
1278 result_0 = -4 * z;
1279 val.col(0) = result_0;
1280 }
1281 {
1282 result_0 = -4 * z;
1283 val.col(1) = result_0;
1284 }
1285 {
1286 result_0 = 4 * (-x - y - 2 * z + 1);
1287 val.col(2) = result_0;
1288 }
1289 }
1290 break;
1291 case 8:
1292 {
1293 {
1294 result_0 = 4 * z;
1295 val.col(0) = result_0;
1296 }
1297 {
1298 result_0.setZero();
1299 val.col(1) = result_0;
1300 }
1301 {
1302 result_0 = 4 * x;
1303 val.col(2) = result_0;
1304 }
1305 }
1306 break;
1307 case 9:
1308 {
1309 {
1310 result_0.setZero();
1311 val.col(0) = result_0;
1312 }
1313 {
1314 result_0 = 4 * z;
1315 val.col(1) = result_0;
1316 }
1317 {
1318 result_0 = 4 * y;
1319 val.col(2) = result_0;
1320 }
1321 }
1322 break;
1323 default:
1324 assert(false);
1325 }
1326 }
1327
1328 void p_2_nodes_3d(Eigen::MatrixXd &res)
1329 {
1330 res.resize(10, 3);
1331 res << 0, 0, 0,
1332 1, 0, 0,
1333 0, 1, 0,
1334 0, 0, 1,
1335 1.0 / 2.0, 0, 0,
1336 1.0 / 2.0, 1.0 / 2.0, 0,
1337 0, 1.0 / 2.0, 0,
1338 0, 0, 1.0 / 2.0,
1339 1.0 / 2.0, 0, 1.0 / 2.0,
1340 0, 1.0 / 2.0, 1.0 / 2.0;
1341 }
1342
1343 void p_3_basis_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &result_0)
1344 {
1345
1346 auto x = uv.col(0).array();
1347 auto y = uv.col(1).array();
1348 auto z = uv.col(2).array();
1349
1350 switch (local_index)
1351 {
1352 case 0:
1353 {
1354 const auto helper_0 = 18 * x;
1355 const auto helper_1 = y * z;
1356 const auto helper_2 = pow(x, 2);
1357 const auto helper_3 = pow(y, 2);
1358 const auto helper_4 = pow(z, 2);
1359 const auto helper_5 = (27.0 / 2.0) * x;
1360 const auto helper_6 = (27.0 / 2.0) * y;
1361 const auto helper_7 = (27.0 / 2.0) * z;
1362 result_0 = helper_0 * y + helper_0 * z - 27 * helper_1 * x + 18 * helper_1 - helper_2 * helper_6 - helper_2 * helper_7 + 9 * helper_2 - helper_3 * helper_5 - helper_3 * helper_7 + 9 * helper_3 - helper_4 * helper_5 - helper_4 * helper_6 + 9 * helper_4 - 9.0 / 2.0 * pow(x, 3) - 11.0 / 2.0 * x - 9.0 / 2.0 * pow(y, 3) - 11.0 / 2.0 * y - 9.0 / 2.0 * pow(z, 3) - 11.0 / 2.0 * z + 1;
1363 }
1364 break;
1365 case 1:
1366 {
1367 result_0 = (1.0 / 2.0) * x * (9 * pow(x, 2) - 9 * x + 2);
1368 }
1369 break;
1370 case 2:
1371 {
1372 result_0 = (1.0 / 2.0) * y * (9 * pow(y, 2) - 9 * y + 2);
1373 }
1374 break;
1375 case 3:
1376 {
1377 result_0 = (1.0 / 2.0) * z * (9 * pow(z, 2) - 9 * z + 2);
1378 }
1379 break;
1380 case 4:
1381 {
1382 result_0 = (9.0 / 2.0) * x * (x + y + z - 1) * (3 * x + 3 * y + 3 * z - 2);
1383 }
1384 break;
1385 case 5:
1386 {
1387 const auto helper_0 = 3 * x;
1388 result_0 = -9.0 / 2.0 * x * (helper_0 * y + helper_0 * z + 3 * pow(x, 2) - 4 * x - y - z + 1);
1389 }
1390 break;
1391 case 6:
1392 {
1393 result_0 = (9.0 / 2.0) * x * y * (3 * x - 1);
1394 }
1395 break;
1396 case 7:
1397 {
1398 result_0 = (9.0 / 2.0) * x * y * (3 * y - 1);
1399 }
1400 break;
1401 case 8:
1402 {
1403 const auto helper_0 = 3 * y;
1404 result_0 = -9.0 / 2.0 * y * (helper_0 * x + helper_0 * z - x + 3 * pow(y, 2) - 4 * y - z + 1);
1405 }
1406 break;
1407 case 9:
1408 {
1409 result_0 = (9.0 / 2.0) * y * (x + y + z - 1) * (3 * x + 3 * y + 3 * z - 2);
1410 }
1411 break;
1412 case 10:
1413 {
1414 result_0 = (9.0 / 2.0) * z * (x + y + z - 1) * (3 * x + 3 * y + 3 * z - 2);
1415 }
1416 break;
1417 case 11:
1418 {
1419 const auto helper_0 = 3 * z;
1420 result_0 = -9.0 / 2.0 * z * (helper_0 * x + helper_0 * y - x - y + 3 * pow(z, 2) - 4 * z + 1);
1421 }
1422 break;
1423 case 12:
1424 {
1425 result_0 = (9.0 / 2.0) * x * z * (3 * x - 1);
1426 }
1427 break;
1428 case 13:
1429 {
1430 result_0 = (9.0 / 2.0) * x * z * (3 * z - 1);
1431 }
1432 break;
1433 case 14:
1434 {
1435 result_0 = (9.0 / 2.0) * y * z * (3 * y - 1);
1436 }
1437 break;
1438 case 15:
1439 {
1440 result_0 = (9.0 / 2.0) * y * z * (3 * z - 1);
1441 }
1442 break;
1443 case 16:
1444 {
1445 result_0 = -27 * x * y * (x + y + z - 1);
1446 }
1447 break;
1448 case 17:
1449 {
1450 result_0 = -27 * x * z * (x + y + z - 1);
1451 }
1452 break;
1453 case 18:
1454 {
1455 result_0 = 27 * x * y * z;
1456 }
1457 break;
1458 case 19:
1459 {
1460 result_0 = -27 * y * z * (x + y + z - 1);
1461 }
1462 break;
1463 default:
1464 assert(false);
1465 }
1466 }
1467 void p_3_basis_grad_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
1468 {
1469
1470 auto x = uv.col(0).array();
1471 auto y = uv.col(1).array();
1472 auto z = uv.col(2).array();
1473
1474 val.resize(uv.rows(), uv.cols());
1475 Eigen::ArrayXd result_0(uv.rows());
1476 switch (local_index)
1477 {
1478 case 0:
1479 {
1480 {
1481 const auto helper_0 = 27 * x;
1482 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;
1483 val.col(0) = result_0;
1484 }
1485 {
1486 const auto helper_0 = 27 * x;
1487 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;
1488 val.col(1) = result_0;
1489 }
1490 {
1491 const auto helper_0 = 27 * x;
1492 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;
1493 val.col(2) = result_0;
1494 }
1495 }
1496 break;
1497 case 1:
1498 {
1499 {
1500 result_0 = (27.0 / 2.0) * pow(x, 2) - 9 * x + 1;
1501 val.col(0) = result_0;
1502 }
1503 {
1504 result_0.setZero();
1505 val.col(1) = result_0;
1506 }
1507 {
1508 result_0.setZero();
1509 val.col(2) = result_0;
1510 }
1511 }
1512 break;
1513 case 2:
1514 {
1515 {
1516 result_0.setZero();
1517 val.col(0) = result_0;
1518 }
1519 {
1520 result_0 = (27.0 / 2.0) * pow(y, 2) - 9 * y + 1;
1521 val.col(1) = result_0;
1522 }
1523 {
1524 result_0.setZero();
1525 val.col(2) = result_0;
1526 }
1527 }
1528 break;
1529 case 3:
1530 {
1531 {
1532 result_0.setZero();
1533 val.col(0) = result_0;
1534 }
1535 {
1536 result_0.setZero();
1537 val.col(1) = result_0;
1538 }
1539 {
1540 result_0 = (27.0 / 2.0) * pow(z, 2) - 9 * z + 1;
1541 val.col(2) = result_0;
1542 }
1543 }
1544 break;
1545 case 4:
1546 {
1547 {
1548 const auto helper_0 = 6 * x;
1549 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;
1550 val.col(0) = result_0;
1551 }
1552 {
1553 result_0 = (9.0 / 2.0) * x * (6 * x + 6 * y + 6 * z - 5);
1554 val.col(1) = result_0;
1555 }
1556 {
1557 result_0 = (9.0 / 2.0) * x * (6 * x + 6 * y + 6 * z - 5);
1558 val.col(2) = result_0;
1559 }
1560 }
1561 break;
1562 case 5:
1563 {
1564 {
1565 const auto helper_0 = 3 * x;
1566 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;
1567 val.col(0) = result_0;
1568 }
1569 {
1570 result_0 = -9.0 / 2.0 * x * (3 * x - 1);
1571 val.col(1) = result_0;
1572 }
1573 {
1574 result_0 = -9.0 / 2.0 * x * (3 * x - 1);
1575 val.col(2) = result_0;
1576 }
1577 }
1578 break;
1579 case 6:
1580 {
1581 {
1582 result_0 = (9.0 / 2.0) * y * (6 * x - 1);
1583 val.col(0) = result_0;
1584 }
1585 {
1586 result_0 = (9.0 / 2.0) * x * (3 * x - 1);
1587 val.col(1) = result_0;
1588 }
1589 {
1590 result_0.setZero();
1591 val.col(2) = result_0;
1592 }
1593 }
1594 break;
1595 case 7:
1596 {
1597 {
1598 result_0 = (9.0 / 2.0) * y * (3 * y - 1);
1599 val.col(0) = result_0;
1600 }
1601 {
1602 result_0 = (9.0 / 2.0) * x * (6 * y - 1);
1603 val.col(1) = result_0;
1604 }
1605 {
1606 result_0.setZero();
1607 val.col(2) = result_0;
1608 }
1609 }
1610 break;
1611 case 8:
1612 {
1613 {
1614 result_0 = -9.0 / 2.0 * y * (3 * y - 1);
1615 val.col(0) = result_0;
1616 }
1617 {
1618 const auto helper_0 = 3 * y;
1619 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;
1620 val.col(1) = result_0;
1621 }
1622 {
1623 result_0 = -9.0 / 2.0 * y * (3 * y - 1);
1624 val.col(2) = result_0;
1625 }
1626 }
1627 break;
1628 case 9:
1629 {
1630 {
1631 result_0 = (9.0 / 2.0) * y * (6 * x + 6 * y + 6 * z - 5);
1632 val.col(0) = result_0;
1633 }
1634 {
1635 const auto helper_0 = 6 * y;
1636 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;
1637 val.col(1) = result_0;
1638 }
1639 {
1640 result_0 = (9.0 / 2.0) * y * (6 * x + 6 * y + 6 * z - 5);
1641 val.col(2) = result_0;
1642 }
1643 }
1644 break;
1645 case 10:
1646 {
1647 {
1648 result_0 = (9.0 / 2.0) * z * (6 * x + 6 * y + 6 * z - 5);
1649 val.col(0) = result_0;
1650 }
1651 {
1652 result_0 = (9.0 / 2.0) * z * (6 * x + 6 * y + 6 * z - 5);
1653 val.col(1) = result_0;
1654 }
1655 {
1656 const auto helper_0 = 6 * z;
1657 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;
1658 val.col(2) = result_0;
1659 }
1660 }
1661 break;
1662 case 11:
1663 {
1664 {
1665 result_0 = -9.0 / 2.0 * z * (3 * z - 1);
1666 val.col(0) = result_0;
1667 }
1668 {
1669 result_0 = -9.0 / 2.0 * z * (3 * z - 1);
1670 val.col(1) = result_0;
1671 }
1672 {
1673 const auto helper_0 = 3 * z;
1674 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;
1675 val.col(2) = result_0;
1676 }
1677 }
1678 break;
1679 case 12:
1680 {
1681 {
1682 result_0 = (9.0 / 2.0) * z * (6 * x - 1);
1683 val.col(0) = result_0;
1684 }
1685 {
1686 result_0.setZero();
1687 val.col(1) = result_0;
1688 }
1689 {
1690 result_0 = (9.0 / 2.0) * x * (3 * x - 1);
1691 val.col(2) = result_0;
1692 }
1693 }
1694 break;
1695 case 13:
1696 {
1697 {
1698 result_0 = (9.0 / 2.0) * z * (3 * z - 1);
1699 val.col(0) = result_0;
1700 }
1701 {
1702 result_0.setZero();
1703 val.col(1) = result_0;
1704 }
1705 {
1706 result_0 = (9.0 / 2.0) * x * (6 * z - 1);
1707 val.col(2) = result_0;
1708 }
1709 }
1710 break;
1711 case 14:
1712 {
1713 {
1714 result_0.setZero();
1715 val.col(0) = result_0;
1716 }
1717 {
1718 result_0 = (9.0 / 2.0) * z * (6 * y - 1);
1719 val.col(1) = result_0;
1720 }
1721 {
1722 result_0 = (9.0 / 2.0) * y * (3 * y - 1);
1723 val.col(2) = result_0;
1724 }
1725 }
1726 break;
1727 case 15:
1728 {
1729 {
1730 result_0.setZero();
1731 val.col(0) = result_0;
1732 }
1733 {
1734 result_0 = (9.0 / 2.0) * z * (3 * z - 1);
1735 val.col(1) = result_0;
1736 }
1737 {
1738 result_0 = (9.0 / 2.0) * y * (6 * z - 1);
1739 val.col(2) = result_0;
1740 }
1741 }
1742 break;
1743 case 16:
1744 {
1745 {
1746 result_0 = -27 * y * (2 * x + y + z - 1);
1747 val.col(0) = result_0;
1748 }
1749 {
1750 result_0 = -27 * x * (x + 2 * y + z - 1);
1751 val.col(1) = result_0;
1752 }
1753 {
1754 result_0 = -27 * x * y;
1755 val.col(2) = result_0;
1756 }
1757 }
1758 break;
1759 case 17:
1760 {
1761 {
1762 result_0 = -27 * z * (2 * x + y + z - 1);
1763 val.col(0) = result_0;
1764 }
1765 {
1766 result_0 = -27 * x * z;
1767 val.col(1) = result_0;
1768 }
1769 {
1770 result_0 = -27 * x * (x + y + 2 * z - 1);
1771 val.col(2) = result_0;
1772 }
1773 }
1774 break;
1775 case 18:
1776 {
1777 {
1778 result_0 = 27 * y * z;
1779 val.col(0) = result_0;
1780 }
1781 {
1782 result_0 = 27 * x * z;
1783 val.col(1) = result_0;
1784 }
1785 {
1786 result_0 = 27 * x * y;
1787 val.col(2) = result_0;
1788 }
1789 }
1790 break;
1791 case 19:
1792 {
1793 {
1794 result_0 = -27 * y * z;
1795 val.col(0) = result_0;
1796 }
1797 {
1798 result_0 = -27 * z * (x + 2 * y + z - 1);
1799 val.col(1) = result_0;
1800 }
1801 {
1802 result_0 = -27 * y * (x + y + 2 * z - 1);
1803 val.col(2) = result_0;
1804 }
1805 }
1806 break;
1807 default:
1808 assert(false);
1809 }
1810 }
1811
1812 void p_3_nodes_3d(Eigen::MatrixXd &res)
1813 {
1814 res.resize(20, 3);
1815 res << 0, 0, 0,
1816 1, 0, 0,
1817 0, 1, 0,
1818 0, 0, 1,
1819 1.0 / 3.0, 0, 0,
1820 2.0 / 3.0, 0, 0,
1821 2.0 / 3.0, 1.0 / 3.0, 0,
1822 1.0 / 3.0, 2.0 / 3.0, 0,
1823 0, 2.0 / 3.0, 0,
1824 0, 1.0 / 3.0, 0,
1825 0, 0, 1.0 / 3.0,
1826 0, 0, 2.0 / 3.0,
1827 2.0 / 3.0, 0, 1.0 / 3.0,
1828 1.0 / 3.0, 0, 2.0 / 3.0,
1829 0, 2.0 / 3.0, 1.0 / 3.0,
1830 0, 1.0 / 3.0, 2.0 / 3.0,
1831 1.0 / 3.0, 1.0 / 3.0, 0,
1832 1.0 / 3.0, 0, 1.0 / 3.0,
1833 1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0,
1834 0, 1.0 / 3.0, 1.0 / 3.0;
1835 }
1836
1837 void p_4_basis_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &result_0)
1838 {
1839
1840 auto x = uv.col(0).array();
1841 auto y = uv.col(1).array();
1842 auto z = uv.col(2).array();
1843
1844 switch (local_index)
1845 {
1846 case 0:
1847 {
1848 const auto helper_0 = x + y + z - 1;
1849 const auto helper_1 = x * y;
1850 const auto helper_2 = pow(y, 2);
1851 const auto helper_3 = 9 * x;
1852 const auto helper_4 = pow(z, 2);
1853 const auto helper_5 = pow(x, 2);
1854 const auto helper_6 = 9 * y;
1855 const auto helper_7 = 9 * z;
1856 const auto helper_8 = 26 * helper_0;
1857 const auto helper_9 = helper_8 * z;
1858 const auto helper_10 = 13 * pow(helper_0, 2);
1859 const auto helper_11 = 13 * helper_0;
1860 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));
1861 }
1862 break;
1863 case 1:
1864 {
1865 result_0 = (1.0 / 3.0) * x * (32 * pow(x, 3) - 48 * pow(x, 2) + 22 * x - 3);
1866 }
1867 break;
1868 case 2:
1869 {
1870 result_0 = (1.0 / 3.0) * y * (32 * pow(y, 3) - 48 * pow(y, 2) + 22 * y - 3);
1871 }
1872 break;
1873 case 3:
1874 {
1875 result_0 = (1.0 / 3.0) * z * (32 * pow(z, 3) - 48 * pow(z, 2) + 22 * z - 3);
1876 }
1877 break;
1878 case 4:
1879 {
1880 const auto helper_0 = 36 * x;
1881 const auto helper_1 = y * z;
1882 const auto helper_2 = pow(x, 2);
1883 const auto helper_3 = pow(y, 2);
1884 const auto helper_4 = pow(z, 2);
1885 const auto helper_5 = 24 * x;
1886 const auto helper_6 = 24 * y;
1887 const auto helper_7 = 24 * z;
1888 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);
1889 }
1890 break;
1891 case 5:
1892 {
1893 const auto helper_0 = 2 * y;
1894 const auto helper_1 = 2 * z;
1895 const auto helper_2 = x + y + z - 1;
1896 const auto helper_3 = helper_2 * x;
1897 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));
1898 }
1899 break;
1900 case 6:
1901 {
1902 const auto helper_0 = 6 * x;
1903 const auto helper_1 = pow(x, 2);
1904 const auto helper_2 = 8 * helper_1;
1905 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);
1906 }
1907 break;
1908 case 7:
1909 {
1910 result_0 = (16.0 / 3.0) * x * y * (8 * pow(x, 2) - 6 * x + 1);
1911 }
1912 break;
1913 case 8:
1914 {
1915 const auto helper_0 = 4 * x;
1916 result_0 = helper_0 * y * (-helper_0 + 16 * x * y - 4 * y + 1);
1917 }
1918 break;
1919 case 9:
1920 {
1921 result_0 = (16.0 / 3.0) * x * y * (8 * pow(y, 2) - 6 * y + 1);
1922 }
1923 break;
1924 case 10:
1925 {
1926 const auto helper_0 = 6 * y;
1927 const auto helper_1 = pow(y, 2);
1928 const auto helper_2 = 8 * helper_1;
1929 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);
1930 }
1931 break;
1932 case 11:
1933 {
1934 const auto helper_0 = 2 * y;
1935 const auto helper_1 = 2 * x;
1936 const auto helper_2 = x + y + z - 1;
1937 const auto helper_3 = helper_2 * y;
1938 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));
1939 }
1940 break;
1941 case 12:
1942 {
1943 const auto helper_0 = 36 * x;
1944 const auto helper_1 = y * z;
1945 const auto helper_2 = pow(x, 2);
1946 const auto helper_3 = pow(y, 2);
1947 const auto helper_4 = pow(z, 2);
1948 const auto helper_5 = 24 * x;
1949 const auto helper_6 = 24 * y;
1950 const auto helper_7 = 24 * z;
1951 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);
1952 }
1953 break;
1954 case 13:
1955 {
1956 const auto helper_0 = 36 * x;
1957 const auto helper_1 = y * z;
1958 const auto helper_2 = pow(x, 2);
1959 const auto helper_3 = pow(y, 2);
1960 const auto helper_4 = pow(z, 2);
1961 const auto helper_5 = 24 * x;
1962 const auto helper_6 = 24 * y;
1963 const auto helper_7 = 24 * z;
1964 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);
1965 }
1966 break;
1967 case 14:
1968 {
1969 const auto helper_0 = 2 * x;
1970 const auto helper_1 = 2 * z;
1971 const auto helper_2 = x + y + z - 1;
1972 const auto helper_3 = helper_2 * z;
1973 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));
1974 }
1975 break;
1976 case 15:
1977 {
1978 const auto helper_0 = 6 * z;
1979 const auto helper_1 = pow(z, 2);
1980 const auto helper_2 = 8 * helper_1;
1981 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);
1982 }
1983 break;
1984 case 16:
1985 {
1986 result_0 = (16.0 / 3.0) * x * z * (8 * pow(x, 2) - 6 * x + 1);
1987 }
1988 break;
1989 case 17:
1990 {
1991 const auto helper_0 = 4 * x;
1992 result_0 = helper_0 * z * (-helper_0 + 16 * x * z - 4 * z + 1);
1993 }
1994 break;
1995 case 18:
1996 {
1997 result_0 = (16.0 / 3.0) * x * z * (8 * pow(z, 2) - 6 * z + 1);
1998 }
1999 break;
2000 case 19:
2001 {
2002 result_0 = (16.0 / 3.0) * y * z * (8 * pow(y, 2) - 6 * y + 1);
2003 }
2004 break;
2005 case 20:
2006 {
2007 const auto helper_0 = 4 * y;
2008 result_0 = helper_0 * z * (-helper_0 + 16 * y * z - 4 * z + 1);
2009 }
2010 break;
2011 case 21:
2012 {
2013 result_0 = (16.0 / 3.0) * y * z * (8 * pow(z, 2) - 6 * z + 1);
2014 }
2015 break;
2016 case 22:
2017 {
2018 result_0 = 32 * x * y * (x + y + z - 1) * (4 * x + 4 * y + 4 * z - 3);
2019 }
2020 break;
2021 case 23:
2022 {
2023 result_0 = -32 * x * y * (4 * y - 1) * (x + y + z - 1);
2024 }
2025 break;
2026 case 24:
2027 {
2028 result_0 = -32 * x * y * (4 * x - 1) * (x + y + z - 1);
2029 }
2030 break;
2031 case 25:
2032 {
2033 result_0 = 32 * x * z * (x + y + z - 1) * (4 * x + 4 * y + 4 * z - 3);
2034 }
2035 break;
2036 case 26:
2037 {
2038 result_0 = -32 * x * z * (4 * z - 1) * (x + y + z - 1);
2039 }
2040 break;
2041 case 27:
2042 {
2043 result_0 = -32 * x * z * (4 * x - 1) * (x + y + z - 1);
2044 }
2045 break;
2046 case 28:
2047 {
2048 result_0 = 32 * x * y * z * (4 * x - 1);
2049 }
2050 break;
2051 case 29:
2052 {
2053 result_0 = 32 * x * y * z * (4 * z - 1);
2054 }
2055 break;
2056 case 30:
2057 {
2058 result_0 = 32 * x * y * z * (4 * y - 1);
2059 }
2060 break;
2061 case 31:
2062 {
2063 result_0 = -32 * y * z * (4 * y - 1) * (x + y + z - 1);
2064 }
2065 break;
2066 case 32:
2067 {
2068 result_0 = -32 * y * z * (4 * z - 1) * (x + y + z - 1);
2069 }
2070 break;
2071 case 33:
2072 {
2073 result_0 = 32 * y * z * (x + y + z - 1) * (4 * x + 4 * y + 4 * z - 3);
2074 }
2075 break;
2076 case 34:
2077 {
2078 result_0 = -256 * x * y * z * (x + y + z - 1);
2079 }
2080 break;
2081 default:
2082 assert(false);
2083 }
2084 }
2085 void p_4_basis_grad_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
2086 {
2087
2088 auto x = uv.col(0).array();
2089 auto y = uv.col(1).array();
2090 auto z = uv.col(2).array();
2091
2092 val.resize(uv.rows(), uv.cols());
2093 Eigen::ArrayXd result_0(uv.rows());
2094 switch (local_index)
2095 {
2096 case 0:
2097 {
2098 {
2099 const auto helper_0 = 160 * x;
2100 const auto helper_1 = y * z;
2101 const auto helper_2 = pow(x, 2);
2102 const auto helper_3 = pow(y, 2);
2103 const auto helper_4 = pow(z, 2);
2104 const auto helper_5 = 128 * x;
2105 const auto helper_6 = 128 * y;
2106 const auto helper_7 = 128 * z;
2107 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;
2108 val.col(0) = result_0;
2109 }
2110 {
2111 const auto helper_0 = 160 * x;
2112 const auto helper_1 = y * z;
2113 const auto helper_2 = pow(x, 2);
2114 const auto helper_3 = pow(y, 2);
2115 const auto helper_4 = pow(z, 2);
2116 const auto helper_5 = 128 * x;
2117 const auto helper_6 = 128 * y;
2118 const auto helper_7 = 128 * z;
2119 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;
2120 val.col(1) = result_0;
2121 }
2122 {
2123 const auto helper_0 = 160 * x;
2124 const auto helper_1 = y * z;
2125 const auto helper_2 = pow(x, 2);
2126 const auto helper_3 = pow(y, 2);
2127 const auto helper_4 = pow(z, 2);
2128 const auto helper_5 = 128 * x;
2129 const auto helper_6 = 128 * y;
2130 const auto helper_7 = 128 * z;
2131 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;
2132 val.col(2) = result_0;
2133 }
2134 }
2135 break;
2136 case 1:
2137 {
2138 {
2139 result_0 = (128.0 / 3.0) * pow(x, 3) - 48 * pow(x, 2) + (44.0 / 3.0) * x - 1;
2140 val.col(0) = result_0;
2141 }
2142 {
2143 result_0.setZero();
2144 val.col(1) = result_0;
2145 }
2146 {
2147 result_0.setZero();
2148 val.col(2) = result_0;
2149 }
2150 }
2151 break;
2152 case 2:
2153 {
2154 {
2155 result_0.setZero();
2156 val.col(0) = result_0;
2157 }
2158 {
2159 result_0 = (128.0 / 3.0) * pow(y, 3) - 48 * pow(y, 2) + (44.0 / 3.0) * y - 1;
2160 val.col(1) = result_0;
2161 }
2162 {
2163 result_0.setZero();
2164 val.col(2) = result_0;
2165 }
2166 }
2167 break;
2168 case 3:
2169 {
2170 {
2171 result_0.setZero();
2172 val.col(0) = result_0;
2173 }
2174 {
2175 result_0.setZero();
2176 val.col(1) = result_0;
2177 }
2178 {
2179 result_0 = (128.0 / 3.0) * pow(z, 3) - 48 * pow(z, 2) + (44.0 / 3.0) * z - 1;
2180 val.col(2) = result_0;
2181 }
2182 }
2183 break;
2184 case 4:
2185 {
2186 {
2187 const auto helper_0 = 24 * x;
2188 const auto helper_1 = y * z;
2189 const auto helper_2 = pow(x, 2);
2190 const auto helper_3 = pow(y, 2);
2191 const auto helper_4 = pow(z, 2);
2192 const auto helper_5 = 16 * x;
2193 const auto helper_6 = 24 * helper_2;
2194 result_0 = 16 * helper_0 * y + 16 * helper_0 * z - 512 * helper_1 * x + 192 * helper_1 + 288 * helper_2 - 16 * helper_3 * helper_5 - 128 * helper_3 * z + 96 * helper_3 - 16 * helper_4 * helper_5 - 128 * helper_4 * y + 96 * helper_4 - 16 * helper_6 * y - 16 * helper_6 * z - 512.0 / 3.0 * pow(x, 3) - 416.0 / 3.0 * x - 128.0 / 3.0 * pow(y, 3) - 208.0 / 3.0 * y - 128.0 / 3.0 * pow(z, 3) - 208.0 / 3.0 * z + 16;
2195 val.col(0) = result_0;
2196 }
2197 {
2198 const auto helper_0 = 48 * x;
2199 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);
2200 val.col(1) = result_0;
2201 }
2202 {
2203 const auto helper_0 = 48 * x;
2204 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);
2205 val.col(2) = result_0;
2206 }
2207 }
2208 break;
2209 case 5:
2210 {
2211 {
2212 const auto helper_0 = 72 * x;
2213 const auto helper_1 = y * z;
2214 const auto helper_2 = 96 * pow(x, 2);
2215 const auto helper_3 = pow(y, 2);
2216 const auto helper_4 = pow(z, 2);
2217 const auto helper_5 = 32 * x;
2218 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;
2219 val.col(0) = result_0;
2220 }
2221 {
2222 const auto helper_0 = 32 * x;
2223 result_0 = 4 * x * (helper_0 * y + helper_0 * z + 32 * pow(x, 2) - 36 * x - 8 * y - 8 * z + 7);
2224 val.col(1) = result_0;
2225 }
2226 {
2227 const auto helper_0 = 32 * x;
2228 result_0 = 4 * x * (helper_0 * y + helper_0 * z + 32 * pow(x, 2) - 36 * x - 8 * y - 8 * z + 7);
2229 val.col(2) = result_0;
2230 }
2231 }
2232 break;
2233 case 6:
2234 {
2235 {
2236 const auto helper_0 = 4 * x;
2237 const auto helper_1 = pow(x, 2);
2238 const auto helper_2 = 8 * helper_1;
2239 result_0 = 16 * helper_0 * y + 16 * helper_0 * z + 224 * helper_1 - 16 * helper_2 * y - 16 * helper_2 * z - 512.0 / 3.0 * pow(x, 3) - 224.0 / 3.0 * x - 16.0 / 3.0 * y - 16.0 / 3.0 * z + 16.0 / 3.0;
2240 val.col(0) = result_0;
2241 }
2242 {
2243 result_0 = -16.0 / 3.0 * x * (8 * pow(x, 2) - 6 * x + 1);
2244 val.col(1) = result_0;
2245 }
2246 {
2247 result_0 = -16.0 / 3.0 * x * (8 * pow(x, 2) - 6 * x + 1);
2248 val.col(2) = result_0;
2249 }
2250 }
2251 break;
2252 case 7:
2253 {
2254 {
2255 result_0 = (16.0 / 3.0) * y * (24 * pow(x, 2) - 12 * x + 1);
2256 val.col(0) = result_0;
2257 }
2258 {
2259 result_0 = (16.0 / 3.0) * x * (8 * pow(x, 2) - 6 * x + 1);
2260 val.col(1) = result_0;
2261 }
2262 {
2263 result_0.setZero();
2264 val.col(2) = result_0;
2265 }
2266 }
2267 break;
2268 case 8:
2269 {
2270 {
2271 const auto helper_0 = 4 * y;
2272 result_0 = helper_0 * (-helper_0 + 32 * x * y - 8 * x + 1);
2273 val.col(0) = result_0;
2274 }
2275 {
2276 const auto helper_0 = 4 * x;
2277 result_0 = helper_0 * (-helper_0 + 32 * x * y - 8 * y + 1);
2278 val.col(1) = result_0;
2279 }
2280 {
2281 result_0.setZero();
2282 val.col(2) = result_0;
2283 }
2284 }
2285 break;
2286 case 9:
2287 {
2288 {
2289 result_0 = (16.0 / 3.0) * y * (8 * pow(y, 2) - 6 * y + 1);
2290 val.col(0) = result_0;
2291 }
2292 {
2293 result_0 = (16.0 / 3.0) * x * (24 * pow(y, 2) - 12 * y + 1);
2294 val.col(1) = result_0;
2295 }
2296 {
2297 result_0.setZero();
2298 val.col(2) = result_0;
2299 }
2300 }
2301 break;
2302 case 10:
2303 {
2304 {
2305 result_0 = -16.0 / 3.0 * y * (8 * pow(y, 2) - 6 * y + 1);
2306 val.col(0) = result_0;
2307 }
2308 {
2309 const auto helper_0 = 4 * y;
2310 const auto helper_1 = pow(y, 2);
2311 const auto helper_2 = 8 * helper_1;
2312 result_0 = 16 * helper_0 * x + 16 * helper_0 * z + 224 * helper_1 - 16 * helper_2 * x - 16 * helper_2 * z - 16.0 / 3.0 * x - 512.0 / 3.0 * pow(y, 3) - 224.0 / 3.0 * y - 16.0 / 3.0 * z + 16.0 / 3.0;
2313 val.col(1) = result_0;
2314 }
2315 {
2316 result_0 = -16.0 / 3.0 * y * (8 * pow(y, 2) - 6 * y + 1);
2317 val.col(2) = result_0;
2318 }
2319 }
2320 break;
2321 case 11:
2322 {
2323 {
2324 const auto helper_0 = 32 * y;
2325 result_0 = 4 * y * (helper_0 * x + helper_0 * z - 8 * x + 32 * pow(y, 2) - 36 * y - 8 * z + 7);
2326 val.col(0) = result_0;
2327 }
2328 {
2329 const auto helper_0 = 72 * y;
2330 const auto helper_1 = x * z;
2331 const auto helper_2 = pow(x, 2);
2332 const auto helper_3 = 96 * pow(y, 2);
2333 const auto helper_4 = pow(z, 2);
2334 const auto helper_5 = 32 * y;
2335 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;
2336 val.col(1) = result_0;
2337 }
2338 {
2339 const auto helper_0 = 32 * y;
2340 result_0 = 4 * y * (helper_0 * x + helper_0 * z - 8 * x + 32 * pow(y, 2) - 36 * y - 8 * z + 7);
2341 val.col(2) = result_0;
2342 }
2343 }
2344 break;
2345 case 12:
2346 {
2347 {
2348 const auto helper_0 = 48 * x;
2349 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);
2350 val.col(0) = result_0;
2351 }
2352 {
2353 const auto helper_0 = 24 * y;
2354 const auto helper_1 = x * z;
2355 const auto helper_2 = pow(x, 2);
2356 const auto helper_3 = pow(y, 2);
2357 const auto helper_4 = pow(z, 2);
2358 const auto helper_5 = 24 * helper_3;
2359 const auto helper_6 = 16 * y;
2360 result_0 = 16 * helper_0 * x + 16 * helper_0 * z - 512 * helper_1 * y + 192 * helper_1 - 16 * helper_2 * helper_6 - 128 * helper_2 * z + 96 * helper_2 + 288 * helper_3 - 16 * helper_4 * helper_6 - 128 * helper_4 * x + 96 * helper_4 - 16 * helper_5 * x - 16 * helper_5 * z - 128.0 / 3.0 * pow(x, 3) - 208.0 / 3.0 * x - 512.0 / 3.0 * pow(y, 3) - 416.0 / 3.0 * y - 128.0 / 3.0 * pow(z, 3) - 208.0 / 3.0 * z + 16;
2361 val.col(1) = result_0;
2362 }
2363 {
2364 const auto helper_0 = 48 * x;
2365 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);
2366 val.col(2) = result_0;
2367 }
2368 }
2369 break;
2370 case 13:
2371 {
2372 {
2373 const auto helper_0 = 48 * x;
2374 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);
2375 val.col(0) = result_0;
2376 }
2377 {
2378 const auto helper_0 = 48 * x;
2379 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);
2380 val.col(1) = result_0;
2381 }
2382 {
2383 const auto helper_0 = x * y;
2384 const auto helper_1 = 24 * z;
2385 const auto helper_2 = pow(x, 2);
2386 const auto helper_3 = pow(y, 2);
2387 const auto helper_4 = pow(z, 2);
2388 const auto helper_5 = 24 * helper_4;
2389 const auto helper_6 = 16 * z;
2390 result_0 = -512 * helper_0 * z + 192 * helper_0 + 16 * helper_1 * x + 16 * helper_1 * y - 16 * helper_2 * helper_6 - 128 * helper_2 * y + 96 * helper_2 - 16 * helper_3 * helper_6 - 128 * helper_3 * x + 96 * helper_3 + 288 * helper_4 - 16 * helper_5 * x - 16 * helper_5 * y - 128.0 / 3.0 * pow(x, 3) - 208.0 / 3.0 * x - 128.0 / 3.0 * pow(y, 3) - 208.0 / 3.0 * y - 512.0 / 3.0 * pow(z, 3) - 416.0 / 3.0 * z + 16;
2391 val.col(2) = result_0;
2392 }
2393 }
2394 break;
2395 case 14:
2396 {
2397 {
2398 const auto helper_0 = 32 * z;
2399 result_0 = 4 * z * (helper_0 * x + helper_0 * y - 8 * x - 8 * y + 32 * pow(z, 2) - 36 * z + 7);
2400 val.col(0) = result_0;
2401 }
2402 {
2403 const auto helper_0 = 32 * z;
2404 result_0 = 4 * z * (helper_0 * x + helper_0 * y - 8 * x - 8 * y + 32 * pow(z, 2) - 36 * z + 7);
2405 val.col(1) = result_0;
2406 }
2407 {
2408 const auto helper_0 = x * y;
2409 const auto helper_1 = 72 * z;
2410 const auto helper_2 = pow(x, 2);
2411 const auto helper_3 = pow(y, 2);
2412 const auto helper_4 = 96 * pow(z, 2);
2413 const auto helper_5 = 32 * z;
2414 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;
2415 val.col(2) = result_0;
2416 }
2417 }
2418 break;
2419 case 15:
2420 {
2421 {
2422 result_0 = -16.0 / 3.0 * z * (8 * pow(z, 2) - 6 * z + 1);
2423 val.col(0) = result_0;
2424 }
2425 {
2426 result_0 = -16.0 / 3.0 * z * (8 * pow(z, 2) - 6 * z + 1);
2427 val.col(1) = result_0;
2428 }
2429 {
2430 const auto helper_0 = 4 * z;
2431 const auto helper_1 = pow(z, 2);
2432 const auto helper_2 = 8 * helper_1;
2433 result_0 = 16 * helper_0 * x + 16 * helper_0 * y + 224 * helper_1 - 16 * helper_2 * x - 16 * helper_2 * y - 16.0 / 3.0 * x - 16.0 / 3.0 * y - 512.0 / 3.0 * pow(z, 3) - 224.0 / 3.0 * z + 16.0 / 3.0;
2434 val.col(2) = result_0;
2435 }
2436 }
2437 break;
2438 case 16:
2439 {
2440 {
2441 result_0 = (16.0 / 3.0) * z * (24 * pow(x, 2) - 12 * x + 1);
2442 val.col(0) = result_0;
2443 }
2444 {
2445 result_0.setZero();
2446 val.col(1) = result_0;
2447 }
2448 {
2449 result_0 = (16.0 / 3.0) * x * (8 * pow(x, 2) - 6 * x + 1);
2450 val.col(2) = result_0;
2451 }
2452 }
2453 break;
2454 case 17:
2455 {
2456 {
2457 const auto helper_0 = 4 * z;
2458 result_0 = helper_0 * (-helper_0 + 32 * x * z - 8 * x + 1);
2459 val.col(0) = result_0;
2460 }
2461 {
2462 result_0.setZero();
2463 val.col(1) = result_0;
2464 }
2465 {
2466 const auto helper_0 = 4 * x;
2467 result_0 = helper_0 * (-helper_0 + 32 * x * z - 8 * z + 1);
2468 val.col(2) = result_0;
2469 }
2470 }
2471 break;
2472 case 18:
2473 {
2474 {
2475 result_0 = (16.0 / 3.0) * z * (8 * pow(z, 2) - 6 * z + 1);
2476 val.col(0) = result_0;
2477 }
2478 {
2479 result_0.setZero();
2480 val.col(1) = result_0;
2481 }
2482 {
2483 result_0 = (16.0 / 3.0) * x * (24 * pow(z, 2) - 12 * z + 1);
2484 val.col(2) = result_0;
2485 }
2486 }
2487 break;
2488 case 19:
2489 {
2490 {
2491 result_0.setZero();
2492 val.col(0) = result_0;
2493 }
2494 {
2495 result_0 = (16.0 / 3.0) * z * (24 * pow(y, 2) - 12 * y + 1);
2496 val.col(1) = result_0;
2497 }
2498 {
2499 result_0 = (16.0 / 3.0) * y * (8 * pow(y, 2) - 6 * y + 1);
2500 val.col(2) = result_0;
2501 }
2502 }
2503 break;
2504 case 20:
2505 {
2506 {
2507 result_0.setZero();
2508 val.col(0) = result_0;
2509 }
2510 {
2511 const auto helper_0 = 4 * z;
2512 result_0 = helper_0 * (-helper_0 + 32 * y * z - 8 * y + 1);
2513 val.col(1) = result_0;
2514 }
2515 {
2516 const auto helper_0 = 4 * y;
2517 result_0 = helper_0 * (-helper_0 + 32 * y * z - 8 * z + 1);
2518 val.col(2) = result_0;
2519 }
2520 }
2521 break;
2522 case 21:
2523 {
2524 {
2525 result_0.setZero();
2526 val.col(0) = result_0;
2527 }
2528 {
2529 result_0 = (16.0 / 3.0) * z * (8 * pow(z, 2) - 6 * z + 1);
2530 val.col(1) = result_0;
2531 }
2532 {
2533 result_0 = (16.0 / 3.0) * y * (24 * pow(z, 2) - 12 * z + 1);
2534 val.col(2) = result_0;
2535 }
2536 }
2537 break;
2538 case 22:
2539 {
2540 {
2541 const auto helper_0 = 16 * x;
2542 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);
2543 val.col(0) = result_0;
2544 }
2545 {
2546 const auto helper_0 = 16 * y;
2547 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);
2548 val.col(1) = result_0;
2549 }
2550 {
2551 result_0 = 32 * x * y * (8 * x + 8 * y + 8 * z - 7);
2552 val.col(2) = result_0;
2553 }
2554 }
2555 break;
2556 case 23:
2557 {
2558 {
2559 result_0 = -32 * y * (8 * x * y - 2 * x + 4 * pow(y, 2) + 4 * y * z - 5 * y - z + 1);
2560 val.col(0) = result_0;
2561 }
2562 {
2563 const auto helper_0 = 8 * y;
2564 result_0 = -32 * x * (helper_0 * x + helper_0 * z - x + 12 * pow(y, 2) - 10 * y - z + 1);
2565 val.col(1) = result_0;
2566 }
2567 {
2568 result_0 = -32 * x * y * (4 * y - 1);
2569 val.col(2) = result_0;
2570 }
2571 }
2572 break;
2573 case 24:
2574 {
2575 {
2576 const auto helper_0 = 8 * x;
2577 result_0 = -32 * y * (helper_0 * y + helper_0 * z + 12 * pow(x, 2) - 10 * x - y - z + 1);
2578 val.col(0) = result_0;
2579 }
2580 {
2581 result_0 = -32 * x * (4 * pow(x, 2) + 8 * x * y + 4 * x * z - 5 * x - 2 * y - z + 1);
2582 val.col(1) = result_0;
2583 }
2584 {
2585 result_0 = -32 * x * y * (4 * x - 1);
2586 val.col(2) = result_0;
2587 }
2588 }
2589 break;
2590 case 25:
2591 {
2592 {
2593 const auto helper_0 = 16 * x;
2594 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);
2595 val.col(0) = result_0;
2596 }
2597 {
2598 result_0 = 32 * x * z * (8 * x + 8 * y + 8 * z - 7);
2599 val.col(1) = result_0;
2600 }
2601 {
2602 const auto helper_0 = 16 * z;
2603 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);
2604 val.col(2) = result_0;
2605 }
2606 }
2607 break;
2608 case 26:
2609 {
2610 {
2611 result_0 = -32 * z * (8 * x * z - 2 * x + 4 * y * z - y + 4 * pow(z, 2) - 5 * z + 1);
2612 val.col(0) = result_0;
2613 }
2614 {
2615 result_0 = -32 * x * z * (4 * z - 1);
2616 val.col(1) = result_0;
2617 }
2618 {
2619 const auto helper_0 = 8 * z;
2620 result_0 = -32 * x * (helper_0 * x + helper_0 * y - x - y + 12 * pow(z, 2) - 10 * z + 1);
2621 val.col(2) = result_0;
2622 }
2623 }
2624 break;
2625 case 27:
2626 {
2627 {
2628 const auto helper_0 = 8 * x;
2629 result_0 = -32 * z * (helper_0 * y + helper_0 * z + 12 * pow(x, 2) - 10 * x - y - z + 1);
2630 val.col(0) = result_0;
2631 }
2632 {
2633 result_0 = -32 * x * z * (4 * x - 1);
2634 val.col(1) = result_0;
2635 }
2636 {
2637 result_0 = -32 * x * (4 * pow(x, 2) + 4 * x * y + 8 * x * z - 5 * x - y - 2 * z + 1);
2638 val.col(2) = result_0;
2639 }
2640 }
2641 break;
2642 case 28:
2643 {
2644 {
2645 result_0 = 32 * y * z * (8 * x - 1);
2646 val.col(0) = result_0;
2647 }
2648 {
2649 result_0 = 32 * x * z * (4 * x - 1);
2650 val.col(1) = result_0;
2651 }
2652 {
2653 result_0 = 32 * x * y * (4 * x - 1);
2654 val.col(2) = result_0;
2655 }
2656 }
2657 break;
2658 case 29:
2659 {
2660 {
2661 result_0 = 32 * y * z * (4 * z - 1);
2662 val.col(0) = result_0;
2663 }
2664 {
2665 result_0 = 32 * x * z * (4 * z - 1);
2666 val.col(1) = result_0;
2667 }
2668 {
2669 result_0 = 32 * x * y * (8 * z - 1);
2670 val.col(2) = result_0;
2671 }
2672 }
2673 break;
2674 case 30:
2675 {
2676 {
2677 result_0 = 32 * y * z * (4 * y - 1);
2678 val.col(0) = result_0;
2679 }
2680 {
2681 result_0 = 32 * x * z * (8 * y - 1);
2682 val.col(1) = result_0;
2683 }
2684 {
2685 result_0 = 32 * x * y * (4 * y - 1);
2686 val.col(2) = result_0;
2687 }
2688 }
2689 break;
2690 case 31:
2691 {
2692 {
2693 result_0 = -32 * y * z * (4 * y - 1);
2694 val.col(0) = result_0;
2695 }
2696 {
2697 const auto helper_0 = 8 * y;
2698 result_0 = -32 * z * (helper_0 * x + helper_0 * z - x + 12 * pow(y, 2) - 10 * y - z + 1);
2699 val.col(1) = result_0;
2700 }
2701 {
2702 result_0 = -32 * y * (4 * x * y - x + 4 * pow(y, 2) + 8 * y * z - 5 * y - 2 * z + 1);
2703 val.col(2) = result_0;
2704 }
2705 }
2706 break;
2707 case 32:
2708 {
2709 {
2710 result_0 = -32 * y * z * (4 * z - 1);
2711 val.col(0) = result_0;
2712 }
2713 {
2714 result_0 = -32 * z * (4 * x * z - x + 8 * y * z - 2 * y + 4 * pow(z, 2) - 5 * z + 1);
2715 val.col(1) = result_0;
2716 }
2717 {
2718 const auto helper_0 = 8 * z;
2719 result_0 = -32 * y * (helper_0 * x + helper_0 * y - x - y + 12 * pow(z, 2) - 10 * z + 1);
2720 val.col(2) = result_0;
2721 }
2722 }
2723 break;
2724 case 33:
2725 {
2726 {
2727 result_0 = 32 * y * z * (8 * x + 8 * y + 8 * z - 7);
2728 val.col(0) = result_0;
2729 }
2730 {
2731 const auto helper_0 = 16 * y;
2732 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);
2733 val.col(1) = result_0;
2734 }
2735 {
2736 const auto helper_0 = 16 * z;
2737 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);
2738 val.col(2) = result_0;
2739 }
2740 }
2741 break;
2742 case 34:
2743 {
2744 {
2745 result_0 = -256 * y * z * (2 * x + y + z - 1);
2746 val.col(0) = result_0;
2747 }
2748 {
2749 result_0 = -256 * x * z * (x + 2 * y + z - 1);
2750 val.col(1) = result_0;
2751 }
2752 {
2753 result_0 = -256 * x * y * (x + y + 2 * z - 1);
2754 val.col(2) = result_0;
2755 }
2756 }
2757 break;
2758 default:
2759 assert(false);
2760 }
2761 }
2762
2763 void p_4_nodes_3d(Eigen::MatrixXd &res)
2764 {
2765 res.resize(35, 3);
2766 res << 0, 0, 0,
2767 1, 0, 0,
2768 0, 1, 0,
2769 0, 0, 1,
2770 1.0 / 4.0, 0, 0,
2771 1.0 / 2.0, 0, 0,
2772 3.0 / 4.0, 0, 0,
2773 3.0 / 4.0, 1.0 / 4.0, 0,
2774 1.0 / 2.0, 1.0 / 2.0, 0,
2775 1.0 / 4.0, 3.0 / 4.0, 0,
2776 0, 3.0 / 4.0, 0,
2777 0, 1.0 / 2.0, 0,
2778 0, 1.0 / 4.0, 0,
2779 0, 0, 1.0 / 4.0,
2780 0, 0, 1.0 / 2.0,
2781 0, 0, 3.0 / 4.0,
2782 3.0 / 4.0, 0, 1.0 / 4.0,
2783 1.0 / 2.0, 0, 1.0 / 2.0,
2784 1.0 / 4.0, 0, 3.0 / 4.0,
2785 0, 3.0 / 4.0, 1.0 / 4.0,
2786 0, 1.0 / 2.0, 1.0 / 2.0,
2787 0, 1.0 / 4.0, 3.0 / 4.0,
2788 1.0 / 4.0, 1.0 / 4.0, 0,
2789 1.0 / 4.0, 1.0 / 2.0, 0,
2790 1.0 / 2.0, 1.0 / 4.0, 0,
2791 1.0 / 4.0, 0, 1.0 / 4.0,
2792 1.0 / 4.0, 0, 1.0 / 2.0,
2793 1.0 / 2.0, 0, 1.0 / 4.0,
2794 1.0 / 2.0, 1.0 / 4.0, 1.0 / 4.0,
2795 1.0 / 4.0, 1.0 / 4.0, 1.0 / 2.0,
2796 1.0 / 4.0, 1.0 / 2.0, 1.0 / 4.0,
2797 0, 1.0 / 2.0, 1.0 / 4.0,
2798 0, 1.0 / 4.0, 1.0 / 2.0,
2799 0, 1.0 / 4.0, 1.0 / 4.0,
2800 1.0 / 4.0, 1.0 / 4.0, 1.0 / 4.0;
2801 }
2802
2803 } // namespace
2804
2805 void p_nodes_3d(const int p, Eigen::MatrixXd &val)
2806 {
2807 switch (p)
2808 {
2809 case 0:
2810 p_0_nodes_3d(val);
2811 break;
2812 case 1:
2813 p_1_nodes_3d(val);
2814 break;
2815 case 2:
2816 p_2_nodes_3d(val);
2817 break;
2818 case 3:
2819 p_3_nodes_3d(val);
2820 break;
2821 case 4:
2822 p_4_nodes_3d(val);
2823 break;
2824 default:
2825 p_n_nodes_3d(p, val);
2826 }
2827 }
2828 void p_basis_value_3d(const int p, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
2829 {
2830 switch (p)
2831 {
2832 case 0:
2833 p_0_basis_value_3d(local_index, uv, val);
2834 break;
2835 case 1:
2836 p_1_basis_value_3d(local_index, uv, val);
2837 break;
2838 case 2:
2839 p_2_basis_value_3d(local_index, uv, val);
2840 break;
2841 case 3:
2842 p_3_basis_value_3d(local_index, uv, val);
2843 break;
2844 case 4:
2845 p_4_basis_value_3d(local_index, uv, val);
2846 break;
2847 default:
2848 p_n_basis_value_3d(p, local_index, uv, val);
2849 }
2850 }
2851
2852 void p_grad_basis_value_3d(const int p, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
2853 {
2854 switch (p)
2855 {
2856 case 0:
2857 p_0_basis_grad_value_3d(local_index, uv, val);
2858 break;
2859 case 1:
2860 p_1_basis_grad_value_3d(local_index, uv, val);
2861 break;
2862 case 2:
2863 p_2_basis_grad_value_3d(local_index, uv, val);
2864 break;
2865 case 3:
2866 p_3_basis_grad_value_3d(local_index, uv, val);
2867 break;
2868 case 4:
2869 p_4_basis_grad_value_3d(local_index, uv, val);
2870 break;
2871 default:
2872 p_n_basis_grad_value_3d(p, local_index, uv, val);
2873 }
2874 }
2875
2876 namespace
2877 {
2878
2879 }
2880 } // namespace autogen
2881} // 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:80
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)