23const real_t RT_QuadrilateralElement::nk[8] =
24{ 0., -1., 1., 0., 0., 1., -1., 0. };
32 cp(
poly1d.ClosedPoints(
p + 1, cb_type))
39 const int dof2 =
dof/2;
41#ifndef MFEM_THREAD_SAFE
52 for (
int i = 0; i <=
p; i++)
54 dof_map[1*dof2 + i + 0*(
p + 1)] = o++;
56 for (
int i = 0; i <=
p; i++)
58 dof_map[0*dof2 + (
p + 1) + i*(
p + 2)] = o++;
60 for (
int i = 0; i <=
p; i++)
62 dof_map[1*dof2 + (
p - i) + (
p + 1)*(
p + 1)] = o++;
64 for (
int i = 0; i <=
p; i++)
66 dof_map[0*dof2 + 0 + (
p - i)*(
p + 2)] = o++;
70 for (
int j = 0; j <=
p; j++)
71 for (
int i = 1; i <=
p; i++)
73 dof_map[0*dof2 + i + j*(
p + 2)] = o++;
75 for (
int j = 1; j <=
p; j++)
76 for (
int i = 0; i <=
p; i++)
78 dof_map[1*dof2 + i + j*(
p + 1)] = o++;
83 for (
int j = 0; j <=
p; j++)
84 for (
int i = 0; i <=
p/2; i++)
86 int idx = 0*dof2 + i + j*(
p + 2);
90 for (
int j =
p/2 + 1; j <=
p; j++)
92 int idx = 0*dof2 + (
p/2 + 1) + j*(
p + 2);
96 for (
int j = 0; j <=
p/2; j++)
97 for (
int i = 0; i <=
p; i++)
99 int idx = 1*dof2 + i + j*(
p + 1);
103 for (
int i = 0; i <=
p/2; i++)
105 int idx = 1*dof2 + i + (
p/2 + 1)*(
p + 1);
110 for (
int j = 0; j <=
p; j++)
111 for (
int i = 0; i <=
p + 1; i++)
125 for (
int j = 0; j <=
p + 1; j++)
126 for (
int i = 0; i <=
p; i++)
145 const int pp1 =
order;
147#ifdef MFEM_THREAD_SAFE
148 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
153#ifdef MFEM_THREAD_SAFE
154 Vector dshape_cx(pp1 + 1), dshape_cy(pp1 + 1);
171 for (
int j = 0; j < pp1; j++)
172 for (
int i = 0; i <= pp1; i++)
177 idx = -1 - idx, s = -1;
183 shape(idx,0) = s*shape_cx(i)*shape_oy(j);
186 for (
int j = 0; j <= pp1; j++)
187 for (
int i = 0; i < pp1; i++)
192 idx = -1 - idx, s = -1;
199 shape(idx,1) = s*shape_ox(i)*shape_cy(j);
206 const int pp1 =
order;
208#ifdef MFEM_THREAD_SAFE
209 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
210 Vector dshape_cx(pp1 + 1), dshape_cy(pp1 + 1);
228 for (
int j = 0; j < pp1; j++)
229 for (
int i = 0; i <= pp1; i++)
234 idx = -1 - idx, s = -1;
240 divshape(idx) = s*dshape_cx(i)*shape_oy(j);
242 for (
int j = 0; j <= pp1; j++)
243 for (
int i = 0; i < pp1; i++)
248 idx = -1 - idx, s = -1;
254 divshape(idx) = s*shape_ox(i)*dshape_cy(j);
272 for (
int c = 0; c < 2; c++)
276 for (
int j = 0; j < jm; j++)
277 for (
int i = 0; i < im; i++)
280 if (idx < 0) { idx = -1 - idx; }
281 int ic = (c == 0) ? j : i;
282 const real_t h = cp[ic+1] - cp[ic];
284 for (
int k = 0; k < nqpt; k++)
287 if (c == 0) { ip2d.
Set2(cp[i], cp[j] + (h*ip1d.
x)); }
288 else { ip2d.
Set2(cp[i] + (h*ip1d.
x), cp[j]); }
290 vc.
Eval(xk, Trans, ip2d);
293 nk + dof2nk[idx]*
dim);
305 const int pp1 =
p + 1;
306 const int n_face_dofs =
p;
308 std::vector<int> offsets;
309 std::vector<int> strides = {(face_id == 0 || face_id == 2) ? 1 : pp1};
312 case 0: offsets = {
p*pp1};
break;
313 case 1: offsets = {pp1 - 1};
break;
314 case 2: offsets = {
p*pp1 +
p*(pp1 - 1)};
break;
315 case 3: offsets = {0};
break;
318 std::vector<int> n_dofs(
dim - 1,
p);
319 internal::FillFaceMap(n_face_dofs, offsets, strides, n_dofs, face_map);
323const real_t RT_HexahedronElement::nk[18] =
324{ 0.,0.,-1., 0.,-1.,0., 1.,0.,0., 0.,1.,0., -1.,0.,0., 0.,0.,1. };
332 cp(
poly1d.ClosedPoints(
p + 1, cb_type))
339 const int dof3 =
dof/3;
341#ifndef MFEM_THREAD_SAFE
355 for (
int j = 0; j <=
p; j++)
356 for (
int i = 0; i <=
p; i++)
358 dof_map[2*dof3 + i + ((
p - j) + 0*(
p + 1))*(
p + 1)] = o++;
360 for (
int j = 0; j <=
p; j++)
361 for (
int i = 0; i <=
p; i++)
363 dof_map[1*dof3 + i + (0 + j*(
p + 2))*(
p + 1)] = o++;
365 for (
int j = 0; j <=
p; j++)
366 for (
int i = 0; i <=
p; i++)
368 dof_map[0*dof3 + (
p + 1) + (i + j*(
p + 1))*(
p + 2)] = o++;
370 for (
int j = 0; j <=
p; j++)
371 for (
int i = 0; i <=
p; i++)
373 dof_map[1*dof3 + (
p - i) + ((
p + 1) + j*(
p + 2))*(
p + 1)] = o++;
375 for (
int j = 0; j <=
p; j++)
376 for (
int i = 0; i <=
p; i++)
378 dof_map[0*dof3 + 0 + ((
p - i) + j*(
p + 1))*(
p + 2)] = o++;
380 for (
int j = 0; j <=
p; j++)
381 for (
int i = 0; i <=
p; i++)
383 dof_map[2*dof3 + i + (j + (
p + 1)*(
p + 1))*(
p + 1)] = o++;
388 for (
int k = 0; k <=
p; k++)
389 for (
int j = 0; j <=
p; j++)
390 for (
int i = 1; i <=
p; i++)
392 dof_map[0*dof3 + i + (j + k*(
p + 1))*(
p + 2)] = o++;
395 for (
int k = 0; k <=
p; k++)
396 for (
int j = 1; j <=
p; j++)
397 for (
int i = 0; i <=
p; i++)
399 dof_map[1*dof3 + i + (j + k*(
p + 2))*(
p + 1)] = o++;
402 for (
int k = 1; k <=
p; k++)
403 for (
int j = 0; j <=
p; j++)
404 for (
int i = 0; i <=
p; i++)
406 dof_map[2*dof3 + i + (j + k*(
p + 1))*(
p + 1)] = o++;
414 for (
int k = 0; k <=
p; k++)
415 for (
int j = 0; j <=
p; j++)
416 for (
int i = 0; i <=
p/2; i++)
418 int idx = 0*dof3 + i + (j + k*(
p + 1))*(
p + 2);
422 for (
int k = 0; k <=
p; k++)
423 for (
int j = 0; j <=
p/2; j++)
424 for (
int i = 0; i <=
p; i++)
426 int idx = 1*dof3 + i + (j + k*(
p + 2))*(
p + 1);
430 for (
int k = 0; k <=
p/2; k++)
431 for (
int j = 0; j <=
p; j++)
432 for (
int i = 0; i <=
p; i++)
434 int idx = 2*dof3 + i + (j + k*(
p + 1))*(
p + 1);
440 for (
int k = 0; k <=
p; k++)
441 for (
int j = 0; j <=
p; j++)
442 for (
int i = 0; i <=
p + 1; i++)
457 for (
int k = 0; k <=
p; k++)
458 for (
int j = 0; j <=
p + 1; j++)
459 for (
int i = 0; i <=
p; i++)
474 for (
int k = 0; k <=
p + 1; k++)
475 for (
int j = 0; j <=
p; j++)
476 for (
int i = 0; i <=
p; i++)
495 const int pp1 =
order;
497#ifdef MFEM_THREAD_SAFE
498 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
499 Vector shape_cz(pp1 + 1), shape_oz(pp1);
504#ifdef MFEM_THREAD_SAFE
505 Vector dshape_cx(pp1 + 1), dshape_cy(pp1 + 1), dshape_cz(pp1 + 1);
527 for (
int k = 0; k < pp1; k++)
528 for (
int j = 0; j < pp1; j++)
529 for (
int i = 0; i <= pp1; i++)
534 idx = -1 - idx, s = -1;
540 shape(idx,0) = s*shape_cx(i)*shape_oy(j)*shape_oz(k);
545 for (
int k = 0; k < pp1; k++)
546 for (
int j = 0; j <= pp1; j++)
547 for (
int i = 0; i < pp1; i++)
552 idx = -1 - idx, s = -1;
559 shape(idx,1) = s*shape_ox(i)*shape_cy(j)*shape_oz(k);
563 for (
int k = 0; k <= pp1; k++)
564 for (
int j = 0; j < pp1; j++)
565 for (
int i = 0; i < pp1; i++)
570 idx = -1 - idx, s = -1;
578 shape(idx,2) = s*shape_ox(i)*shape_oy(j)*shape_cz(k);
585 const int pp1 =
order;
587#ifdef MFEM_THREAD_SAFE
588 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
589 Vector shape_cz(pp1 + 1), shape_oz(pp1);
590 Vector dshape_cx(pp1 + 1), dshape_cy(pp1 + 1), dshape_cz(pp1 + 1);
612 for (
int k = 0; k < pp1; k++)
613 for (
int j = 0; j < pp1; j++)
614 for (
int i = 0; i <= pp1; i++)
619 idx = -1 - idx, s = -1;
625 divshape(idx) = s*dshape_cx(i)*shape_oy(j)*shape_oz(k);
628 for (
int k = 0; k < pp1; k++)
629 for (
int j = 0; j <= pp1; j++)
630 for (
int i = 0; i < pp1; i++)
635 idx = -1 - idx, s = -1;
641 divshape(idx) = s*shape_ox(i)*dshape_cy(j)*shape_oz(k);
644 for (
int k = 0; k <= pp1; k++)
645 for (
int j = 0; j < pp1; j++)
646 for (
int i = 0; i < pp1; i++)
651 idx = -1 - idx, s = -1;
657 divshape(idx) = s*shape_ox(i)*shape_oy(j)*dshape_cz(k);
675 for (
int c = 0; c < 3; c++)
680 for (
int k = 0; k < km; k++)
681 for (
int j = 0; j < jm; j++)
682 for (
int i = 0; i < im; i++)
685 if (idx < 0) { idx = -1 - idx; }
687 if (c == 0) { ic1 = j; ic2 = k; }
688 else if (c == 1) { ic1 = i; ic2 = k; }
689 else { ic1 = i; ic2 = j; }
690 const real_t h1 = cp[ic1+1] - cp[ic1];
691 const real_t h2 = cp[ic2+1] - cp[ic2];
693 for (
int q = 0; q < nqpt; q++)
696 if (c == 0) { ip3d.
Set3(cp[i], cp[j] + h1*ip2d.
x, cp[k] + h2*ip2d.
y); }
697 else if (c == 1) { ip3d.
Set3(cp[i] + h1*ip2d.
x, cp[j], cp[k] + h2*ip2d.
y); }
698 else { ip3d.
Set3(cp[i] + h1*ip2d.
x, cp[j] + h2*ip2d.
y, cp[k]); }
700 vc.
Eval(xq, Trans, ip3d);
706 dofs(idx) = val*h1*h2;
715 const int pp1 =
p + 1;
716 int n_face_dofs =
p*
p;
717 std::vector<int> strides, offsets;
718 const int n_dof_per_dim =
p*
p*pp1;
719 const auto f = internal::GetFaceNormal3D(face_id);
720 const int face_normal =
f.first, level =
f.second;
721 if (face_normal == 0)
723 offsets = {level ? pp1 - 1 : 0};
724 strides = {pp1,
p*pp1};
726 else if (face_normal == 1)
728 offsets = {n_dof_per_dim + (level ?
p*(pp1 - 1) : 0)};
729 strides = {1,
p*pp1};
731 else if (face_normal == 2)
733 offsets = {2*n_dof_per_dim + (level ?
p*
p*(pp1 - 1) : 0)};
736 std::vector<int> n_dofs = {
p,
p};
737 internal::FillFaceMap(n_face_dofs, offsets, strides, n_dofs, face_map);
741const real_t RT_TriangleElement::nk[6] =
742{ 0., -1., 1., 1., -1., 0. };
744const real_t RT_TriangleElement::c = 1./3.;
754#ifndef MFEM_THREAD_SAFE
764 Vector shape_x(
p + 1), shape_y(
p + 1), shape_l(
p + 1);
769 for (
int i = 0; i <=
p; i++)
774 for (
int i = 0; i <=
p; i++)
779 for (
int i = 0; i <=
p; i++)
786 for (
int j = 0; j <
p; j++)
787 for (
int i = 0; i + j <
p; i++)
789 real_t w = iop[i] + iop[j] + iop[
p-1-i-j];
797 for (
int k = 0; k <
dof; k++)
803 const real_t *n_k = nk + 2*dof2nk[k];
806 for (
int j = 0; j <=
p; j++)
807 for (
int i = 0; i + j <=
p; i++)
809 real_t s = shape_x(i)*shape_y(j)*shape_l(
p-i-j);
810 T(o++, k) = s*n_k[0];
811 T(o++, k) = s*n_k[1];
813 for (
int i = 0; i <=
p; i++)
815 real_t s = shape_x(i)*shape_y(
p-i);
816 T(o++, k) = s*((ip.
x - c)*n_k[0] + (ip.
y - c)*n_k[1]);
829#ifdef MFEM_THREAD_SAFE
830 Vector shape_x(
p + 1), shape_y(
p + 1), shape_l(
p + 1);
839 for (
int j = 0; j <=
p; j++)
840 for (
int i = 0; i + j <=
p; i++)
842 real_t s = shape_x(i)*shape_y(j)*shape_l(
p-i-j);
843 u(o,0) = s;
u(o,1) = 0; o++;
844 u(o,0) = 0;
u(o,1) = s; o++;
846 for (
int i = 0; i <=
p; i++)
848 real_t s = shape_x(i)*shape_y(
p-i);
849 u(o,0) = (ip.
x - c)*s;
850 u(o,1) = (ip.
y - c)*s;
862#ifdef MFEM_THREAD_SAFE
863 Vector shape_x(
p + 1), shape_y(
p + 1), shape_l(
p + 1);
864 Vector dshape_x(
p + 1), dshape_y(
p + 1), dshape_l(
p + 1);
873 for (
int j = 0; j <=
p; j++)
874 for (
int i = 0; i + j <=
p; i++)
877 divu(o++) = (dshape_x(i)*shape_l(k) -
878 shape_x(i)*dshape_l(k))*shape_y(j);
879 divu(o++) = (dshape_y(j)*shape_l(k) -
880 shape_y(j)*dshape_l(k))*shape_x(i);
882 for (
int i = 0; i <=
p; i++)
885 divu(o++) = ((shape_x(i) + (ip.
x - c)*dshape_x(i))*shape_y(j) +
886 (shape_y(j) + (ip.
y - c)*dshape_y(j))*shape_x(i));
889 Ti.
Mult(divu, divshape);
893const real_t RT_TetrahedronElement::nk[12] =
894{ 1,1,1, -1,0,0, 0,-1,0, 0,0,-1 };
897const real_t RT_TetrahedronElement::c = 1./4.;
907#ifndef MFEM_THREAD_SAFE
919 Vector shape_x(
p + 1), shape_y(
p + 1), shape_z(
p + 1), shape_l(
p + 1);
925 for (
int j = 0; j <=
p; j++)
926 for (
int i = 0; i + j <=
p; i++)
928 real_t w = bop[i] + bop[j] + bop[
p-i-j];
932 for (
int j = 0; j <=
p; j++)
933 for (
int i = 0; i + j <=
p; i++)
935 real_t w = bop[i] + bop[j] + bop[
p-i-j];
939 for (
int j = 0; j <=
p; j++)
940 for (
int i = 0; i + j <=
p; i++)
942 real_t w = bop[i] + bop[j] + bop[
p-i-j];
946 for (
int j = 0; j <=
p; j++)
947 for (
int i = 0; i + j <=
p; i++)
949 real_t w = bop[i] + bop[j] + bop[
p-i-j];
955 for (
int k = 0; k <
p; k++)
956 for (
int j = 0; j + k <
p; j++)
957 for (
int i = 0; i + j + k <
p; i++)
959 real_t w = iop[i] + iop[j] + iop[k] + iop[
p-1-i-j-k];
969 for (
int m = 0; m <
dof; m++)
976 const real_t *nm = nk + 3*dof2nk[m];
979 for (
int k = 0; k <=
p; k++)
980 for (
int j = 0; j + k <=
p; j++)
981 for (
int i = 0; i + j + k <=
p; i++)
983 real_t s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(
p-i-j-k);
984 T(o++, m) = s * nm[0];
985 T(o++, m) = s * nm[1];
986 T(o++, m) = s * nm[2];
988 for (
int j = 0; j <=
p; j++)
989 for (
int i = 0; i + j <=
p; i++)
991 real_t s = shape_x(i)*shape_y(j)*shape_z(
p-i-j);
992 T(o++, m) = s*((ip.
x - c)*nm[0] + (ip.
y - c)*nm[1] +
1006#ifdef MFEM_THREAD_SAFE
1007 Vector shape_x(
p + 1), shape_y(
p + 1), shape_z(
p + 1), shape_l(
p + 1);
1017 for (
int k = 0; k <=
p; k++)
1018 for (
int j = 0; j + k <=
p; j++)
1019 for (
int i = 0; i + j + k <=
p; i++)
1021 real_t s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(
p-i-j-k);
1022 u(o,0) = s;
u(o,1) = 0;
u(o,2) = 0; o++;
1023 u(o,0) = 0;
u(o,1) = s;
u(o,2) = 0; o++;
1024 u(o,0) = 0;
u(o,1) = 0;
u(o,2) = s; o++;
1026 for (
int j = 0; j <=
p; j++)
1027 for (
int i = 0; i + j <=
p; i++)
1029 real_t s = shape_x(i)*shape_y(j)*shape_z(
p-i-j);
1030 u(o,0) = (ip.
x - c)*s;
u(o,1) = (ip.
y - c)*s;
u(o,2) = (ip.
z - c)*s;
1042#ifdef MFEM_THREAD_SAFE
1043 Vector shape_x(
p + 1), shape_y(
p + 1), shape_z(
p + 1), shape_l(
p + 1);
1044 Vector dshape_x(
p + 1), dshape_y(
p + 1), dshape_z(
p + 1), dshape_l(
p + 1);
1054 for (
int k = 0; k <=
p; k++)
1055 for (
int j = 0; j + k <=
p; j++)
1056 for (
int i = 0; i + j + k <=
p; i++)
1058 int l =
p - i - j - k;
1059 divu(o++) = (dshape_x(i)*shape_l(l) -
1060 shape_x(i)*dshape_l(l))*shape_y(j)*shape_z(k);
1061 divu(o++) = (dshape_y(j)*shape_l(l) -
1062 shape_y(j)*dshape_l(l))*shape_x(i)*shape_z(k);
1063 divu(o++) = (dshape_z(k)*shape_l(l) -
1064 shape_z(k)*dshape_l(l))*shape_x(i)*shape_y(j);
1066 for (
int j = 0; j <=
p; j++)
1067 for (
int i = 0; i + j <=
p; i++)
1071 (shape_x(i) + (ip.
x - c)*dshape_x(i))*shape_y(j)*shape_z(k) +
1072 (shape_y(j) + (ip.
y - c)*dshape_y(j))*shape_x(i)*shape_z(k) +
1073 (shape_z(k) + (ip.
z - c)*dshape_z(k))*shape_x(i)*shape_y(j);
1076 Ti.
Mult(divu, divshape);
1079const real_t RT_WedgeElement::nk[15] =
1080{ 0,0,-1, 0,0,1, 0,-1,0, 1,1,0, -1,0,0};
1084 (
p + 2) * ((
p + 1) * (
p + 2)) / 2 +
1085 (
p + 1) * (
p + 1) * (
p + 3),
p + 1,
1095 MFEM_ASSERT(L2TriangleFE.
GetDof() * H1SegmentFE.
GetDof() +
1097 "Mismatch in number of degrees of freedom "
1098 "when building RT_WedgeElement!");
1100 const int pm1 =
p - 1;
1102#ifndef MFEM_THREAD_SAFE
1120 for (
int j = 0; j <=
p; j++)
1121 for (
int i = 0; i + j <=
p; i++)
1123 l = j + i * (2 *
p + 3 - i) / 2;
1124 t_dof[o] = l; s_dof[o] = 0; dof2nk[o] = 0;
1131 for (
int j = 0; j <=
p; j++)
1132 for (
int i = 0; i + j <=
p; i++)
1134 t_dof[o] = l; s_dof[o] = 1; dof2nk[o] = 1; l++;
1140 for (
int j = 0; j <=
p; j++)
1141 for (
int i = 0; i <=
p; i++)
1143 t_dof[o] = i; s_dof[o] = j; dof2nk[o] = 2;
1149 for (
int j = 0; j <=
p; j++)
1150 for (
int i = 0; i <=
p; i++)
1152 t_dof[o] =
p + 1 + i; s_dof[o] = j; dof2nk[o] = 3;
1158 for (
int j = 0; j <=
p; j++)
1159 for (
int i = 0; i <=
p; i++)
1161 t_dof[o] = 2 *
p + 2 + i; s_dof[o] = j; dof2nk[o] = 4;
1168 for (
int k = 0; k < L2SegmentFE.
GetDof(); k++)
1171 for (
int j = 0; j <= pm1; j++)
1172 for (
int i = 0; i + j <= pm1; i++)
1174 t_dof[o] = 3 * (
p + 1) + 2 * l; s_dof[o] = k;
1180 t_dof[o] = 3 * (
p + 1) + 2 * l + 1; s_dof[o] = k;
1188 for (
int k = 2; k < H1SegmentFE.
GetDof(); k++)
1190 for (l = 0; l < L2TriangleFE.
GetDof(); l++)
1192 t_dof[o] = l; s_dof[o] = k; dof2nk[o] = 1;
1203#ifdef MFEM_THREAD_SAFE
1217 for (
int i=0; i<
dof; i++)
1219 if ( dof2nk[i] >= 2 )
1221 shape(i, 0) = trt_shape(t_dof[i], 0) * sl2_shape[s_dof[i]];
1222 shape(i, 1) = trt_shape(t_dof[i], 1) * sl2_shape[s_dof[i]];
1227 real_t s = (dof2nk[i] == 0) ? -1.0 : 1.0;
1230 shape(i, 2) = s * tl2_shape[t_dof[i]] * sh1_shape(s_dof[i]);
1238#ifdef MFEM_THREAD_SAFE
1253 for (
int i=0; i<
dof; i++)
1255 if ( dof2nk[i] >= 2 )
1257 divshape(i) = trt_dshape(t_dof[i]) * sl2_shape(s_dof[i]);
1261 real_t s = (dof2nk[i] == 0) ? -1.0 : 1.0;
1262 divshape(i) = s * tl2_shape(t_dof[i]) * sh1_dshape(s_dof[i], 0);
1267const real_t RT_FuentesPyramidElement::nk[24] =
1269 0,0,-1, 0,-1,0, 1,0,1, 0,1,1, -1,0,0,
1270 M_SQRT2,0,M_SQRT1_2, 0,M_SQRT2,M_SQRT1_2, 0,0,1
1284#ifndef MFEM_THREAD_SAFE
1317 for (
int j = 0; j <=
p; j++)
1318 for (
int i = 0; i <=
p; i++)
1324 for (
int j = 0; j <=
p; j++)
1325 for (
int i = 0; i + j <=
p; i++)
1327 real_t w = bop[i] + bop[j] + bop[
p-i-j];
1331 for (
int j = 0; j <=
p; j++)
1332 for (
int i = 0; i + j <=
p; i++)
1334 real_t w = bop[i] + bop[j] + bop[
p-i-j];
1338 for (
int j = 0; j <=
p; j++)
1339 for (
int i =
p - j; i >= 0; i--)
1341 real_t w = bop[i] + bop[j] + bop[
p-i-j];
1345 for (
int j = 0; j <=
p; j++)
1346 for (
int i =
p - j; i >= 0; i--)
1348 real_t w = bop[i] + bop[j] + bop[
p-i-j];
1355 for (
int k = 0; k <=
p; k++)
1356 for (
int j = 0; j <=
p; j++)
1357 for (
int i = 1; i <=
p; i++)
1364 for (
int k = 0; k <=
p; k++)
1365 for (
int j = 1; j <=
p; j++)
1366 for (
int i = 0; i <=
p; i++)
1373 for (
int k = 1; k <=
p; k++)
1374 for (
int j = 0; j <=
p; j++)
1375 for (
int i = 0; i <=
p; i++)
1384 for (
int m = 0; m <
dof; m++)
1387 const Vector nm({nk[3*dof2nk[m]], nk[3*dof2nk[m]+1], nk[3*dof2nk[m]+2]});
1388 calcBasis(
order, ip, tmp1_i, tmp1_ij, tmp2_ij,
1389 tmp1_ijk, tmp2_ijk, tmp3_ijk, tmp4_ijk, tmp5_ijk, tmp6_ijk,
1401#ifdef MFEM_THREAD_SAFE
1418 calcBasis(
order, ip, tmp1_i, tmp1_ij, tmp2_ij,
1419 tmp1_ijk, tmp2_ijk, tmp3_ijk, tmp4_ijk, tmp5_ijk, tmp6_ijk,
1420 tmp7_ijk, tmp3_ij,
u);
1428#ifdef MFEM_THREAD_SAFE
1444 calcBasis(
order, ip, tmp1_i, tmp1_ij, tmp2_ij,
1445 tmp1_ijk, tmp2_ijk, tmp3_ijk, tmp4_ijk, tmp5_ijk, tmp6_ijk,
1446 tmp7_ijk, tmp3_ij, shape);
1452#ifdef MFEM_THREAD_SAFE
1471 calcDivBasis(
order, ip, tmp1_i, tmp1_ij, tmp2_ij,
1472 tmp1_ijk, tmp2_ijk, tmp3_ijk, tmp4_ij, tmp4_ijk, tmp5_ijk,
1473 tmp6_ijk, tmp7_ijk, tmp3_ij, divu);
1475 Ti.
Mult(divu, divshape);
1481#ifdef MFEM_THREAD_SAFE
1498 calcDivBasis(
order, ip, tmp1_i, tmp1_ij, tmp2_ij,
1499 tmp1_ijk, tmp2_ijk, tmp3_ijk, tmp4_ij, tmp4_ijk, tmp5_ijk,
1500 tmp6_ijk, tmp7_ijk, tmp3_ij, dshape);
1503void RT_FuentesPyramidElement::calcBasis(
const int p,
1527 y = 0.5 * (1.0 - z);
1528 x = 0.5 * (1.0 - z);
1529 xy(0) = x; xy(1) = y;
1531 zmax = std::max(z, zmax);
1546 for (
int j=0; j<
p; j++)
1547 for (
int i=0; i<
p; i++, o++)
1548 for (
int k=0; k<3; k++)
1550 F(o, k) = muz3 * VQ_ijk(i, j, k);
1562 dmuz.Destroy(); dmuz =
grad_mu0(z, xy, 2);
1565 for (
int j=0; j<
p; j++)
1566 for (
int i=0; i+j<
p; i++, o++)
1567 for (
int k=0; k<3; k++)
1569 F(o, k) = 0.5 * (
mu * VT_ijk(i, j, k) + VTT_ijk(i, j, k));
1574 dmuz.Destroy(); dmuz =
grad_mu1(z, xy, 2);
1577 for (
int j=0; j<
p; j++)
1578 for (
int i=0; i+j<
p; i++, o++)
1579 for (
int k=0; k<3; k++)
1581 F(o, k) = 0.5 * (
mu * VT_ijk(i, j, k) + VTT_ijk(i, j, k));
1587 dmuz.Destroy(); dmuz =
grad_mu0(z, xy, 1);
1590 for (
int j=0; j<
p; j++)
1591 for (
int i=0; i+j<
p; i++, o++)
1592 for (
int k=0; k<3; k++)
1594 F(o, k) = 0.5 * (
mu * VT_ijk(i, j, k) + VTT_ijk(i, j, k));
1599 dmuz.Destroy(); dmuz =
grad_mu1(z, xy, 1);
1602 for (
int j=0; j<
p; j++)
1603 for (
int i=0; i+j<
p; i++, o++)
1604 for (
int k=0; k<3; k++)
1606 F(o, k) = 0.5 * (
mu * VT_ijk(i, j, k) + VTT_ijk(i, j, k));
1612 if (z < 1.0 && p >= 2)
1620 Vector dmuphi(3), E(3), v(3);
1622 for (
int k=2; k<=
p; k++)
1624 dmuphi(0) = muz * dphi_k(k,0) + dmuz(0) * phi_k(k);
1625 dmuphi(1) = muz * dphi_k(k,1) + dmuz(1) * phi_k(k);
1626 dmuphi(2) = muz * dphi_k(k,2) + dmuz(2) * phi_k(k);
1627 for (
int j=2; j<=
p; j++)
1628 for (
int i=0; i<
p; i++, o++)
1630 E(0) = E_ijk(i,j,0); E(1) = E_ijk(i,j,1); E(2) = E_ijk(i,j,2);
1631 dmuphi.cross3D(E, v);
1632 for (
int l=0; l<3; l++)
1634 F(o, l) = muz * phi_k(k) * dE_ijk(i,j,l) + v(l);
1641 if (z < 1.0 && p >= 2)
1649 Vector dmuphi(3), E(3), v(3);
1651 for (
int k=2; k<=
p; k++)
1653 dmuphi(0) = muz * dphi_k(k,0) + dmuz(0) * phi_k(k);
1654 dmuphi(1) = muz * dphi_k(k,1) + dmuz(1) * phi_k(k);
1655 dmuphi(2) = muz * dphi_k(k,2) + dmuz(2) * phi_k(k);
1656 for (
int j=2; j<=
p; j++)
1657 for (
int i=0; i<
p; i++, o++)
1659 E(0) = E_ijk(i,j,0); E(1) = E_ijk(i,j,1); E(2) = E_ijk(i,j,2);
1660 dmuphi.cross3D(E, v);
1661 for (
int l=0; l<3; l++)
1663 F(o, l) = muz * phi_k(k) * dE_ijk(i,j,l) + v(l);
1669 if (z < 1.0 && p >= 2)
1676 for (
int j=2; j<=
p; j++)
1677 for (
int i=2; i<=
p; i++, o++)
1679 const int n = std::max(i,j);
1680 const real_t nmu = n * pow(muz, n-1);
1681 F(o, 0) = nmu * (dphi_ijk(i,j,1) * dmuz(2) -
1682 dphi_ijk(i,j,2) * dmuz(1));
1683 F(o, 1) = nmu * (dphi_ijk(i,j,2) * dmuz(0) -
1684 dphi_ijk(i,j,0) * dmuz(2));
1685 F(o, 2) = nmu * (dphi_ijk(i,j,0) * dmuz(1) -
1686 dphi_ijk(i,j,1) * dmuz(0));
1690 if (z < 1.0 && p >= 2)
1697 for (
int k=2; k<=
p; k++)
1698 for (
int j=0; j<
p; j++)
1699 for (
int i=0; i<
p; i++, o++)
1700 for (
int l=0; l<3; l++)
1702 F(o, l) = muz2 * VQ_ijk(i, j, l) * phi_k(k);
1707 if (z < 1.0 && p >= 2)
1714 for (
int j=2; j<=
p; j++)
1715 for (
int i=2; i<=
p; i++, o++)
1717 const int n = std::max(i, j);
1718 const real_t muzi = pow(muz, n-1);
1719 for (
int l=0; l<3; l++)
1721 F(o, l) = muzi * VL_ijk(i, j, l);
1726 if (z < 1.0 && p >= 2)
1733 for (
int i=2; i<=
p; i++, o++)
1735 const real_t muzi = pow(muz, i-1);
1736 for (
int l=0; l<3; l++)
1738 F(o, l) = muzi * VR_ij(i, l);
1743 if (z < 1.0 && p >= 2)
1750 for (
int i=2; i<=
p; i++, o++)
1752 const real_t muzi = pow(muz, i-1);
1753 for (
int l=0; l<3; l++)
1755 F(o, l) = muzi * VR_ij(i, l);
1761void RT_FuentesPyramidElement::calcDivBasis(
const int p,
1762 const IntegrationPoint &ip,
1764 DenseMatrix &phi_ij,
1765 DenseMatrix &dphi_k,
1766 DenseTensor &VQ_ijk,
1767 DenseTensor &VT_ijk,
1768 DenseTensor &VTT_ijk,
1769 DenseMatrix &dVTT_ij,
1771 DenseTensor &dE_ijk,
1772 DenseTensor &dphi_ijk,
1773 DenseTensor &VL_ijk,
1788 y = 0.5 * (1.0 - z);
1789 x = 0.5 * (1.0 - z);
1790 xy(0) = x; xy(1) = y;
1792 zmax = std::max(z, zmax);
1808 for (
int j=0; j<
p; j++)
1809 for (
int i=0; i<
p; i++, o++)
1810 for (
int k=0; k<3; k++)
1812 dF(o) += 3.0 * muz2 * dmuz(k) * VQ_ijk(i, j, k);
1830 dmuz.Destroy(); dmuz =
grad_mu0(z, xy, 2);
1835 for (
int j=0; j<
p; j++)
1836 for (
int i=0; i+j<
p; i++, o++)
1838 dF(o) = 0.5 * dVTT_ij(i, j);
1839 for (
int k=0; k<3; k++)
1841 dF(o) += 0.5 * dmuz(k) * VT_ijk(i, j, k);
1847 dmuz.Destroy(); dmuz =
grad_mu1(z, xy, 2);
1852 for (
int j=0; j<
p; j++)
1853 for (
int i=0; i+j<
p; i++, o++)
1855 dF(o) = 0.5 * dVTT_ij(i, j);
1856 for (
int k=0; k<3; k++)
1858 dF(o) += 0.5 * dmuz(k) * VT_ijk(i, j, k);
1865 dmuz.Destroy(); dmuz =
grad_mu0(z, xy, 1);
1870 for (
int j=0; j<
p; j++)
1871 for (
int i=0; i+j<
p; i++, o++)
1873 dF(o) = 0.5 * dVTT_ij(i, j);
1874 for (
int k=0; k<3; k++)
1876 dF(o) += 0.5 * dmuz(k) * VT_ijk(i, j, k);
1882 dmuz.Destroy(); dmuz =
grad_mu1(z, xy, 1);
1887 for (
int j=0; j<
p; j++)
1888 for (
int i=0; i+j<
p; i++, o++)
1890 dF(o) = 0.5 * dVTT_ij(i, j);
1891 for (
int k=0; k<3; k++)
1893 dF(o) += 0.5 * dmuz(k) * VT_ijk(i, j, k);
1912 o += (
p-1) * (
p-1) *
p;
1919 o += (
p-1) * (
p-1) *
p;
1936 for (
int k=2; k<=
p; k++)
1937 for (
int j=0; j<
p; j++)
1938 for (
int i=0; i<
p; i++, o++)
1939 for (
int l=0; l<3; l++)
1941 dF(o) += (muz2 * dphi_k(k, l) +
1942 2.0 *
mu0(z) * phi_k(k) * dmuz(l)) * VQ_ijk(i, j, l);
1954 for (
int j=2; j<=
p; j++)
1955 for (
int i=2; i<=
p; i++, o++)
1957 const int n = std::max(i, j);
1958 const real_t muzi = pow(muz, n-2);
1959 for (
int l=0; l<3; l++)
1961 dF(o) += (n-1) * muzi * dmuz(l) * VL_ijk(i, j, l);
1974 for (
int i=2; i<=
p; i++, o++)
1976 const real_t muzi = pow(muz, i-2);
1977 for (
int l=0; l<3; l++)
1979 dF(o) += (i-1) * muzi * dmuz(l) * VR_ij(i, l);
1992 for (
int i=2; i<=
p; i++, o++)
1994 const real_t muzi = pow(muz, i-2);
1995 for (
int l=0; l<3; l++)
1997 dF(o) += (i-1) * muzi * dmuz(l) * VR_ij(i, l);
2003const real_t RT_R1D_SegmentElement::nk[9] = { 1.,0.,0., 0.,1.,0., 0.,0.,1. };
2011 cbasis1d(
poly1d.GetBasis(
p + 1, VerifyClosed(cb_type))),
2012 obasis1d(
poly1d.GetBasis(
p, VerifyOpen(ob_type)))
2020#ifndef MFEM_THREAD_SAFE
2032 dof_map[0] = o; dof2nk[o++] = 0;
2036 dof_map[
p+1] = o; dof2nk[o++] = 0;
2040 for (
int i = 1; i <=
p; i++)
2043 dof_map[i] = o; dof2nk[o++] = 0;
2046 for (
int i = 0; i <=
p; i++)
2049 dof_map[
p+i+2] = o; dof2nk[o++] = 1;
2052 for (
int i = 0; i <=
p; i++)
2055 dof_map[2*
p+3+i] = o; dof2nk[o++] = 2;
2064#ifdef MFEM_THREAD_SAFE
2065 Vector shape_cx(
p + 1), shape_ox(
p);
2068 cbasis1d.
Eval(ip.
x, shape_cx);
2069 obasis1d.
Eval(ip.
x, shape_ox);
2073 for (
int i = 0; i <=
p; i++)
2075 int idx = dof_map[o++];
2076 shape(idx,0) = shape_cx(i);
2081 for (
int i = 0; i <
p; i++)
2083 int idx = dof_map[o++];
2085 shape(idx,1) = shape_ox(i);
2089 for (
int i = 0; i <
p; i++)
2091 int idx = dof_map[o++];
2094 shape(idx,2) = shape_ox(i);
2104 "RT_R1D_SegmentElement cannot be embedded in "
2105 "2 or 3 dimensional spaces");
2106 for (
int i=0; i<
dof; i++)
2108 shape(i, 0) *= J(0,0);
2110 shape *= (1.0 / Trans.
Weight());
2118#ifdef MFEM_THREAD_SAFE
2123 cbasis1d.
Eval(ip.
x, shape_cx, dshape_cx);
2127 for (
int i = 0; i <=
p; i++)
2129 int idx = dof_map[o++];
2130 divshape(idx) = dshape_cx(i);
2133 for (
int i = 0; i <
p; i++)
2135 int idx = dof_map[o++];
2139 for (
int i = 0; i <
p; i++)
2141 int idx = dof_map[o++];
2156 for (
int k = 0; k <
dof; k++)
2162 Vector n1(&nk_ptr[dof2nk[k] * 3], 1);
2163 Vector n3(&nk_ptr[dof2nk[k] * 3], 3);
2166 Trans.
Weight() * vk3(1) * n3(1) +
2167 Trans.
Weight() * vk3(2) * n3(2);
2183 for (
int k = 0; k <
dof; k++)
2187 Vector n1(&nk_ptr[dof2nk[k] * 3], 1);
2188 Vector n3(&nk_ptr[dof2nk[k] * 3], 3);
2195 vk[1] = n3[1] * Trans.
Weight();
2196 vk[2] = n3[2] * Trans.
Weight();
2200 for (
int d = 0; d < 1; d++)
2206 for (
int j = 0; j < shape.
Size(); j++)
2209 if (fabs(s) < 1e-12)
2215 for (
int d = 0; d <
vdim; d++)
2217 I(k,j+d*shape.
Size()) = s*vk[d];
2230 for (
int k = 0; k <
dof; k++)
2234 Vector n1(&nk_ptr[dof2nk[k] * 3], 1);
2235 Vector n3(&nk_ptr[dof2nk[k] * 3], 3);
2247 I(k, j) +=
vshape(j, 0) * vk[0];
2268 for (
int k = 0; k <
dof; k++)
2271 curl_shape.
Mult(nk_ptr + dof2nk[k] * 3, curl_k);
2272 for (
int j = 0; j < curl_k.
Size(); j++)
2274 curl(k,j) = (fabs(curl_k(j)) < 1e-12) ? 0.0 : curl_k(j);
2279const real_t RT_R2D_SegmentElement::nk[2] = { 0.,1.};
2286 obasis1d(
poly1d.GetBasis(
p, VerifyOpen(ob_type)))
2293#ifndef MFEM_THREAD_SAFE
2302 for (
int i = 0; i <=
p; i++)
2305 dof_map[i] = o; dof2nk[o++] = 0;
2314#ifdef MFEM_THREAD_SAFE
2318 obasis1d.
Eval(ip.
x, shape_ox);
2322 for (
int i = 0; i <=
p; i++)
2324 int idx = dof_map[o++];
2325 shape(idx,0) = shape_ox(i);
2336 "RT_R2D_SegmentElement cannot be embedded in "
2337 "2 or 3 dimensional spaces");
2338 for (
int i=0; i<
dof; i++)
2340 shape(i, 0) *= J(0,0);
2342 shape *= (1.0 / Trans.
Weight());
2367 for (
int k = 0; k <
dof; k++)
2369 Vector n2(&nk_ptr[dof2nk[k] * 2], 2);
2387 I(k, j) = (fabs(Ikj) < 1e-12) ? 0.0 : Ikj;
2410 "RT_R2D_FiniteElement cannot be embedded in "
2411 "3 dimensional spaces");
2412 for (
int i=0; i<
dof; i++)
2416 shape(i, 0) = sx * J(0, 0) + sy * J(0, 1);
2417 shape(i, 1) = sx * J(1, 0) + sy * J(1, 1);
2419 shape *= (1.0 / Trans.
Weight());
552 idx = -1 - idx, s = -1; {
…}
2439 for (
int k = 0; k <
dof; k++)
2453 for (
int i = 0; i <
dim; i++)
2455 Ikj +=
vshape(j, i) * vk[i];
2458 I(k, j) = (fabs(Ikj) < 1e-12) ? 0.0 : Ikj;
2470#ifdef MFEM_THREAD_SAFE
2479 for (
int j = 0; j <
dof; j++)
2491 for (
int k = 0; k <
dof; k++)
2494 for (
int d = 0; d <
dim; d++)
2496 R_jk +=
vshape(k,d)*pt_data[d];
2498 R_jk +=
vshape(k,2) * n3(2);
2521 for (
int k = 0; k <
dof; k++)
2531 Trans.
Weight() * vk3(2) * n3(2);
2547 for (
int k = 0; k <
dof; k++)
2559 vk[2] = n3[2] * Trans.
Weight();
2563 for (
int d = 0; d < 2; d++)
2569 for (
int j = 0; j < shape.
Size(); j++)
2572 if (fabs(s) < 1e-12)
2578 for (
int d = 0; d <
vdim; d++)
2580 I(k,j+d*shape.
Size()) = s*vk[d];
2593 for (
int k = 0; k <
dof; k++)
2610 for (
int i=0; i<2; i++)
2612 I(k, j) +=
vshape(j, i) * vk[i];
2633 for (
int k = 0; k <
dof; k++)
2636 curl_shape.
Mult(nk_ptr +
dof2nk[k] * 3, curl_k);
2637 for (
int j = 0; j < curl_k.
Size(); j++)
2639 curl(k,j) = (fabs(curl_k(j)) < 1e-12) ? 0.0 : curl_k(j);
2644const real_t RT_R2D_TriangleElement::nk_t[12] =
2645{ 0.,-1.,0., 1.,1.,0., -1.,0.,0., 0.,0.,1. };
2654#ifndef MFEM_THREAD_SAFE
2665 for (
int e=0; e<3; e++)
2668 for (
int i=0; i<=
p; i++)
2675 for (
int j = 0; j <
p; j++)
2676 for (
int i = 0; i + j <
p; i++)
2683 for (
int j = 0; j <=
p; j++)
2684 for (
int i = 0; i + j <=
p; i++)
2689 MFEM_VERIFY(r == RT_FE.
GetDof(),
2690 "RT_R2D_Triangle incorrect number of RT dofs.");
2691 MFEM_VERIFY(l == L2_FE.
GetDof(),
2692 "RT_R2D_Triangle incorrect number of L2 dofs.");
2693 MFEM_VERIFY(o ==
GetDof(),
2694 "RT_R2D_Triangle incorrect number of dofs.");
2699 for (
int i=0; i<
dof; i++)
2718#ifdef MFEM_THREAD_SAFE
2726 for (
int i=0; i<
dof; i++)
2731 shape(i, 0) = rt_shape(idx, 0);
2732 shape(i, 1) = rt_shape(idx, 1);
2739 shape(i, 2) = l2_shape(-idx-1);
2747#ifdef MFEM_THREAD_SAFE
2753 for (
int i=0; i<
dof; i++)
2758 div_shape(i) = rt_dshape(idx);
2767const real_t RT_R2D_QuadrilateralElement::nk_q[15] =
2768{ 0., -1., 0., 1., 0., 0., 0., 1., 0., -1., 0., 0., 0., 0., 1. };
2774 cbasis1d(
poly1d.GetBasis(
p + 1, VerifyClosed(cb_type))),
2775 obasis1d(
poly1d.GetBasis(
p, VerifyOpen(ob_type)))
2779 const int dofx = (
p + 1)*(
p + 2);
2780 const int dofy = (
p + 1)*(
p + 2);
2781 const int dofxy = dofx + dofy;
2783#ifndef MFEM_THREAD_SAFE
2794 for (
int i = 0; i <=
p; i++)
2796 dof_map[dofx + i + 0*(
p + 1)] = o++;
2798 for (
int i = 0; i <=
p; i++)
2802 for (
int i = 0; i <=
p; i++)
2804 dof_map[dofx + (
p - i) + (
p + 1)*(
p + 1)] = o++;
2806 for (
int i = 0; i <=
p; i++)
2812 for (
int j = 0; j <=
p; j++)
2813 for (
int i = 1; i <=
p; i++)
2817 for (
int j = 1; j <=
p; j++)
2818 for (
int i = 0; i <=
p; i++)
2820 dof_map[dofx + i + j*(
p + 1)] = o++;
2822 for (
int j = 0; j <=
p; j++)
2823 for (
int i = 0; i <=
p; i++)
2825 dof_map[dofxy + i + j*(
p + 1)] = o++;
2830 for (
int j = 0; j <=
p; j++)
2831 for (
int i = 0; i <=
p/2; i++)
2833 int idx = i + j*(
p + 2);
2837 for (
int j =
p/2 + 1; j <=
p; j++)
2839 int idx = (
p/2 + 1) + j*(
p + 2);
2843 for (
int j = 0; j <=
p/2; j++)
2844 for (
int i = 0; i <=
p; i++)
2846 int idx = dofx + i + j*(
p + 1);
2850 for (
int i = 0; i <=
p/2; i++)
2852 int idx = dofx + i + (
p/2 + 1)*(
p + 1);
2857 for (
int j = 0; j <=
p; j++)
2858 for (
int i = 0; i <=
p + 1; i++)
2872 for (
int j = 0; j <=
p + 1; j++)
2873 for (
int i = 0; i <=
p; i++)
2887 for (
int j = 0; j <=
p; j++)
2888 for (
int i = 0; i <=
p; i++)
2899 const int pp1 =
order;
2901#ifdef MFEM_THREAD_SAFE
2902 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
2905 cbasis1d.
Eval(ip.
x, shape_cx);
2906 obasis1d.
Eval(ip.
x, shape_ox);
2907 cbasis1d.
Eval(ip.
y, shape_cy);
2908 obasis1d.
Eval(ip.
y, shape_oy);
2911 for (
int j = 0; j < pp1; j++)
2912 for (
int i = 0; i <= pp1; i++)
2917 idx = -1 - idx, s = -1;
2923 shape(idx,0) = s*shape_cx(i)*shape_oy(j);
2927 for (
int j = 0; j <= pp1; j++)
2928 for (
int i = 0; i < pp1; i++)
2933 idx = -1 - idx, s = -1;
2940 shape(idx,1) = s*shape_ox(i)*shape_cy(j);
2943 for (
int j = 0; j < pp1; j++)
2944 for (
int i = 0; i < pp1; i++)
2949 shape(idx,2) = shape_ox(i)*shape_oy(j);
2956 const int pp1 =
order;
2958#ifdef MFEM_THREAD_SAFE
2959 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
2960 Vector dshape_cx(pp1 + 1), dshape_cy(pp1 + 1);
2963 cbasis1d.
Eval(ip.
x, shape_cx, dshape_cx);
2964 obasis1d.
Eval(ip.
x, shape_ox);
2965 cbasis1d.
Eval(ip.
y, shape_cy, dshape_cy);
2966 obasis1d.
Eval(ip.
y, shape_oy);
2969 for (
int j = 0; j < pp1; j++)
2970 for (
int i = 0; i <= pp1; i++)
2975 idx = -1 - idx, s = -1;
2981 divshape(idx) = s*dshape_cx(i)*shape_oy(j);
2983 for (
int j = 0; j <= pp1; j++)
2984 for (
int i = 0; i < pp1; i++)
2989 idx = -1 - idx, s = -1;
2995 divshape(idx) = s*shape_ox(i)*dshape_cy(j);
2997 for (
int j = 0; j < pp1; j++)
2998 for (
int i = 0; i < pp1; i++)
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
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 MultTranspose(const real_t *x, real_t *y) const
Multiply a vector with the transpose matrix.
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.
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 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.
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)
void phi_Q(int p, Vector s, Vector t, DenseMatrix &u) const
void V_R(int p, Vector s, const DenseMatrix &grad_s, real_t mu, Vector grad_mu, real_t t, Vector grad_t, DenseMatrix &u) const
static constexpr real_t apex_tol
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 Vector nu01_grad_nu01(real_t z, Vector xy, unsigned int ab)
void VT_T(int p, Vector s, Vector sds, Vector sdsxds, real_t mu, Vector grad_mu, DenseTensor &u) const
static Vector mu01(real_t z)
void V_L(int p, Vector sx, const DenseMatrix &grad_sx, Vector sy, const DenseMatrix &grad_sy, real_t t, Vector grad_t, DenseTensor &u) const
static Vector grad_nu2(real_t z, const Vector xy, unsigned int ab)
static Vector grad_mu1(real_t z)
void V_Q(int p, Vector s, Vector ds, Vector t, Vector dt, DenseTensor &u) const
static real_t mu0(real_t z)
void V_T(int p, Vector s, Vector sdsxds, DenseTensor &u) const
static Vector grad_mu0(real_t z)
void E_Q(int p, Vector s, Vector ds, Vector t, DenseTensor &u) const
static Vector mu01_grad_mu01(real_t z, Vector xy, unsigned int ab)
static real_t mu1(real_t z)
static Vector nu012_grad_nu012(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...
Class for integration point with weight.
void Set(const real_t *p, const int dim)
void Set2(const real_t x1, const real_t x2)
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 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 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...
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 (GaussLegendre) 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...
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...
RT_FuentesPyramidElement(const int p)
void CalcRawDivShape(const IntegrationPoint &ip, Vector &dshape) const
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
void CalcRawVShape(const IntegrationPoint &ip, DenseMatrix &shape) 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 ProjectIntegrated(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
void GetFaceMap(const int face_id, Array< int > &face_map) const override
Return the mapping from lexicographically ordered face DOFs to lexicographically ordered element DOFs...
void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const override
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
RT_HexahedronElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the RT_HexahedronElement of order p and closed and open BasisType cb_type and ob_type.
void ProjectIntegrated(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const override
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
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 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...
RT_QuadrilateralElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the RT_QuadrilateralElement of order p and closed and open BasisType cb_type and ob_type.
void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const override
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
RT_R1D_SegmentElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the RT_R1D_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 ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const override
Compute the discrete curl matrix from the given FiniteElement onto 'this' FiniteElement....
void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const override
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const override
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs.
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 ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const override
Compute the discrete curl matrix from the given FiniteElement onto 'this' FiniteElement....
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 ...
RT_R2D_FiniteElement(int p, Geometry::Type G, int Do, const real_t *nk_fe)
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...
RT_R2D_QuadrilateralElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the RT_QuadrilateralElement of order p and closed and open BasisType cb_type and ob_type.
void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const override
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
void CalcDivShape(const IntegrationPoint &ip, Vector &div_shape) const override
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
RT_R2D_SegmentElement(const int p, const int ob_type=BasisType::GaussLegendre)
Construct the RT_R2D_SegmentElement of order p and open BasisType 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 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 CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const override
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
RT_R2D_TriangleElement(const int p)
Construct the RT_R2D_TriangleElement of order p.
void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const override
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
RT_TetrahedronElement(const int p)
Construct the RT_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...
RT_TriangleElement(const int p)
Construct the RT_TriangleElement of order p.
void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const override
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const override
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
RT_WedgeElement(const int 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...
virtual void SetMapType(int M)
Set the FiniteElement::MapType of the element to either VALUE or INTEGRAL. Also sets the FiniteElemen...
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.
real_t infinity()
Define a shortcut for std::numeric_limits<double>::infinity()
real_t u(const Vector &xvec)
std::function< real_t(const Vector &)> f(real_t mass_coeff)
void InvertLinearTrans(ElementTransformation &trans, const IntegrationPoint &pt, Vector &x)
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)