PolyFEM
Loading...
Searching...
No Matches
auto_q_bases_3d_grad_2.cpp
Go to the documentation of this file.
1#include <Eigen/Dense>
2#include <cassert>
3 namespace polyfem {
4namespace autogen {void q_2_basis_grad_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val){
5
6auto x=uv.col(0).array();
7auto y=uv.col(1).array();
8auto z=uv.col(2).array();
9
10val.resize(uv.rows(), uv.cols());
11 Eigen::ArrayXd result_0(uv.rows());
12switch(local_index){
13 case 0: {{result_0 = (4.0*x - 3.0)*(y - 1)*(2.0*y - 1.0)*(z - 1)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = (x - 1)*(2.0*x - 1.0)*(4.0*y - 3.0)*(z - 1)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = (x - 1)*(2.0*x - 1.0)*(y - 1)*(2.0*y - 1.0)*(4.0*z - 3.0);val.col(2) = result_0; }} break;
14 case 1: {{result_0 = (4.0*x - 1.0)*(y - 1)*(2.0*y - 1.0)*(z - 1)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = x*(2.0*x - 1.0)*(4.0*y - 3.0)*(z - 1)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = x*(2.0*x - 1.0)*(y - 1)*(2.0*y - 1.0)*(4.0*z - 3.0);val.col(2) = result_0; }} break;
15 case 2: {{result_0 = y*(4.0*x - 1.0)*(2.0*y - 1.0)*(z - 1)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = x*(2.0*x - 1.0)*(4.0*y - 1.0)*(z - 1)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = x*y*(2.0*x - 1.0)*(2.0*y - 1.0)*(4.0*z - 3.0);val.col(2) = result_0; }} break;
16 case 3: {{result_0 = y*(4.0*x - 3.0)*(2.0*y - 1.0)*(z - 1)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = (x - 1)*(2.0*x - 1.0)*(4.0*y - 1.0)*(z - 1)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = y*(x - 1)*(2.0*x - 1.0)*(2.0*y - 1.0)*(4.0*z - 3.0);val.col(2) = result_0; }} break;
17 case 4: {{result_0 = z*(4.0*x - 3.0)*(y - 1)*(2.0*y - 1.0)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = z*(x - 1)*(2.0*x - 1.0)*(4.0*y - 3.0)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = (x - 1)*(2.0*x - 1.0)*(y - 1)*(2.0*y - 1.0)*(4.0*z - 1.0);val.col(2) = result_0; }} break;
18 case 5: {{result_0 = z*(4.0*x - 1.0)*(y - 1)*(2.0*y - 1.0)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = x*z*(2.0*x - 1.0)*(4.0*y - 3.0)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = x*(2.0*x - 1.0)*(y - 1)*(2.0*y - 1.0)*(4.0*z - 1.0);val.col(2) = result_0; }} break;
19 case 6: {{result_0 = y*z*(4.0*x - 1.0)*(2.0*y - 1.0)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = x*z*(2.0*x - 1.0)*(4.0*y - 1.0)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = x*y*(2.0*x - 1.0)*(2.0*y - 1.0)*(4.0*z - 1.0);val.col(2) = result_0; }} break;
20 case 7: {{result_0 = y*z*(4.0*x - 3.0)*(2.0*y - 1.0)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = z*(x - 1)*(2.0*x - 1.0)*(4.0*y - 1.0)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = y*(x - 1)*(2.0*x - 1.0)*(2.0*y - 1.0)*(4.0*z - 1.0);val.col(2) = result_0; }} break;
21 case 8: {{result_0 = -4.0*(2*x - 1)*(y - 1)*(2.0*y - 1.0)*(z - 1)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = -x*(x - 1)*(16.0*y - 12.0)*(z - 1)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = -x*(x - 1)*(y - 1)*(2.0*y - 1.0)*(16.0*z - 12.0);val.col(2) = result_0; }} break;
22 case 9: {{result_0 = -y*(16.0*x - 4.0)*(y - 1)*(z - 1)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = -4.0*x*(2.0*x - 1.0)*(2*y - 1)*(z - 1)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = -x*y*(2.0*x - 1.0)*(y - 1)*(16.0*z - 12.0);val.col(2) = result_0; }} break;
23 case 10: {{result_0 = -4.0*y*(2*x - 1)*(2.0*y - 1.0)*(z - 1)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = -x*(x - 1)*(16.0*y - 4.0)*(z - 1)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = -x*y*(x - 1)*(2.0*y - 1.0)*(16.0*z - 12.0);val.col(2) = result_0; }} break;
24 case 11: {{result_0 = -y*(16.0*x - 12.0)*(y - 1)*(z - 1)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = -4.0*(x - 1)*(2.0*x - 1.0)*(2*y - 1)*(z - 1)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = -y*(x - 1)*(2.0*x - 1.0)*(y - 1)*(16.0*z - 12.0);val.col(2) = result_0; }} break;
25 case 12: {{result_0 = -z*(16.0*x - 12.0)*(y - 1)*(2.0*y - 1.0)*(z - 1);val.col(0) = result_0; }{result_0 = -z*(x - 1)*(2.0*x - 1.0)*(16.0*y - 12.0)*(z - 1);val.col(1) = result_0; }{result_0 = -4.0*(x - 1)*(2.0*x - 1.0)*(y - 1)*(2.0*y - 1.0)*(2*z - 1);val.col(2) = result_0; }} break;
26 case 13: {{result_0 = -z*(16.0*x - 4.0)*(y - 1)*(2.0*y - 1.0)*(z - 1);val.col(0) = result_0; }{result_0 = -x*z*(2.0*x - 1.0)*(16.0*y - 12.0)*(z - 1);val.col(1) = result_0; }{result_0 = -4.0*x*(2.0*x - 1.0)*(y - 1)*(2.0*y - 1.0)*(2*z - 1);val.col(2) = result_0; }} break;
27 case 14: {{result_0 = -y*z*(16.0*x - 4.0)*(2.0*y - 1.0)*(z - 1);val.col(0) = result_0; }{result_0 = -x*z*(2.0*x - 1.0)*(16.0*y - 4.0)*(z - 1);val.col(1) = result_0; }{result_0 = -4.0*x*y*(2.0*x - 1.0)*(2.0*y - 1.0)*(2*z - 1);val.col(2) = result_0; }} break;
28 case 15: {{result_0 = -y*z*(16.0*x - 12.0)*(2.0*y - 1.0)*(z - 1);val.col(0) = result_0; }{result_0 = -z*(x - 1)*(2.0*x - 1.0)*(16.0*y - 4.0)*(z - 1);val.col(1) = result_0; }{result_0 = -4.0*y*(x - 1)*(2.0*x - 1.0)*(2.0*y - 1.0)*(2*z - 1);val.col(2) = result_0; }} break;
29 case 16: {{result_0 = -4.0*z*(2*x - 1)*(y - 1)*(2.0*y - 1.0)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = -x*z*(x - 1)*(16.0*y - 12.0)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = -x*(x - 1)*(y - 1)*(2.0*y - 1.0)*(16.0*z - 4.0);val.col(2) = result_0; }} break;
30 case 17: {{result_0 = -y*z*(16.0*x - 4.0)*(y - 1)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = -4.0*x*z*(2.0*x - 1.0)*(2*y - 1)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = -x*y*(2.0*x - 1.0)*(y - 1)*(16.0*z - 4.0);val.col(2) = result_0; }} break;
31 case 18: {{result_0 = -4.0*y*z*(2*x - 1)*(2.0*y - 1.0)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = -x*z*(x - 1)*(16.0*y - 4.0)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = -x*y*(x - 1)*(2.0*y - 1.0)*(16.0*z - 4.0);val.col(2) = result_0; }} break;
32 case 19: {{result_0 = -y*z*(16.0*x - 12.0)*(y - 1)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = -4.0*z*(x - 1)*(2.0*x - 1.0)*(2*y - 1)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = -y*(x - 1)*(2.0*x - 1.0)*(y - 1)*(16.0*z - 4.0);val.col(2) = result_0; }} break;
33 case 20: {{result_0 = y*z*(64.0*x - 48.0)*(y - 1)*(z - 1);val.col(0) = result_0; }{result_0 = 16.0*z*(x - 1)*(2.0*x - 1.0)*(2*y - 1)*(z - 1);val.col(1) = result_0; }{result_0 = 16.0*y*(x - 1)*(2.0*x - 1.0)*(y - 1)*(2*z - 1);val.col(2) = result_0; }} break;
34 case 21: {{result_0 = y*z*(64.0*x - 16.0)*(y - 1)*(z - 1);val.col(0) = result_0; }{result_0 = 16.0*x*z*(2.0*x - 1.0)*(2*y - 1)*(z - 1);val.col(1) = result_0; }{result_0 = 16.0*x*y*(2.0*x - 1.0)*(y - 1)*(2*z - 1);val.col(2) = result_0; }} break;
35 case 22: {{result_0 = 16.0*z*(2*x - 1)*(y - 1)*(2.0*y - 1.0)*(z - 1);val.col(0) = result_0; }{result_0 = x*z*(x - 1)*(64.0*y - 48.0)*(z - 1);val.col(1) = result_0; }{result_0 = 16.0*x*(x - 1)*(y - 1)*(2.0*y - 1.0)*(2*z - 1);val.col(2) = result_0; }} break;
36 case 23: {{result_0 = 16.0*y*z*(2*x - 1)*(2.0*y - 1.0)*(z - 1);val.col(0) = result_0; }{result_0 = x*z*(x - 1)*(64.0*y - 16.0)*(z - 1);val.col(1) = result_0; }{result_0 = 16.0*x*y*(x - 1)*(2.0*y - 1.0)*(2*z - 1);val.col(2) = result_0; }} break;
37 case 24: {{result_0 = 16.0*y*(2*x - 1)*(y - 1)*(z - 1)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = 16.0*x*(x - 1)*(2*y - 1)*(z - 1)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = x*y*(x - 1)*(y - 1)*(64.0*z - 48.0);val.col(2) = result_0; }} break;
38 case 25: {{result_0 = 16.0*y*z*(2*x - 1)*(y - 1)*(2.0*z - 1.0);val.col(0) = result_0; }{result_0 = 16.0*x*z*(x - 1)*(2*y - 1)*(2.0*z - 1.0);val.col(1) = result_0; }{result_0 = x*y*(x - 1)*(y - 1)*(64.0*z - 16.0);val.col(2) = result_0; }} break;
39 case 26: {{result_0 = -64.0*y*z*(2*x - 1)*(y - 1)*(z - 1);val.col(0) = result_0; }{result_0 = -64.0*x*z*(x - 1)*(2*y - 1)*(z - 1);val.col(1) = result_0; }{result_0 = -64.0*x*y*(x - 1)*(y - 1)*(2*z - 1);val.col(2) = result_0; }} break;
40 default: assert(false);
41}}
42
43}}
double val
Definition Assembler.cpp:86
int y
int z
int x
void q_2_basis_grad_value_3d(const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)