23const real_t ND_HexahedronElement::tk[18] =
24{ 1.,0.,0., 0.,1.,0., 0.,0.,1., -1.,0.,0., 0.,-1.,0., 0.,0.,-1. };
27 const int cb_type,
const int ob_type)
30 dof2tk(dof), cp(
poly1d.ClosedPoints(
p, cb_type))
37 const int dof3 =
dof/3;
39#ifndef MFEM_THREAD_SAFE
53 for (
int i = 0; i <
p; i++)
55 dof_map[0*dof3 + i + (0 + 0*(
p + 1))*
p] = o++;
57 for (
int i = 0; i <
p; i++)
61 for (
int i = 0; i <
p; i++)
65 for (
int i = 0; i <
p; i++)
67 dof_map[1*dof3 + 0 + (i + 0*
p)*(
p + 1)] = o++;
69 for (
int i = 0; i <
p; i++)
73 for (
int i = 0; i <
p; i++)
77 for (
int i = 0; i <
p; i++)
81 for (
int i = 0; i <
p; i++)
85 for (
int i = 0; i <
p; i++)
87 dof_map[2*dof3 + 0 + (0 + i*(
p + 1))*(
p + 1)] = o++;
89 for (
int i = 0; i <
p; i++)
91 dof_map[2*dof3 +
p + (0 + i*(
p + 1))*(
p + 1)] = o++;
93 for (
int i = 0; i <
p; i++)
95 dof_map[2*dof3 +
p + (
p + i*(
p + 1))*(
p + 1)] = o++;
97 for (
int i = 0; i <
p; i++)
99 dof_map[2*dof3 + 0 + (
p + i*(
p + 1))*(
p + 1)] = o++;
104 for (
int j = 1; j <
p; j++)
105 for (
int i = 0; i <
p; i++)
107 dof_map[0*dof3 + i + ((
p - j) + 0*(
p + 1))*
p] = o++;
109 for (
int j = 0; j <
p; j++)
110 for (
int i = 1; i <
p; i++)
112 dof_map[1*dof3 + i + ((
p - 1 - j) + 0*
p)*(
p + 1)] = -1 - (o++);
115 for (
int k = 1; k <
p; k++)
116 for (
int i = 0; i <
p; i++)
118 dof_map[0*dof3 + i + (0 + k*(
p + 1))*
p] = o++;
120 for (
int k = 0; k <
p; k++)
121 for (
int i = 1; i <
p; i++ )
123 dof_map[2*dof3 + i + (0 + k*(
p + 1))*(
p + 1)] = o++;
126 for (
int k = 1; k <
p; k++)
127 for (
int j = 0; j <
p; j++)
129 dof_map[1*dof3 +
p + (j + k*
p)*(
p + 1)] = o++;
131 for (
int k = 0; k <
p; k++)
132 for (
int j = 1; j <
p; j++)
134 dof_map[2*dof3 +
p + (j + k*(
p + 1))*(
p + 1)] = o++;
137 for (
int k = 1; k <
p; k++)
138 for (
int i = 0; i <
p; i++)
140 dof_map[0*dof3 + (
p - 1 - i) + (
p + k*(
p + 1))*
p] = -1 - (o++);
142 for (
int k = 0; k <
p; k++)
143 for (
int i = 1; i <
p; i++)
145 dof_map[2*dof3 + (
p - i) + (
p + k*(
p + 1))*(
p + 1)] = o++;
148 for (
int k = 1; k <
p; k++)
149 for (
int j = 0; j <
p; j++)
151 dof_map[1*dof3 + 0 + ((
p - 1 - j) + k*
p)*(
p + 1)] = -1 - (o++);
153 for (
int k = 0; k <
p; k++)
154 for (
int j = 1; j <
p; j++)
156 dof_map[2*dof3 + 0 + ((
p - j) + k*(
p + 1))*(
p + 1)] = o++;
159 for (
int j = 1; j <
p; j++)
160 for (
int i = 0; i <
p; i++)
162 dof_map[0*dof3 + i + (j +
p*(
p + 1))*
p] = o++;
164 for (
int j = 0; j <
p; j++)
165 for (
int i = 1; i <
p; i++)
167 dof_map[1*dof3 + i + (j +
p*
p)*(
p + 1)] = o++;
172 for (
int k = 1; k <
p; k++)
173 for (
int j = 1; j <
p; j++)
174 for (
int i = 0; i <
p; i++)
176 dof_map[0*dof3 + i + (j + k*(
p + 1))*
p] = o++;
179 for (
int k = 1; k <
p; k++)
180 for (
int j = 0; j <
p; j++)
181 for (
int i = 1; i <
p; i++)
183 dof_map[1*dof3 + i + (j + k*
p)*(
p + 1)] = o++;
186 for (
int k = 0; k <
p; k++)
187 for (
int j = 1; j <
p; j++)
188 for (
int i = 1; i <
p; i++)
190 dof_map[2*dof3 + i + (j + k*(
p + 1))*(
p + 1)] = o++;
196 for (
int k = 0; k <=
p; k++)
197 for (
int j = 0; j <=
p; j++)
198 for (
int i = 0; i <
p; i++)
203 dof2tk[idx = -1 - idx] = 3;
212 for (
int k = 0; k <=
p; k++)
213 for (
int j = 0; j <
p; j++)
214 for (
int i = 0; i <=
p; i++)
219 dof2tk[idx = -1 - idx] = 4;
228 for (
int k = 0; k <
p; k++)
229 for (
int j = 0; j <=
p; j++)
230 for (
int i = 0; i <=
p; i++)
235 dof2tk[idx = -1 - idx] = 5;
259 for (
int c = 0; c < 3; ++c)
265 for (
int k = 0; k <= km; k++)
266 for (
int j = 0; j <= jm; j++)
267 for (
int i = 0; i <= im; i++)
275 const int id1 = c == 0 ? i : (c == 1 ? j : k);
276 const real_t h = cp[id1+1] - cp[id1];
280 for (
int q = 0; q < nqpt; q++)
286 ip3d.
Set3(cp[i] + (h*ip1d.
x), cp[j], cp[k]);
290 ip3d.
Set3(cp[i], cp[j] + (h*ip1d.
x), cp[k]);
294 ip3d.
Set3(cp[i], cp[j], cp[k] + (h*ip1d.
x));
298 vc.
Eval(xk, Trans, ip3d);
302 val += ip1d.
weight * ipval;
315#ifdef MFEM_THREAD_SAFE
316 Vector shape_cx(
p + 1), shape_ox(
p), shape_cy(
p + 1), shape_oy(
p);
317 Vector shape_cz(
p + 1), shape_oz(
p);
322#ifdef MFEM_THREAD_SAFE
323 Vector dshape_cx(
p + 1), dshape_cy(
p + 1), dshape_cz(
p + 1);
345 for (
int k = 0; k <=
p; k++)
346 for (
int j = 0; j <=
p; j++)
347 for (
int i = 0; i <
p; i++)
352 idx = -1 - idx, s = -1;
358 shape(idx,0) = s*shape_ox(i)*shape_cy(j)*shape_cz(k);
363 for (
int k = 0; k <=
p; k++)
364 for (
int j = 0; j <
p; j++)
365 for (
int i = 0; i <=
p; i++)
370 idx = -1 - idx, s = -1;
377 shape(idx,1) = s*shape_cx(i)*shape_oy(j)*shape_cz(k);
381 for (
int k = 0; k <
p; k++)
382 for (
int j = 0; j <=
p; j++)
383 for (
int i = 0; i <=
p; i++)
388 idx = -1 - idx, s = -1;
396 shape(idx,2) = s*shape_cx(i)*shape_cy(j)*shape_oz(k);
405#ifdef MFEM_THREAD_SAFE
406 Vector shape_cx(
p + 1), shape_ox(
p), shape_cy(
p + 1), shape_oy(
p);
407 Vector shape_cz(
p + 1), shape_oz(
p);
408 Vector dshape_cx(
p + 1), dshape_cy(
p + 1), dshape_cz(
p + 1);
430 for (
int k = 0; k <=
p; k++)
431 for (
int j = 0; j <=
p; j++)
432 for (
int i = 0; i <
p; i++)
437 idx = -1 - idx, s = -1;
443 curl_shape(idx,0) = 0.;
444 curl_shape(idx,1) = s*shape_ox(i)* shape_cy(j)*dshape_cz(k);
445 curl_shape(idx,2) = -s*shape_ox(i)*dshape_cy(j)* shape_cz(k);
448 for (
int k = 0; k <=
p; k++)
449 for (
int j = 0; j <
p; j++)
450 for (
int i = 0; i <=
p; i++)
455 idx = -1 - idx, s = -1;
461 curl_shape(idx,0) = -s* shape_cx(i)*shape_oy(j)*dshape_cz(k);
462 curl_shape(idx,1) = 0.;
463 curl_shape(idx,2) = s*dshape_cx(i)*shape_oy(j)* shape_cz(k);
466 for (
int k = 0; k <
p; k++)
467 for (
int j = 0; j <=
p; j++)
468 for (
int i = 0; i <=
p; i++)
473 idx = -1 - idx, s = -1;
479 curl_shape(idx,0) = s* shape_cx(i)*dshape_cy(j)*shape_oz(k);
480 curl_shape(idx,1) = -s*dshape_cx(i)* shape_cy(j)*shape_oz(k);
481 curl_shape(idx,2) = 0.;
489 const int pp1 =
p + 1;
490 const int n_face_dofs_per_component =
p*pp1;
491 const int n_dof_per_dim =
p*pp1*pp1;
493 std::vector<int> n_dofs = {
p, pp1, pp1,
p};
494 std::vector<int> offsets, strides;
496 const auto f = internal::GetFaceNormal3D(face_id);
497 const int face_normal =
f.first, level =
f.second;
498 if (face_normal == 0)
502 n_dof_per_dim + (level ? pp1 - 1 : 0),
503 2*n_dof_per_dim + (level ? pp1 - 1 : 0)
505 strides = {pp1,
p*pp1, pp1, pp1*pp1};
507 else if (face_normal == 1)
511 level ?
p*(pp1 - 1) : 0,
512 2*n_dof_per_dim + (level ? pp1*(pp1 - 1) : 0)
514 strides = {1,
p*pp1, 1, pp1*pp1};
516 else if (face_normal == 2)
520 level ?
p*pp1*(pp1 - 1) : 0,
521 n_dof_per_dim + (level ?
p*pp1*(pp1 - 1) : 0)
523 strides = {1,
p, 1, pp1};
526 internal::FillFaceMap(n_face_dofs_per_component, offsets, strides, n_dofs,
530const real_t ND_QuadrilateralElement::tk[8] =
531{ 1.,0., 0.,1., -1.,0., 0.,-1. };
539 cp(
poly1d.ClosedPoints(
p, cb_type))
546 const int dof2 =
dof/2;
548#ifndef MFEM_THREAD_SAFE
559 for (
int i = 0; i <
p; i++)
563 for (
int j = 0; j <
p; j++)
567 for (
int i = 0; i <
p; i++)
569 dof_map[0*dof2 + (
p - 1 - i) +
p*
p] = -1 - (o++);
571 for (
int j = 0; j <
p; j++)
573 dof_map[1*dof2 + 0 + (
p - 1 - j)*(
p + 1)] = -1 - (o++);
578 for (
int j = 1; j <
p; j++)
579 for (
int i = 0; i <
p; i++)
584 for (
int j = 0; j <
p; j++)
585 for (
int i = 1; i <
p; i++)
587 dof_map[1*dof2 + i + j*(
p + 1)] = o++;
593 for (
int j = 0; j <=
p; j++)
594 for (
int i = 0; i <
p; i++)
599 dof2tk[idx = -1 - idx] = 2;
608 for (
int j = 0; j <
p; j++)
609 for (
int i = 0; i <=
p; i++)
614 dof2tk[idx = -1 - idx] = 3;
639 for (
int j = 0; j <=
order; j++)
640 for (
int i = 0; i <
order; i++)
648 const real_t h = cp[i+1] - cp[i];
652 for (
int k = 0; k < nqpt; k++)
656 ip2d.
Set2(cp[i] + (h*ip1d.
x), cp[j]);
659 vc.
Eval(xk, Trans, ip2d);
663 val += ip1d.
weight * ipval;
669 for (
int j = 0; j <
order; j++)
670 for (
int i = 0; i <=
order; i++)
678 const real_t h = cp[j+1] - cp[j];
682 for (
int k = 0; k < nqpt; k++)
686 ip2d.
Set2(cp[i], cp[j] + (h*ip1d.
x));
689 vc.
Eval(xk, Trans, ip2d);
693 val += ip1d.
weight * ipval;
705#ifdef MFEM_THREAD_SAFE
706 Vector shape_cx(
p + 1), shape_ox(
p), shape_cy(
p + 1), shape_oy(
p);
711#ifdef MFEM_THREAD_SAFE
712 Vector dshape_cx(
p + 1), dshape_cy(
p + 1);
730 for (
int j = 0; j <=
p; j++)
731 for (
int i = 0; i <
p; i++)
736 idx = -1 - idx, s = -1;
742 shape(idx,0) = s*shape_ox(i)*shape_cy(j);
746 for (
int j = 0; j <
p; j++)
747 for (
int i = 0; i <=
p; i++)
752 idx = -1 - idx, s = -1;
759 shape(idx,1) = s*shape_cx(i)*shape_oy(j);
768#ifdef MFEM_THREAD_SAFE
769 Vector shape_cx(
p + 1), shape_ox(
p), shape_cy(
p + 1), shape_oy(
p);
770 Vector dshape_cx(
p + 1), dshape_cy(
p + 1);
789 for (
int j = 0; j <=
p; j++)
790 for (
int i = 0; i <
p; i++)
795 idx = -1 - idx, s = -1;
801 curl_shape(idx,0) = -s*shape_ox(i)*dshape_cy(j);
804 for (
int j = 0; j <
p; j++)
805 for (
int i = 0; i <=
p; i++)
810 idx = -1 - idx, s = -1;
816 curl_shape(idx,0) = s*dshape_cx(i)*shape_oy(j);
824 const int pp1 =
order + 1;
825 const int n_face_dofs_per_component =
p;
826 std::vector<int> strides = {(face_id == 0 || face_id == 2) ? 1 : pp1};
827 std::vector<int> n_dofs = {
p};
828 std::vector<int> offsets;
831 case 0: offsets = {0};
break;
832 case 1: offsets = {
p*pp1 + pp1 - 1};
break;
833 case 2: offsets = {
p*(pp1 - 1)};
break;
834 case 3: offsets = {
p*pp1};
break;
836 internal::FillFaceMap(n_face_dofs_per_component, offsets, strides, n_dofs,
841const real_t ND_TetrahedronElement::tk[18] =
842{ 1.,0.,0., 0.,1.,0., 0.,0.,1., -1.,1.,0., -1.,0.,1., 0.,-1.,1. };
844const real_t ND_TetrahedronElement::c = 1./4.;
854 const int pm1 =
p - 1, pm2 =
p - 2, pm3 =
p - 3;
856#ifndef MFEM_THREAD_SAFE
867 Vector shape_x(
p), shape_y(
p), shape_z(
p), shape_l(
p);
872 for (
int i = 0; i <
p; i++)
877 for (
int i = 0; i <
p; i++)
882 for (
int i = 0; i <
p; i++)
887 for (
int i = 0; i <
p; i++)
892 for (
int i = 0; i <
p; i++)
897 for (
int i = 0; i <
p; i++)
904 for (
int j = 0; j <= pm2; j++)
905 for (
int i = 0; i + j <= pm2; i++)
907 real_t w = fop[i] + fop[j] + fop[pm2-i-j];
913 for (
int j = 0; j <= pm2; j++)
914 for (
int i = 0; i + j <= pm2; i++)
916 real_t w = fop[i] + fop[j] + fop[pm2-i-j];
922 for (
int j = 0; j <= pm2; j++)
923 for (
int i = 0; i + j <= pm2; i++)
925 real_t w = fop[i] + fop[j] + fop[pm2-i-j];
931 for (
int j = 0; j <= pm2; j++)
932 for (
int i = 0; i + j <= pm2; i++)
934 real_t w = fop[i] + fop[j] + fop[pm2-i-j];
942 for (
int k = 0; k <= pm3; k++)
943 for (
int j = 0; j + k <= pm3; j++)
944 for (
int i = 0; i + j + k <= pm3; i++)
946 real_t w = iop[i] + iop[j] + iop[k] + iop[pm3-i-j-k];
956 for (
int m = 0; m <
dof; m++)
959 const real_t *tm = tk + 3*dof2tk[m];
967 for (
int k = 0; k <= pm1; k++)
968 for (
int j = 0; j + k <= pm1; j++)
969 for (
int i = 0; i + j + k <= pm1; i++)
971 real_t s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(pm1-i-j-k);
972 T(o++, m) = s * tm[0];
973 T(o++, m) = s * tm[1];
974 T(o++, m) = s * tm[2];
976 for (
int k = 0; k <= pm1; k++)
977 for (
int j = 0; j + k <= pm1; j++)
979 real_t s = shape_x(pm1-j-k)*shape_y(j)*shape_z(k);
980 T(o++, m) = s*((ip.
y - c)*tm[0] - (ip.
x - c)*tm[1]);
981 T(o++, m) = s*((ip.
z - c)*tm[0] - (ip.
x - c)*tm[2]);
983 for (
int k = 0; k <= pm1; k++)
986 shape_y(pm1-k)*shape_z(k)*((ip.
z - c)*tm[1] - (ip.
y - c)*tm[2]);
997 const int pm1 =
order - 1;
999#ifdef MFEM_THREAD_SAFE
1001 Vector shape_x(
p), shape_y(
p), shape_z(
p), shape_l(
p);
1011 for (
int k = 0; k <= pm1; k++)
1012 for (
int j = 0; j + k <= pm1; j++)
1013 for (
int i = 0; i + j + k <= pm1; i++)
1015 real_t s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(pm1-i-j-k);
1016 u(n,0) = s;
u(n,1) = 0.;
u(n,2) = 0.; n++;
1017 u(n,0) = 0.;
u(n,1) = s;
u(n,2) = 0.; n++;
1018 u(n,0) = 0.;
u(n,1) = 0.;
u(n,2) = s; n++;
1020 for (
int k = 0; k <= pm1; k++)
1021 for (
int j = 0; j + k <= pm1; j++)
1023 real_t s = shape_x(pm1-j-k)*shape_y(j)*shape_z(k);
1024 u(n,0) = s*(ip.
y - c);
u(n,1) = -s*(ip.
x - c);
u(n,2) = 0.; n++;
1025 u(n,0) = s*(ip.
z - c);
u(n,1) = 0.;
u(n,2) = -s*(ip.
x - c); n++;
1027 for (
int k = 0; k <= pm1; k++)
1029 real_t s = shape_y(pm1-k)*shape_z(k);
1030 u(n,0) = 0.;
u(n,1) = s*(ip.
z - c);
u(n,2) = -s*(ip.
y - c); n++;
1039 const int pm1 =
order - 1;
1041#ifdef MFEM_THREAD_SAFE
1043 Vector shape_x(
p), shape_y(
p), shape_z(
p), shape_l(
p);
1044 Vector dshape_x(
p), dshape_y(
p), dshape_z(
p), dshape_l(
p);
1054 for (
int k = 0; k <= pm1; k++)
1055 for (
int j = 0; j + k <= pm1; j++)
1056 for (
int i = 0; i + j + k <= pm1; i++)
1059 const real_t dx = (dshape_x(i)*shape_l(l) -
1060 shape_x(i)*dshape_l(l))*shape_y(j)*shape_z(k);
1061 const real_t dy = (dshape_y(j)*shape_l(l) -
1062 shape_y(j)*dshape_l(l))*shape_x(i)*shape_z(k);
1063 const real_t dz = (dshape_z(k)*shape_l(l) -
1064 shape_z(k)*dshape_l(l))*shape_x(i)*shape_y(j);
1066 u(n,0) = 0.;
u(n,1) = dz;
u(n,2) = -dy; n++;
1067 u(n,0) = -dz;
u(n,1) = 0.;
u(n,2) = dx; n++;
1068 u(n,0) = dy;
u(n,1) = -dx;
u(n,2) = 0.; n++;
1070 for (
int k = 0; k <= pm1; k++)
1071 for (
int j = 0; j + k <= pm1; j++)
1073 int i = pm1 - j - k;
1076 u(n,0) = shape_x(i)*(ip.
x - c)*shape_y(j)*dshape_z(k);
1077 u(n,1) = shape_x(i)*shape_y(j)*(ip.
y - c)*dshape_z(k);
1079 -((dshape_x(i)*(ip.
x - c) + shape_x(i))*shape_y(j)*shape_z(k) +
1080 (dshape_y(j)*(ip.
y - c) + shape_y(j))*shape_x(i)*shape_z(k));
1083 u(n,0) = -shape_x(i)*(ip.
x - c)*dshape_y(j)*shape_z(k);
1084 u(n,1) = (shape_x(i)*shape_y(j)*(dshape_z(k)*(ip.
z - c) + shape_z(k)) +
1085 (dshape_x(i)*(ip.
x - c) + shape_x(i))*shape_y(j)*shape_z(k));
1086 u(n,2) = -shape_x(i)*dshape_y(j)*shape_z(k)*(ip.
z - c);
1089 for (
int k = 0; k <= pm1; k++)
1093 u(n,0) = -((dshape_y(j)*(ip.
y - c) + shape_y(j))*shape_z(k) +
1094 shape_y(j)*(dshape_z(k)*(ip.
z - c) + shape_z(k)));
1099 Ti.
Mult(
u, curl_shape);
1103const real_t ND_TriangleElement::tk[8] =
1104{ 1.,0., -1.,1., 0.,-1., 0.,1. };
1106const real_t ND_TriangleElement::c = 1./3.;
1111 dof2tk(dof), doftrans(
p)
1116 const int pm1 =
p - 1, pm2 =
p - 2;
1118#ifndef MFEM_THREAD_SAFE
1128 Vector shape_x(
p), shape_y(
p), shape_l(
p);
1133 for (
int i = 0; i <
p; i++)
1138 for (
int i = 0; i <
p; i++)
1143 for (
int i = 0; i <
p; i++)
1150 for (
int j = 0; j <= pm2; j++)
1151 for (
int i = 0; i + j <= pm2; i++)
1153 real_t w = iop[i] + iop[j] + iop[pm2-i-j];
1161 for (
int m = 0; m <
dof; m++)
1164 const real_t *tm = tk + 2*dof2tk[m];
1171 for (
int j = 0; j <= pm1; j++)
1172 for (
int i = 0; i + j <= pm1; i++)
1174 real_t s = shape_x(i)*shape_y(j)*shape_l(pm1-i-j);
1175 T(n++, m) = s * tm[0];
1176 T(n++, m) = s * tm[1];
1178 for (
int j = 0; j <= pm1; j++)
1181 shape_x(pm1-j)*shape_y(j)*((ip.
y - c)*tm[0] - (ip.
x - c)*tm[1]);
1192 const int pm1 =
order - 1;
1194#ifdef MFEM_THREAD_SAFE
1196 Vector shape_x(
p), shape_y(
p), shape_l(
p);
1205 for (
int j = 0; j <= pm1; j++)
1206 for (
int i = 0; i + j <= pm1; i++)
1208 real_t s = shape_x(i)*shape_y(j)*shape_l(pm1-i-j);
1209 u(n,0) = s;
u(n,1) = 0; n++;
1210 u(n,0) = 0;
u(n,1) = s; n++;
1212 for (
int j = 0; j <= pm1; j++)
1214 real_t s = shape_x(pm1-j)*shape_y(j);
1215 u(n,0) = s*(ip.
y - c);
1216 u(n,1) = -s*(ip.
x - c);
1226 const int pm1 =
order - 1;
1228#ifdef MFEM_THREAD_SAFE
1230 Vector shape_x(
p), shape_y(
p), shape_l(
p);
1231 Vector dshape_x(
p), dshape_y(
p), dshape_l(
p);
1240 for (
int j = 0; j <= pm1; j++)
1241 for (
int i = 0; i + j <= pm1; i++)
1244 const real_t dx = (dshape_x(i)*shape_l(l) -
1245 shape_x(i)*dshape_l(l)) * shape_y(j);
1246 const real_t dy = (dshape_y(j)*shape_l(l) -
1247 shape_y(j)*dshape_l(l)) * shape_x(i);
1253 for (
int j = 0; j <= pm1; j++)
1257 curlu(n++) = -((dshape_x(i)*(ip.
x - c) + shape_x(i)) * shape_y(j) +
1258 (dshape_y(j)*(ip.
y - c) + shape_y(j)) * shape_x(i));
1262 Ti.
Mult(curlu, curl2d);
1266const real_t ND_SegmentElement::tk[1] = { 1. };
1278 for (
int i = 0; i <
p; i++)
1312 for (
int i = 0; i <
dof; i++)
1314 const real_t h = cp[i+1] - cp[i];
1320 ip.
x = cp[i] + h*ip1d.
x;
1322 vc.
Eval(xk, Trans, ip);
1330const real_t ND_WedgeElement::tk[15] =
1331{ 1.,0.,0., -1.,1.,0., 0.,-1.,0., 0.,0.,1., 0.,1.,0. };
1337 3 *
p * ((
p + 1) * (
p + 2))/2,
p,
1343 H1TriangleFE(
p, cb_type),
1345 H1SegmentFE(
p, cb_type),
1346 NDSegmentFE(
p, ob_type)
1348 MFEM_ASSERT(H1TriangleFE.
GetDof() * NDSegmentFE.
GetDof() +
1350 "Mismatch in number of degrees of freedom "
1351 "when building ND_WedgeElement!");
1353#ifndef MFEM_THREAD_SAFE
1363 const int pm1 =
p - 1, pm2 =
p - 2;
1372 for (
int i = 0; i <
p; i++)
1374 t_dof[o] = i; s_dof[o] = 0; dof2tk[o] = 0;
1379 for (
int i = 0; i <
p; i++)
1381 t_dof[o] =
p + i; s_dof[o] = 0; dof2tk[o] = 1;
1386 for (
int i = 0; i <
p; i++)
1388 t_dof[o] = 2 *
p + i; s_dof[o] = 0; dof2tk[o] = 2;
1393 for (
int i = 0; i <
p; i++)
1395 t_dof[o] = i; s_dof[o] = 1; dof2tk[o] = 0;
1400 for (
int i = 0; i <
p; i++)
1402 t_dof[o] =
p + i; s_dof[o] = 1; dof2tk[o] = 1;
1407 for (
int i = 0; i <
p; i++)
1409 t_dof[o] = 2 *
p + i; s_dof[o] = 1; dof2tk[o] = 2;
1414 for (
int i = 0; i <
p; i++)
1416 t_dof[o] = 0; s_dof[o] = i; dof2tk[o] = 3;
1421 for (
int i = 0; i <
p; i++)
1423 t_dof[o] = 1; s_dof[o] = i; dof2tk[o] = 3;
1428 for (
int i = 0; i <
p; i++)
1430 t_dof[o] = 2; s_dof[o] = i; dof2tk[o] = 3;
1439 for (
int j = 0; j <= pm2; j++)
1440 for (
int i = 0; i + j <= pm2; i++)
1442 l = j + ( 2 *
p - 1 - i) * i / 2;
1443 t_dof[o] = 3 *
p + 2*l+1; s_dof[o] = 0; dof2tk[o] = 4;
1447 t_dof[o] = 3 *
p + 2*l; s_dof[o] = 0; dof2tk[o] = 0;
1454 for (
int j = 0; j <= pm2; j++)
1455 for (
int i = 0; i + j <= pm2; i++)
1457 t_dof[o] = 3 *
p + m; s_dof[o] = 1; dof2tk[o] = 0; m++;
1461 t_dof[o] = 3 *
p + m; s_dof[o] = 1; dof2tk[o] = 4; m++;
1467 for (
int j = 2; j <=
p; j++)
1468 for (
int i = 0; i <
p; i++)
1470 t_dof[o] = i; s_dof[o] = j; dof2tk[o] = 0;
1475 for (
int j = 0; j <
p; j++)
1476 for (
int i = 0; i < pm1; i++)
1478 t_dof[o] = 3 + i; s_dof[o] = j; dof2tk[o] = 3;
1484 for (
int j = 2; j <=
p; j++)
1485 for (
int i = 0; i <
p; i++)
1487 t_dof[o] =
p + i; s_dof[o] = j; dof2tk[o] = 1;
1492 for (
int j = 0; j <
p; j++)
1493 for (
int i = 0; i < pm1; i++)
1495 t_dof[o] =
p + 2 + i; s_dof[o] = j; dof2tk[o] = 3;
1501 for (
int j = 2; j <=
p; j++)
1502 for (
int i = 0; i <
p; i++)
1504 t_dof[o] = 2 *
p + i; s_dof[o] = j; dof2tk[o] = 2;
1509 for (
int j = 0; j <
p; j++)
1510 for (
int i = 0; i < pm1; i++)
1512 t_dof[o] = 2 *
p + 1 + i; s_dof[o] = j; dof2tk[o] = 3;
1519 for (
int k = 2; k <=
p; k++)
1522 for (
int j = 0; j <= pm2; j++)
1523 for (
int i = 0; i + j <= pm2; i++)
1525 t_dof[o] = 3 *
p + l; s_dof[o] = k; dof2tk[o] = 0; l++;
1529 t_dof[o] = 3 *
p + l; s_dof[o] = k; dof2tk[o] = 4; l++;
1535 for (
int k = 0; k <
p; k++)
1538 for (
int j = 0; j < pm2; j++)
1539 for (
int i = 0; i + j < pm2; i++)
1541 t_dof[o] = 3 *
p + l; s_dof[o] = k; dof2tk[o] = 3; l++;
1552#ifdef MFEM_THREAD_SAFE
1566 for (
int i=0; i<
dof; i++)
1568 if ( dof2tk[i] != 3 )
1570 shape(i, 0) = tn_shape(t_dof[i], 0) * s1_shape[s_dof[i]];
1571 shape(i, 1) = tn_shape(t_dof[i], 1) * s1_shape[s_dof[i]];
1578 shape(i, 2) = t1_shape[t_dof[i]] * sn_shape(s_dof[i], 0);
1586#ifdef MFEM_THREAD_SAFE
1604 for (
int i=0; i<
dof; i++)
1606 if ( dof2tk[i] != 3 )
1608 curl_shape(i, 0) = -tn_shape(t_dof[i], 1) * s1_dshape(s_dof[i], 0);
1609 curl_shape(i, 1) = tn_shape(t_dof[i], 0) * s1_dshape(s_dof[i], 0);
1610 curl_shape(i, 2) = tn_dshape(t_dof[i], 0) * s1_shape[s_dof[i]];
1614 curl_shape(i, 0) = t1_dshape(t_dof[i], 1) * sn_shape(s_dof[i], 0);
1615 curl_shape(i, 1) = -t1_dshape(t_dof[i], 0) * sn_shape(s_dof[i], 0);
1616 curl_shape(i, 2) = 0.0;
1621const real_t ND_FuentesPyramidElement::tk[27] =
1623 1., 0., 0., 0., 1., 0., 0., 0., 1.,
1624 -1., 0., 1., -1.,-1., 1., 0.,-1., 1.,
1625 -1., 0., 0., 0.,-1., 0., -M_SQRT1_2,-M_SQRT1_2,M_SQRT2
1633 dof2tk(dof), doftrans(
p)
1642 const int pm2 =
p - 2;
1644#ifndef MFEM_THREAD_SAFE
1680 for (
int i = 0; i <
p; i++)
1685 for (
int i = 0; i <
p; i++)
1690 for (
int i = 0; i <
p; i++)
1695 for (
int i = 0; i <
p; i++)
1700 for (
int i = 0; i <
p; i++)
1705 for (
int i = 0; i <
p; i++)
1710 for (
int i = 0; i <
p; i++)
1715 for (
int i = 0; i <
p; i++)
1723 for (
int j = 1; j <
p; j++)
1724 for (
int i = 0; i <
p; i++)
1731 for (
int j = 0; j <
p; j++)
1732 for (
int i = 1; i <
p; i++)
1739 for (
int j = 0; j <= pm2; j++)
1740 for (
int i = 0; i + j <= pm2; i++)
1742 real_t w = top[i] + top[j] + top[pm2-i-j];
1748 for (
int j = 0; j <= pm2; j++)
1749 for (
int i = 0; i + j <= pm2; i++)
1751 real_t w = top[i] + top[j] + top[pm2-i-j];
1757 for (
int j = 0; j <= pm2; j++)
1758 for (
int i = 0; i + j <= pm2; i++)
1760 real_t w = top[i] + top[j] + top[pm2-i-j];
1768 for (
int j = 0; j <= pm2; j++)
1769 for (
int i = 0; i + j <= pm2; i++)
1771 real_t w = top[i] + top[j] + top[pm2-i-j];
1780 for (
int k = 1; k <
p; k++)
1781 for (
int j = 1; j <
p; j++)
1782 for (
int i = 0; i <
p; i++)
1789 for (
int k = 1; k <
p; k++)
1790 for (
int j = 0; j <
p; j++)
1791 for (
int i = 1; i <
p; i++)
1798 for (
int k = 0; k <
p; k++)
1799 for (
int j = 1; j <
p; j++)
1800 for (
int i = 1; i <
p; i++)
1809 for (
int m = 0; m <
dof; m++)
1812 calcBasis(
p, ip, tmp_E_E_ij, tmp_E_Q1_ijk, tmp_E_Q2_ijk, tmp_E_T_ijk,
1813 tmp_phi_Q1_ij, tmp_dphi_Q1_ij, tmp_phi_Q2_ij,
1814 tmp_phi_E_i, tmp_dphi_E_i,
u);
1816 const Vector tm({tk[3*dof2tk[m]], tk[3*dof2tk[m]+1], tk[3*dof2tk[m]+2]});
1828#ifdef MFEM_THREAD_SAFE
1841 calcBasis(
p, ip, tmp_E_E_ij, tmp_E_Q1_ijk, tmp_E_Q2_ijk, tmp_E_T_ijk,
1842 tmp_phi_Q1_ij, tmp_dphi_Q1_ij, tmp_phi_Q2_ij,
1843 tmp_phi_E_i, tmp_dphi_E_i,
u);
1853#ifdef MFEM_THREAD_SAFE
1869 calcCurlBasis(
p, ip, tmp_E_E_ij, tmp_dE_E_ij, tmp_E_Q1_ijk, tmp_dE_Q1_ijk,
1870 tmp_E_Q2_ijk, tmp_dE_Q2_ijk, tmp_E_T_ijk, tmp_dE_T_ijk,
1871 tmp_phi_Q2_ij, tmp_dphi_Q2_ij, tmp_phi_E_i, tmp_dphi_E_i,
1874 Ti.
Mult(curlu, curl_shape);
1882#ifdef MFEM_THREAD_SAFE
1894 calcBasis(
p, ip, tmp_E_E_ij, tmp_E_Q1_ijk, tmp_E_Q2_ijk, tmp_E_T_ijk,
1895 tmp_phi_Q1_ij, tmp_dphi_Q1_ij, tmp_phi_Q2_ij,
1896 tmp_phi_E_i, tmp_dphi_E_i, shape);
1904#ifdef MFEM_THREAD_SAFE
1919 calcCurlBasis(
p, ip, tmp_E_E_ij, tmp_dE_E_ij, tmp_E_Q1_ijk, tmp_dE_Q1_ijk,
1920 tmp_E_Q2_ijk, tmp_dE_Q2_ijk, tmp_E_T_ijk, tmp_dE_T_ijk,
1921 tmp_phi_Q2_ij, tmp_dphi_Q2_ij, tmp_phi_E_i, tmp_dphi_E_i,
1925void ND_FuentesPyramidElement::calcBasis(
const int p,
1941 Vector xy({x,y}), dmu(3);
1947 y = 0.5 * (1.0 - z);
1948 x = 0.5 * (1.0 - z);
1949 xy(0) = x; xy(1) = y;
1951 zmax = std::max(z, zmax);
1963 for (
int i=0; i<
p; i++, o++)
1964 for (
int k=0; k<3; k++)
1966 W(o, k) =
mu * E_E_ik(i, k);
1971 for (
int i=0; i<
p; i++, o++)
1972 for (
int k=0; k<3; k++)
1974 W(o, k) =
mu * E_E_ik(i, k);
1980 for (
int i=0; i<
p; i++, o++)
1981 for (
int k=0; k<3; k++)
1983 W(o, k) =
mu * E_E_ik(i, k);
1988 for (
int i=0; i<
p; i++, o++)
1989 for (
int k=0; k<3; k++)
1991 W(o, k) =
mu * E_E_ik(i, k);
1999 for (
int i=0; i<
p; i++, o++)
2000 for (
int k=0; k<3; k++)
2002 W(o, k) = E_E_ik(i, k);
2006 for (
int i=0; i<
p; i++, o++)
2007 for (
int k=0; k<3; k++)
2009 W(o, k) = E_E_ik(i, k);
2013 for (
int i=0; i<
p; i++, o++)
2014 for (
int k=0; k<3; k++)
2016 W(o, k) = E_E_ik(i, k);
2020 for (
int i=0; i<
p; i++, o++)
2021 for (
int k=0; k<3; k++)
2023 W(o, k) = E_E_ik(i, k);
2028 if (z < 1.0 && p >= 2)
2034 E_Q(
p,
mu01(z, xy, 1),
mu01_grad_mu01(z, xy, 1),
mu01(z, xy, 2),
2036 for (
int j=2; j<=
p; j++)
2037 for (
int i=0; i<
p; i++, o++)
2038 for (
int k=0; k<3; k++)
2040 W(o, k) = mu2 * E_Q1_ijk(i, j, k);
2044 E_Q(
p,
mu01(z, xy, 2),
mu01_grad_mu01(z, xy, 2),
mu01(z, xy, 1),
2046 for (
int j=2; j<=
p; j++)
2047 for (
int i=0; i<
p; i++, o++)
2048 for (
int k=0; k<3; k++)
2050 W(o, k) = mu2 * E_Q2_ijk(i, j, k);
2055 if (z < 1.0 && p >= 2)
2061 for (
int j=1; j<
p; j++)
2062 for (
int i=0; i+j<
p; i++, o++)
2063 for (
int k=0; k<3; k++)
2065 W(o, k) =
mu * E_T_ijk(i, j, k);
2070 for (
int j=1; j<
p; j++)
2071 for (
int i=0; i+j<
p; i++, o++)
2072 for (
int k=0; k<3; k++)
2074 W(o, k) =
mu * E_T_ijk(i, j, k);
2080 for (
int j=1; j<
p; j++)
2081 for (
int i=0; i+j<
p; i++, o++)
2082 for (
int k=0; k<3; k++)
2084 W(o, k) =
mu * E_T_ijk(i, j, k);
2089 for (
int j=1; j<
p; j++)
2090 for (
int i=0; i+j<
p; i++, o++)
2091 for (
int k=0; k<3; k++)
2093 W(o, k) =
mu * E_T_ijk(i, j, k);
2100 for (
int j=1; j<
p; j++)
2101 for (
int i=0; i+j<
p; i++, o++)
2102 for (
int k=0; k<3; k++)
2104 W(o, k) =
mu * E_T_ijk(i, j, k);
2109 for (
int j=1; j<
p; j++)
2110 for (
int i=0; i+j<
p; i++, o++)
2111 for (
int k=0; k<3; k++)
2113 W(o, k) =
mu * E_T_ijk(i, j, k);
2119 for (
int j=1; j<
p; j++)
2120 for (
int i=0; i+j<
p; i++, o++)
2121 for (
int k=0; k<3; k++)
2123 W(o, k) =
mu * E_T_ijk(i, j, k);
2128 for (
int j=1; j<
p; j++)
2129 for (
int i=0; i+j<
p; i++, o++)
2130 for (
int k=0; k<3; k++)
2132 W(o, k) =
mu * E_T_ijk(i, j, k);
2137 if (z < 1.0 && p >= 2)
2140 phi_Q(
p,
mu01(z, xy, 1),
grad_mu01(z, xy, 1),
mu01(z, xy, 2),
2141 grad_mu01(z, xy, 2), phi_Q1_ij, dphi_Q1_ij);
2143 for (
int k=2; k<=
p; k++)
2144 for (
int j=2; j<=
p; j++)
2145 for (
int i=2; i<=
p; i++, o++)
2146 for (
int l=0; l<3; l++)
2147 W(o, l) = dphi_Q1_ij(i, j, l) * phi_E_k(k) +
2148 phi_Q1_ij(i, j) * dphi_E_k(k, l);
2152 for (
int k=2; k<=
p; k++)
2153 for (
int j=2; j<=
p; j++)
2154 for (
int i=0; i<
p; i++, o++)
2155 for (
int l=0; l<3; l++)
2157 W(o, l) =
mu * E_Q1_ijk(i, j, l) * phi_E_k(k);
2161 for (
int k=2; k<=
p; k++)
2162 for (
int j=2; j<=
p; j++)
2163 for (
int i=0; i<
p; i++, o++)
2164 for (
int l=0; l<3; l++)
2166 W(o, l) =
mu * E_Q2_ijk(i, j, l) * phi_E_k(k);
2173 for (
int j=2; j<=
p; j++)
2174 for (
int i=2; i<=
p; i++, o++)
2176 const int n = std::max(i,j);
2178 for (
int l=0; l<3; l++)
2180 W(o, l) = nmu * phi_Q2_ij(i, j) * dmu(l);
2186void ND_FuentesPyramidElement::calcCurlBasis(
const int p,
2187 const IntegrationPoint &ip,
2188 DenseMatrix & E_E_ik,
2189 DenseMatrix & dE_E_ik,
2190 DenseTensor & E_Q1_ijk,
2191 DenseTensor & dE_Q1_ijk,
2192 DenseTensor & E_Q2_ijk,
2193 DenseTensor & dE_Q2_ijk,
2194 DenseTensor & E_T_ijk,
2195 DenseTensor & dE_T_ijk,
2196 DenseMatrix & phi_Q2_ij,
2197 DenseTensor & dphi_Q2_ij,
2199 DenseMatrix & dphi_E_k,
2200 DenseMatrix & dW)
const
2205 Vector xy({x,y}), dmu(3);
2206 Vector dmuxE(3), E(3), dphi(3), muphi(3);
2213 y = 0.5 * (1.0 - z);
2214 x = 0.5 * (1.0 - z);
2215 xy(0) = x; xy(1) = y;
2217 zmax = std::max(z, zmax);
2230 for (
int i=0; i<
p; i++, o++)
2232 E(0) = E_E_ik(i, 0); E(1) = E_E_ik(i, 1); E(2) = E_E_ik(i, 2);
2233 dmu.cross3D(E, dmuxE);
2234 for (
int k=0; k<3; k++)
2236 dW(o, k) =
mu * dE_E_ik(i, k) + dmuxE(k);
2243 for (
int i=0; i<
p; i++, o++)
2245 E(0) = E_E_ik(i, 0); E(1) = E_E_ik(i, 1); E(2) = E_E_ik(i, 2);
2246 dmu.cross3D(E, dmuxE);
2247 for (
int k=0; k<3; k++)
2249 dW(o, k) =
mu * dE_E_ik(i, k) + dmuxE(k);
2257 for (
int i=0; i<
p; i++, o++)
2259 E(0) = E_E_ik(i, 0); E(1) = E_E_ik(i, 1); E(2) = E_E_ik(i, 2);
2260 dmu.cross3D(E, dmuxE);
2261 for (
int k=0; k<3; k++)
2263 dW(o, k) =
mu * dE_E_ik(i, k) + dmuxE(k);
2270 for (
int i=0; i<
p; i++, o++)
2272 E(0) = E_E_ik(i, 0); E(1) = E_E_ik(i, 1); E(2) = E_E_ik(i, 2);
2273 dmu.cross3D(E, dmuxE);
2274 for (
int k=0; k<3; k++)
2276 dW(o, k) =
mu * dE_E_ik(i, k) + dmuxE(k);
2285 for (
int i=0; i<
p; i++, o++)
2286 for (
int k=0; k<3; k++)
2288 dW(o, k) = dE_E_ik(i, k);
2292 for (
int i=0; i<
p; i++, o++)
2293 for (
int k=0; k<3; k++)
2295 dW(o, k) = dE_E_ik(i, k);
2299 for (
int i=0; i<
p; i++, o++)
2300 for (
int k=0; k<3; k++)
2302 dW(o, k) = dE_E_ik(i, k);
2306 for (
int i=0; i<
p; i++, o++)
2307 for (
int k=0; k<3; k++)
2309 dW(o, k) = dE_E_ik(i, k);
2314 if (z < 1.0 && p >= 2)
2323 for (
int j=2; j<=
p; j++)
2324 for (
int i=0; i<
p; i++, o++)
2326 E(0) = E_Q1_ijk(i, j, 0);
2327 E(1) = E_Q1_ijk(i, j, 1);
2328 E(2) = E_Q1_ijk(i, j, 2);
2329 dmu.cross3D(E, dmuxE);
2330 for (
int k=0; k<3; k++)
2332 dW(o, k) = mu2 * dE_Q1_ijk(i, j, k) + 2.0 *
mu * dmuxE(k);
2339 for (
int j=2; j<=
p; j++)
2340 for (
int i=0; i<
p; i++, o++)
2342 E(0) = E_Q2_ijk(i, j, 0);
2343 E(1) = E_Q2_ijk(i, j, 1);
2344 E(2) = E_Q2_ijk(i, j, 2);
2345 dmu.cross3D(E, dmuxE);
2346 for (
int k=0; k<3; k++)
2348 dW(o, k) = mu2 * dE_Q2_ijk(i, j, k) + 2.0 *
mu * dmuxE(k);
2354 if (z < 1.0 && p >= 2)
2361 for (
int j=1; j<
p; j++)
2362 for (
int i=0; i+j<
p; i++, o++)
2364 E(0) = E_T_ijk(i, j, 0);
2365 E(1) = E_T_ijk(i, j, 1);
2366 E(2) = E_T_ijk(i, j, 2);
2367 dmu.cross3D(E, dmuxE);
2368 for (
int k=0; k<3; k++)
2370 dW(o, k) =
mu * dE_T_ijk(i, j, k) + dmuxE(k);
2377 for (
int j=1; j<
p; j++)
2378 for (
int i=0; i+j<
p; i++, o++)
2380 E(0) = E_T_ijk(i, j, 0);
2381 E(1) = E_T_ijk(i, j, 1);
2382 E(2) = E_T_ijk(i, j, 2);
2383 dmu.cross3D(E, dmuxE);
2384 for (
int k=0; k<3; k++)
2386 dW(o, k) =
mu * dE_T_ijk(i, j, k) + dmuxE(k);
2394 for (
int j=1; j<
p; j++)
2395 for (
int i=0; i+j<
p; i++, o++)
2397 E(0) = E_T_ijk(i, j, 0);
2398 E(1) = E_T_ijk(i, j, 1);
2399 E(2) = E_T_ijk(i, j, 2);
2400 dmu.cross3D(E, dmuxE);
2401 for (
int k=0; k<3; k++)
2403 dW(o, k) =
mu * dE_T_ijk(i, j, k) + dmuxE(k);
2410 for (
int j=1; j<
p; j++)
2411 for (
int i=0; i+j<
p; i++, o++)
2413 E(0) = E_T_ijk(i, j, 0);
2414 E(1) = E_T_ijk(i, j, 1);
2415 E(2) = E_T_ijk(i, j, 2);
2416 dmu.cross3D(E, dmuxE);
2417 for (
int k=0; k<3; k++)
2419 dW(o, k) =
mu * dE_T_ijk(i, j, k) + dmuxE(k);
2428 for (
int j=1; j<
p; j++)
2429 for (
int i=0; i+j<
p; i++, o++)
2431 E(0) = E_T_ijk(i, j, 0);
2432 E(1) = E_T_ijk(i, j, 1);
2433 E(2) = E_T_ijk(i, j, 2);
2434 dmu.cross3D(E, dmuxE);
2435 for (
int k=0; k<3; k++)
2437 dW(o, k) =
mu * dE_T_ijk(i, j, k) + dmuxE(k);
2444 for (
int j=1; j<
p; j++)
2445 for (
int i=0; i+j<
p; i++, o++)
2447 E(0) = E_T_ijk(i, j, 0);
2448 E(1) = E_T_ijk(i, j, 1);
2449 E(2) = E_T_ijk(i, j, 2);
2450 dmu.cross3D(E, dmuxE);
2451 for (
int k=0; k<3; k++)
2453 dW(o, k) =
mu * dE_T_ijk(i, j, k) + dmuxE(k);
2461 for (
int j=1; j<
p; j++)
2462 for (
int i=0; i+j<
p; i++, o++)
2464 E(0) = E_T_ijk(i, j, 0);
2465 E(1) = E_T_ijk(i, j, 1);
2466 E(2) = E_T_ijk(i, j, 2);
2467 dmu.cross3D(E, dmuxE);
2468 for (
int k=0; k<3; k++)
2470 dW(o, k) =
mu * dE_T_ijk(i, j, k) + dmuxE(k);
2477 for (
int j=1; j<
p; j++)
2478 for (
int i=0; i+j<
p; i++, o++)
2480 E(0) = E_T_ijk(i, j, 0);
2481 E(1) = E_T_ijk(i, j, 1);
2482 E(2) = E_T_ijk(i, j, 2);
2483 dmu.cross3D(E, dmuxE);
2484 for (
int k=0; k<3; k++)
2486 dW(o, k) =
mu * dE_T_ijk(i, j, k) + dmuxE(k);
2492 if (z < 1.0 && p >= 2)
2496 o += (
p - 1) * (
p - 1) * (
p - 1);
2502 for (
int k=2; k<=
p; k++)
2504 dphi(0) = dphi_E_k(k, 0);
2505 dphi(1) = dphi_E_k(k, 1);
2506 dphi(2) = dphi_E_k(k, 2);
2507 add(
mu, dphi, phi_E_k(k), dmu, muphi);
2509 for (
int j=2; j<=
p; j++)
2510 for (
int i=0; i<
p; i++, o++)
2512 E(0) = E_Q1_ijk(i, j, 0);
2513 E(1) = E_Q1_ijk(i, j, 1);
2514 E(2) = E_Q1_ijk(i, j, 2);
2515 muphi.cross3D(E, dmuxE);
2516 for (
int l=0; l<3; l++)
2518 dW(o, l) =
mu * dE_Q1_ijk(i, j, l) * phi_E_k(k) + dmuxE(l);
2524 for (
int k=2; k<=
p; k++)
2526 dphi(0) = dphi_E_k(k, 0);
2527 dphi(1) = dphi_E_k(k, 1);
2528 dphi(2) = dphi_E_k(k, 2);
2529 add(
mu, dphi, phi_E_k(k), dmu, muphi);
2531 for (
int j=2; j<=
p; j++)
2532 for (
int i=0; i<
p; i++, o++)
2534 E(0) = E_Q2_ijk(i, j, 0);
2535 E(1) = E_Q2_ijk(i, j, 1);
2536 E(2) = E_Q2_ijk(i, j, 2);
2537 muphi.cross3D(E, dmuxE);
2538 for (
int l=0; l<3; l++)
2540 dW(o, l) =
mu * dE_Q2_ijk(i, j, l) * phi_E_k(k) + dmuxE(l);
2548 phi_Q(
p,
mu01(z, xy, 2),
grad_mu01(z, xy, 2),
mu01(z, xy, 1),
2549 grad_mu01(z, xy, 1), phi_Q2_ij, dphi_Q2_ij);
2550 for (
int j=2; j<=
p; j++)
2551 for (
int i=2; i<=
p; i++, o++)
2553 const int n = std::max(i,j);
2556 dphi(0) = dphi_Q2_ij(i, j, 0);
2557 dphi(1) = dphi_Q2_ij(i, j, 1);
2558 dphi(2) = dphi_Q2_ij(i, j, 2);
2559 dphi.cross3D(dmu, muphi);
2561 for (
int l=0; l<3; l++)
2563 dW(o, l) = nmu * muphi(l);
2596const real_t ND_R1D_SegmentElement::tk[9] = { 1.,0.,0., 0.,1.,0., 0.,0.,1. };
2604 cbasis1d(
poly1d.GetBasis(
p, VerifyClosed(cb_type))),
2605 obasis1d(
poly1d.GetBasis(
p - 1, VerifyOpen(ob_type)))
2619#ifndef MFEM_THREAD_SAFE
2631 dof_map[
p] = o; dof2tk[o++] = 1;
2633 dof_map[2*
p+1] = o; dof2tk[o++] = 2;
2637 dof_map[2*
p] = o; dof2tk[o++] = 1;
2639 dof_map[3*
p+1] = o; dof2tk[o++] = 2;
2643 for (
int i = 0; i <
p; i++)
2646 dof_map[i] = o; dof2tk[o++] = 0;
2649 for (
int i = 1; i <
p; i++)
2652 dof_map[
p+i] = o; dof2tk[o++] = 1;
2655 for (
int i = 1; i <
p; i++)
2658 dof_map[2*
p+1+i] = o; dof2tk[o++] = 2;
2667#ifdef MFEM_THREAD_SAFE
2668 Vector shape_cx(
p + 1), shape_ox(
p);
2671 cbasis1d.
Eval(ip.
x, shape_cx);
2672 obasis1d.
Eval(ip.
x, shape_ox);
2676 for (
int i = 0; i <
p; i++)
2678 int idx = dof_map[o++];
2679 shape(idx,0) = shape_ox(i);
2684 for (
int i = 0; i <=
p; i++)
2686 int idx = dof_map[o++];
2688 shape(idx,1) = shape_cx(i);
2692 for (
int i = 0; i <=
p; i++)
2694 int idx = dof_map[o++];
2697 shape(idx,2) = shape_cx(i);
2707 "ND_R1D_SegmentElement cannot be embedded in "
2708 "2 or 3 dimensional spaces");
2709 for (
int i=0; i<
dof; i++)
2711 shape(i, 0) *= JI(0,0);
2720#ifdef MFEM_THREAD_SAFE
2721 Vector shape_cx(
p + 1), shape_ox(
p);
2725 cbasis1d.
Eval(ip.
x, shape_cx, dshape_cx);
2726 obasis1d.
Eval(ip.
x, shape_ox);
2730 for (
int i = 0; i <
p; i++)
2732 int idx = dof_map[o++];
2733 curl_shape(idx,0) = 0.;
2734 curl_shape(idx,1) = 0.;
2735 curl_shape(idx,2) = 0.;
2738 for (
int i = 0; i <=
p; i++)
2740 int idx = dof_map[o++];
2741 curl_shape(idx,0) = 0.;
2742 curl_shape(idx,1) = 0.;
2743 curl_shape(idx,2) = dshape_cx(i);
2746 for (
int i = 0; i <=
p; i++)
2748 int idx = dof_map[o++];
2749 curl_shape(idx,0) = 0.;
2750 curl_shape(idx,1) = -dshape_cx(i);
2751 curl_shape(idx,2) = 0.;
2761 "ND_R1D_SegmentElement cannot be embedded in "
2762 "2 or 3 dimensional spaces");
2763 curl_shape *= (1.0 / J.
Weight());
2773 for (
int k = 0; k <
dof; k++)
2780 dofs(k) = Trans.
Jacobian()(0,0) * t(0) * vk(0) +
2781 t(1) * vk(1) + t(2) * vk(2);
2798 for (
int k = 0; k <
dof; k++)
2802 Vector t1(&tk_ptr[dof2tk[k] * 3], 1);
2803 Vector t3(&tk_ptr[dof2tk[k] * 3], 3);
2815 for (
int d = 0; d <
vdim; d++)
2821 for (
int j = 0; j < shape.
Size(); j++)
2824 if (fabs(s) < 1e-12)
2830 for (
int d = 0; d <
vdim; d++)
2832 I(k, j + d*shape.
Size()) = s*vk[d];
2845 for (
int k = 0; k <
dof; k++)
2849 Vector t1(&tk_ptr[dof2tk[k] * 3], 1);
2850 Vector t3(&tk_ptr[dof2tk[k] * 3], 3);
2862 I(k, j) +=
vshape(j, 0) * vk[0];
2865 I(k, j) +=
vshape(j, 1) * t3(1);
2866 I(k, j) +=
vshape(j, 2) * t3(2);
2873const real_t ND_R2D_SegmentElement::tk[4] = { 1.,0., 0.,1. };
2881 cbasis1d(
poly1d.GetBasis(
p, VerifyClosed(cb_type))),
2882 obasis1d(
poly1d.GetBasis(
p - 1, VerifyOpen(ob_type)))
2891#ifndef MFEM_THREAD_SAFE
2903 dof_map[
p] = o; dof2tk[o++] = 1;
2907 dof_map[2*
p] = o; dof2tk[o++] = 1;
2911 for (
int i = 0; i <
p; i++)
2914 dof_map[i] = o; dof2tk[o++] = 0;
2917 for (
int i = 1; i <
p; i++)
2920 dof_map[
p+i] = o; dof2tk[o++] = 1;
2929#ifdef MFEM_THREAD_SAFE
2930 Vector shape_cx(
p + 1), shape_ox(
p);
2933 cbasis1d.
Eval(ip.
x, shape_cx);
2934 obasis1d.
Eval(ip.
x, shape_ox);
2938 for (
int i = 0; i <
p; i++)
2940 int idx = dof_map[o++];
2941 shape(idx,0) = shape_ox(i);
2945 for (
int i = 0; i <=
p; i++)
2947 int idx = dof_map[o++];
2949 shape(idx,1) = shape_cx(i);
2959 "ND_R2D_SegmentElement cannot be embedded in "
2960 "2 or 3 dimensional spaces");
2961 for (
int i=0; i<
dof; i++)
2963 shape(i, 0) *= JI(0,0);
2972#ifdef MFEM_THREAD_SAFE
2973 Vector shape_cx(
p + 1), shape_ox(
p);
2977 cbasis1d.
Eval(ip.
x, shape_cx, dshape_cx);
2978 obasis1d.
Eval(ip.
x, shape_ox);
2982 for (
int i = 0; i <
p; i++)
2984 int idx = dof_map[o++];
2985 curl_shape(idx,0) = 0.;
2988 for (
int i = 0; i <=
p; i++)
2990 int idx = dof_map[o++];
2991 curl_shape(idx,0) = -dshape_cx(i);
3011 for (
int k = 0; k <
dof; k++)
3013 Vector t1(&tk_ptr[dof2tk[k] * 2], 1);
3014 Vector t2(&tk_ptr[dof2tk[k] * 2], 2);
3025 for (
int i = 0; i <
dim; i++)
3027 Ikj +=
vshape(j, i) * vk[i];
3029 Ikj +=
vshape(j, 1) * t2(1);
3030 I(k, j) = (fabs(Ikj) < 1e-12) ? 0.0 : Ikj;
3046 for (
int k = 0; k <
dof; k++)
3052 Vector t1(&tk_ptr[dof2tk[k] * 2], 1);
3053 Vector t2(&tk_ptr[dof2tk[k] * 2], 2);
3084 "ND_R2D_FiniteElement cannot be embedded in "
3085 "3 dimensional spaces");
3086 for (
int i=0; i<
dof; i++)
3090 shape(i, 0) = sx * JI(0, 0) + sy * JI(1, 0);
3091 shape(i, 1) = sx * JI(0, 1) + sy * JI(1, 1);
3101 "ND_R2D_FiniteElement cannot be embedded in "
3102 "3 dimensional spaces");
3103 for (
int i=0; i<
dof; i++)
3105 real_t sx = curl_shape(i, 0);
3106 real_t sy = curl_shape(i, 1);
3107 curl_shape(i, 0) = sx * J(0, 0) + sy * J(0, 1);
3108 curl_shape(i, 1) = sx * J(1, 0) + sy * J(1, 1);
3110 curl_shape *= (1.0 / Trans.
Weight());
3113void ND_R2D_FiniteElement::LocalInterpolation(
3121#ifdef MFEM_THREAD_SAFE
3134 for (
int k = 0; k <
dof; k++)
3148 for (
int i = 0; i <
dim; i++)
3150 Ikj +=
vshape(j, i) * vk[i];
3152 Ikj +=
vshape(j, 2) * t3(2);
3153 I(k, j) = (fabs(Ikj) < 1e-12) ? 0.0 : Ikj;
3165#ifdef MFEM_THREAD_SAFE
3173 for (
int j = 0; j <
dof; j++)
3183 Jinv.
Mult(t2, pt_data);
3184 for (
int k = 0; k <
dof; k++)
3187 for (
int d = 0; d <
dim; d++)
3189 R_jk +=
vshape(k,d)*pt_data[d];
3191 R_jk +=
vshape(k, 2) * t3(2);
3214 for (
int k = 0; k <
dof; k++)
3240 for (
int k = 0; k <
dof; k++)
3256 for (
int d = 0; d <
vdim; d++)
3262 for (
int j = 0; j < shape.
Size(); j++)
3265 if (fabs(s) < 1e-12)
3271 for (
int d = 0; d <
vdim; d++)
3273 I(k, j + d*shape.
Size()) = s*vk[d];
3286 for (
int k = 0; k <
dof; k++)
3303 for (
int i=0; i<2; i++)
3305 I(k, j) +=
vshape(j, i) * vk[i];
3309 I(k, j) +=
vshape(j, 2) * t3(2);
3326 for (
int k = 0; k <
dof; k++)
3330 for (
int j = 0; j < grad_k.
Size(); j++)
3332 grad(k,j) = (fabs(grad_k(j)) < 1e-12) ? 0.0 : grad_k(j);
3337const real_t ND_R2D_TriangleElement::tk_t[15] =
3338{ 1.,0.,0., -1.,1.,0., 0.,-1.,0., 0.,1.,0., 0.,0.,1. };
3346 int pm1 =
p - 1, pm2 =
p - 2;
3348#ifndef MFEM_THREAD_SAFE
3364 for (
int e=0; e<3; e++)
3367 for (
int i=0; i<
p; i++)
3372 for (
int i=0; i<pm1; i++)
3379 for (
int j = 0; j <= pm2; j++)
3380 for (
int i = 0; i + j <= pm2; i++)
3387 for (
int j = 0; j < pm1; j++)
3388 for (
int i = 0; i + j < pm2; i++)
3393 MFEM_VERIFY(n == ND_FE.
GetDof(),
3394 "ND_R2D_Triangle incorrect number of ND dofs.");
3395 MFEM_VERIFY(h == H1_FE.
GetDof(),
3396 "ND_R2D_Triangle incorrect number of H1 dofs.");
3397 MFEM_VERIFY(o ==
GetDof(),
3398 "ND_R2D_Triangle incorrect number of dofs.");
3403 for (
int i=0; i<
dof; i++)
3422#ifdef MFEM_THREAD_SAFE
3430 for (
int i=0; i<
dof; i++)
3435 shape(i, 0) = nd_shape(idx, 0);
3436 shape(i, 1) = nd_shape(idx, 1);
3443 shape(i, 2) = h1_shape(-idx-1);
3451#ifdef MFEM_THREAD_SAFE
3459 for (
int i=0; i<
dof; i++)
3464 curl_shape(i, 0) = 0.0;
3465 curl_shape(i, 1) = 0.0;
3466 curl_shape(i, 2) = nd_dshape(idx, 0);
3470 curl_shape(i, 0) = h1_dshape(-idx-1, 1);
3471 curl_shape(i, 1) = -h1_dshape(-idx-1, 0);
3472 curl_shape(i, 2) = 0.0;
3478const real_t ND_R2D_QuadrilateralElement::tk_q[15] =
3479{ 1.,0.,0., 0.,1.,0., -1.,0.,0., 0.,-1.,0., 0.,0.,1. };
3485 cbasis1d(
poly1d.GetBasis(
p, VerifyClosed(cb_type))),
3486 obasis1d(
poly1d.GetBasis(
p - 1, VerifyOpen(ob_type)))
3490 const int dofx =
p*(
p+1);
3491 const int dofy =
p*(
p+1);
3492 const int dofxy = dofx+dofy;
3494#ifndef MFEM_THREAD_SAFE
3513 for (
int i = 0; i <
p; i++)
3517 for (
int i = 1; i <
p; i++)
3519 dof_map[dofxy + i + 0*(
p+1)] = o++;
3521 for (
int j = 0; j <
p; j++)
3525 for (
int j = 1; j <
p; j++)
3529 for (
int i = 0; i <
p; i++)
3533 for (
int i = 1; i <
p; i++)
3537 for (
int j = 0; j <
p; j++)
3539 dof_map[dofx + 0 + (
p - 1 - j)*(
p + 1)] = -1 - (o++);
3541 for (
int j = 1; j <
p; j++)
3548 for (
int j = 1; j <
p; j++)
3549 for (
int i = 0; i <
p; i++)
3554 for (
int j = 0; j <
p; j++)
3555 for (
int i = 1; i <
p; i++)
3557 dof_map[dofx + i + j*(
p + 1)] = o++;
3560 for (
int j = 1; j <
p; j++)
3561 for (
int i = 1; i <
p; i++)
3563 dof_map[dofxy + i + j*(
p + 1)] = o++;
3569 for (
int j = 0; j <=
p; j++)
3570 for (
int i = 0; i <
p; i++)
3575 dof2tk[idx = -1 - idx] = 2;
3584 for (
int j = 0; j <
p; j++)
3585 for (
int i = 0; i <=
p; i++)
3590 dof2tk[idx = -1 - idx] = 3;
3599 for (
int j = 0; j <=
p; j++)
3600 for (
int i = 0; i <=
p; i++)
3613#ifdef MFEM_THREAD_SAFE
3614 Vector shape_cx(
p + 1), shape_ox(
p), shape_cy(
p + 1), shape_oy(
p);
3617 cbasis1d.
Eval(ip.
x, shape_cx);
3618 obasis1d.
Eval(ip.
x, shape_ox);
3619 cbasis1d.
Eval(ip.
y, shape_cy);
3620 obasis1d.
Eval(ip.
y, shape_oy);
3624 for (
int j = 0; j <=
p; j++)
3625 for (
int i = 0; i <
p; i++)
3630 idx = -1 - idx, s = -1;
3636 shape(idx,0) = s*shape_ox(i)*shape_cy(j);
3641 for (
int j = 0; j <
p; j++)
3642 for (
int i = 0; i <=
p; i++)
3647 idx = -1 - idx, s = -1;
3654 shape(idx,1) = s*shape_cx(i)*shape_oy(j);
3658 for (
int j = 0; j <=
p; j++)
3659 for (
int i = 0; i <=
p; i++)
3664 shape(idx,2) = shape_cx(i)*shape_cy(j);
3673#ifdef MFEM_THREAD_SAFE
3674 Vector shape_cx(
p + 1), shape_ox(
p), shape_cy(
p + 1), shape_oy(
p);
3675 Vector dshape_cx(
p + 1), dshape_cy(
p + 1);
3678 cbasis1d.
Eval(ip.
x, shape_cx, dshape_cx);
3679 obasis1d.
Eval(ip.
x, shape_ox);
3680 cbasis1d.
Eval(ip.
y, shape_cy, dshape_cy);
3681 obasis1d.
Eval(ip.
y, shape_oy);
3685 for (
int j = 0; j <=
p; j++)
3686 for (
int i = 0; i <
p; i++)
3691 idx = -1 - idx, s = -1;
3697 curl_shape(idx,0) = 0.;
3698 curl_shape(idx,1) = 0.;
3699 curl_shape(idx,2) = -s*shape_ox(i)*dshape_cy(j);
3702 for (
int j = 0; j <
p; j++)
3703 for (
int i = 0; i <=
p; i++)
3708 idx = -1 - idx, s = -1;
3714 curl_shape(idx,0) = 0.;
3715 curl_shape(idx,1) = 0.;
3716 curl_shape(idx,2) = s*dshape_cx(i)*shape_oy(j);
3719 for (
int j = 0; j <=
p; j++)
3720 for (
int i = 0; i <=
p; i++)
3723 curl_shape(idx,0) = shape_cx(i)*dshape_cy(j);
3724 curl_shape(idx,1) = -dshape_cx(i)*shape_cy(j);
3725 curl_shape(idx,2) = 0.;
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
@ GaussLobatto
Closed type.
void Factor()
Factor the current DenseMatrix, *a.
void Mult(const real_t *x, real_t *y) const
Matrix vector multiplication with the inverse of dense matrix.
Data type dense matrix using column-major storage.
void Mult(const real_t *x, real_t *y) const
Matrix vector multiplication.
void Threshold(real_t eps)
Replace small entries, abs(a_ij) <= eps, with zero.
void SetRow(int r, const real_t *row)
real_t InnerProduct(const real_t *x, const real_t *y) const
Compute y^t A x.
real_t * Data() const
Returns the matrix data array. Warning: this method casts away constness.
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
void GetColumn(int c, Vector &col) const
Rank 3 tensor (array of matrices)
void SetSize(int i, int j, int k, MemoryType mt_=MemoryType::PRESERVE)
Abstract class for all finite elements.
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
int dof
Number of degrees of freedom.
int GetRangeDim() const
Returns the vector dimension for vector-valued finite elements, which is also the dimension of the in...
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
int GetDim() const
Returns the reference space dimension for the finite element.
int vdim
Vector dimension of vector-valued basis functions.
int GetMapType() const
Returns the FiniteElement::MapType of the element describing how reference functions are mapped to ph...
int GetRangeType() const
Returns the FiniteElement::RangeType of the element, one of {SCALAR, VECTOR}.
const IntegrationRule & GetNodes() const
Get a const reference to the nodes of the element.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const =0
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
int cdim
Dimension of curl for vector-valued basis functions.
@ CURL
Implements CalcCurlShape methods.
Geometry::Type geom_type
Geometry::Type of the reference element.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const =0
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
int GetDof() const
Returns the number of degrees of freedom in the finite element.
int order
Order/degree of the shape functions.
int dim
Dimension of reference space.
static DenseMatrix grad_mu01(real_t z)
static Vector lam45_grad_lam45(real_t x, real_t y, real_t z)
void phi_Q(int p, Vector s, Vector t, DenseMatrix &u) const
static constexpr real_t apex_tol
static Vector lam45(real_t x, real_t y, real_t z)
static void phi_E(int p, real_t s0, real_t s1, real_t *u)
static Vector nu012(real_t z, Vector xy, unsigned int ab)
static DenseMatrix grad_nu120(real_t z, Vector xy, unsigned int ab)
static DenseMatrix grad_lam25(real_t x, real_t y, real_t z)
void E_E(int p, Vector s, Vector sds, DenseMatrix &u) const
static Vector nu01_grad_nu01(real_t z, Vector xy, unsigned int ab)
static Vector lam35(real_t x, real_t y, real_t z)
static Vector lam25(real_t x, real_t y, real_t z)
static Vector nu01(real_t z, Vector xy, unsigned int ab)
static Vector lam25_grad_lam25(real_t x, real_t y, real_t z)
static Vector mu01(real_t z)
static DenseMatrix grad_nu012(real_t z, Vector xy, unsigned int ab)
static Vector grad_mu1(real_t z)
void E_T(int p, Vector s, Vector sds, DenseTensor &u) const
static real_t mu0(real_t z)
static Vector nu120(real_t z, Vector xy, unsigned int ab)
static Vector lam15_grad_lam15(real_t x, real_t y, real_t z)
Computes .
static Vector lam35_grad_lam35(real_t x, real_t y, real_t z)
static Vector grad_mu0(real_t z)
static DenseMatrix grad_lam35(real_t x, real_t y, real_t z)
static DenseMatrix grad_lam15(real_t x, real_t y, real_t z)
Gradients of the above two component vectors.
void E_Q(int p, Vector s, Vector ds, Vector t, DenseTensor &u) const
static Vector lam15(real_t x, real_t y, real_t z)
Two component vectors associated with edges touching the apex.
static Vector mu01_grad_mu01(real_t z, Vector xy, unsigned int ab)
static real_t mu1(real_t z)
static DenseMatrix grad_lam45(real_t x, real_t y, real_t z)
static DenseMatrix grad_nu01(real_t z, Vector xy, unsigned int ab)
static Vector nu12_grad_nu12(real_t z, Vector xy, unsigned int ab)
Describes the function space on each element.
const IntegrationPoint & GetCenter(int GeomType) const
Return the center of the given Geometry::Type, GeomType.
static bool CheckPoint(int GeomType, const IntegrationPoint &ip)
Check if the given point is inside the given reference element.
void CalcShape(const IntegrationPoint &ip, Vector &shape) const override
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const override
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const override
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
void CalcShape(const IntegrationPoint &ip, Vector &shape) const override
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Class for integration point with weight.
void Set2(const real_t x1, const real_t x2)
void Set(const real_t x1, const real_t x2, const real_t x3, const real_t w)
void Set3(const real_t x1, const real_t x2, const real_t x3)
Class for an integration rule - an Array of IntegrationPoint.
int GetNPoints() const
Returns the number of the points in the integration rule.
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
void CalcRawVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
void CalcRawCurlShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
ND_FuentesPyramidElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
ND_HexahedronElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the ND_HexahedronElement of order p and closed and open BasisType cb_type and ob_type.
void GetFaceMap(const int face_id, Array< int > &face_map) const override
Return the mapping from lexicographic face DOFs to lexicographic element DOFs for the given local fac...
void ProjectIntegrated(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const override
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const override
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
ND_QuadrilateralElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the ND_QuadrilateralElement of order p and closed and open BasisType cb_type and ob_type.
void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const override
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
void GetFaceMap(const int face_id, Array< int > &face_map) const override
Return the mapping from lexicographic face DOFs to lexicographic element DOFs for the given local fac...
void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const override
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
void ProjectIntegrated(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const override
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
ND_R1D_PointElement(int p)
Construct the ND_R1D_PointElement.
void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const override
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
ND_R1D_SegmentElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the ND_R1D_SegmentElement of order p and closed and open BasisType cb_type and ob_type.
void CalcPhysCurlShape(ElementTransformation &Trans, DenseMatrix &curl_shape) const override
Evaluate the curl of all shape functions of a vector finite element in physical space at the point de...
void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const override
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const override
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
ND_R2D_FiniteElement(int p, Geometry::Type G, int Do, const real_t *tk_fe)
void CalcPhysCurlShape(ElementTransformation &Trans, DenseMatrix &curl_shape) const override
Evaluate the curl of all shape functions of a vector finite element in physical space at the point de...
void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const override
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
void CalcVShape(ElementTransformation &Trans, DenseMatrix &shape) const override
Evaluate the values of all shape functions of a vector finite element in physical space at the point ...
void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const override
Compute the discrete gradient matrix from the given FiniteElement onto 'this' FiniteElement....
void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const override
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs.
void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const override
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
ND_R2D_QuadrilateralElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the ND_R2D_QuadrilateralElement of order p and closed and open BasisType cb_type and ob_typ...
void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const override
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const override
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
ND_R2D_SegmentElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the ND_R2D_SegmentElement of order p and closed and open BasisType cb_type and ob_type.
void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const override
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const override
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
ND_R2D_TriangleElement(const int p, const int cb_type=BasisType::GaussLobatto)
Construct the ND_R2D_TriangleElement of order p.
void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const override
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const override
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
ND_SegmentElement(const int p, const int ob_type=BasisType::GaussLegendre)
Construct the ND_SegmentElement of order p and open BasisType ob_type.
void ProjectIntegrated(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const override
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
void CalcShape(const IntegrationPoint &ip, Vector &shape) const override
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const override
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
ND_TetrahedronElement(const int p)
Construct the ND_TetrahedronElement of order p.
void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const override
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const override
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const override
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
ND_TriangleElement(const int p)
Construct the ND_TriangleElement of order p.
void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const override
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const override
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
ND_WedgeElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
void Eval(const real_t x, Vector &u) const
Evaluate the basis functions at point x in [0,1].
bool IsIntegratedType() const
Returns true if the basis is "integrated", false otherwise.
void ScaleIntegrated(bool scale_integrated_)
Set whether the "integrated" basis should be scaled by the subcell sizes. Has no effect for non-integ...
void EvalIntegrated(const Vector &d, Vector &i) const
Evaluate the "integrated" basis type using pre-computed closed basis derivatives.
const real_t * ClosedPoints(const int p, const int btype=BasisType::GaussLobatto, bool on_device=false)
Get coordinates of a closed (GaussLobatto) set of points if degree p.
const real_t * OpenPoints(const int p, const int btype=BasisType::GaussLegendre, bool on_device=false)
Get coordinates of an open (GaussLegendre) set of points if degree p.
static void CalcBasis(const int p, const real_t x, real_t *u)
Evaluate the values of a hierarchical 1D basis at point x hierarchical = k-th basis function is degre...
Base class for vector Coefficients that optionally depend on time and space.
int GetVDim()
Returns dimension of the vector.
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the vector coefficient in the element described by T at the point ip, storing the result in ...
Intermediate class for finite elements whose basis functions return vector values.
Poly_1D::Basis & obasis1d
int Size() const
Returns the size of the vector.
void SetSize(int s)
Resize the vector to size s.
MFEM_HOST_DEVICE dual< value_type, gradient_type > pow(dual< value_type, gradient_type > a, dual< value_type, gradient_type > b)
implementation of a (dual) raised to the b (dual) power
real_t u(const Vector &xvec)
void add(const Vector &v1, const Vector &v2, Vector &v)
std::function< real_t(const Vector &)> f(real_t mass_coeff)
void InvertLinearTrans(ElementTransformation &trans, const IntegrationPoint &pt, Vector &x)
constexpr real_t infinity()
Define a shortcut for std::numeric_limits<double>::infinity()
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
real_t p(const Vector &x, real_t t)