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++)
1293const real_t ND_WedgeElement::tk[15] =
1294{ 1.,0.,0., -1.,1.,0., 0.,-1.,0., 0.,0.,1., 0.,1.,0. };
1300 3 *
p * ((
p + 1) * (
p + 2))/2,
p,
1306 H1TriangleFE(
p, cb_type),
1308 H1SegmentFE(
p, cb_type),
1309 NDSegmentFE(
p, ob_type)
1311 MFEM_ASSERT(H1TriangleFE.
GetDof() * NDSegmentFE.
GetDof() +
1313 "Mismatch in number of degrees of freedom "
1314 "when building ND_WedgeElement!");
1316#ifndef MFEM_THREAD_SAFE
1326 const int pm1 =
p - 1, pm2 =
p - 2;
1335 for (
int i = 0; i <
p; i++)
1337 t_dof[o] = i; s_dof[o] = 0; dof2tk[o] = 0;
1342 for (
int i = 0; i <
p; i++)
1344 t_dof[o] =
p + i; s_dof[o] = 0; dof2tk[o] = 1;
1349 for (
int i = 0; i <
p; i++)
1351 t_dof[o] = 2 *
p + i; s_dof[o] = 0; dof2tk[o] = 2;
1356 for (
int i = 0; i <
p; i++)
1358 t_dof[o] = i; s_dof[o] = 1; dof2tk[o] = 0;
1363 for (
int i = 0; i <
p; i++)
1365 t_dof[o] =
p + i; s_dof[o] = 1; dof2tk[o] = 1;
1370 for (
int i = 0; i <
p; i++)
1372 t_dof[o] = 2 *
p + i; s_dof[o] = 1; dof2tk[o] = 2;
1377 for (
int i = 0; i <
p; i++)
1379 t_dof[o] = 0; s_dof[o] = i; dof2tk[o] = 3;
1384 for (
int i = 0; i <
p; i++)
1386 t_dof[o] = 1; s_dof[o] = i; dof2tk[o] = 3;
1391 for (
int i = 0; i <
p; i++)
1393 t_dof[o] = 2; s_dof[o] = i; dof2tk[o] = 3;
1402 for (
int j = 0; j <= pm2; j++)
1403 for (
int i = 0; i + j <= pm2; i++)
1405 l = j + ( 2 *
p - 1 - i) * i / 2;
1406 t_dof[o] = 3 *
p + 2*l+1; s_dof[o] = 0; dof2tk[o] = 4;
1410 t_dof[o] = 3 *
p + 2*l; s_dof[o] = 0; dof2tk[o] = 0;
1417 for (
int j = 0; j <= pm2; j++)
1418 for (
int i = 0; i + j <= pm2; i++)
1420 t_dof[o] = 3 *
p + m; s_dof[o] = 1; dof2tk[o] = 0; m++;
1424 t_dof[o] = 3 *
p + m; s_dof[o] = 1; dof2tk[o] = 4; m++;
1430 for (
int j = 2; j <=
p; j++)
1431 for (
int i = 0; i <
p; i++)
1433 t_dof[o] = i; s_dof[o] = j; dof2tk[o] = 0;
1438 for (
int j = 0; j <
p; j++)
1439 for (
int i = 0; i < pm1; i++)
1441 t_dof[o] = 3 + i; s_dof[o] = j; dof2tk[o] = 3;
1447 for (
int j = 2; j <=
p; j++)
1448 for (
int i = 0; i <
p; i++)
1450 t_dof[o] =
p + i; s_dof[o] = j; dof2tk[o] = 1;
1455 for (
int j = 0; j <
p; j++)
1456 for (
int i = 0; i < pm1; i++)
1458 t_dof[o] =
p + 2 + i; s_dof[o] = j; dof2tk[o] = 3;
1464 for (
int j = 2; j <=
p; j++)
1465 for (
int i = 0; i <
p; i++)
1467 t_dof[o] = 2 *
p + i; s_dof[o] = j; dof2tk[o] = 2;
1472 for (
int j = 0; j <
p; j++)
1473 for (
int i = 0; i < pm1; i++)
1475 t_dof[o] = 2 *
p + 1 + i; s_dof[o] = j; dof2tk[o] = 3;
1482 for (
int k = 2; k <=
p; k++)
1485 for (
int j = 0; j <= pm2; j++)
1486 for (
int i = 0; i + j <= pm2; i++)
1488 t_dof[o] = 3 *
p + l; s_dof[o] = k; dof2tk[o] = 0; l++;
1492 t_dof[o] = 3 *
p + l; s_dof[o] = k; dof2tk[o] = 4; l++;
1498 for (
int k = 0; k <
p; k++)
1501 for (
int j = 0; j < pm2; j++)
1502 for (
int i = 0; i + j < pm2; i++)
1504 t_dof[o] = 3 *
p + l; s_dof[o] = k; dof2tk[o] = 3; l++;
1515#ifdef MFEM_THREAD_SAFE
1529 for (
int i=0; i<
dof; i++)
1531 if ( dof2tk[i] != 3 )
1533 shape(i, 0) = tn_shape(t_dof[i], 0) * s1_shape[s_dof[i]];
1534 shape(i, 1) = tn_shape(t_dof[i], 1) * s1_shape[s_dof[i]];
1541 shape(i, 2) = t1_shape[t_dof[i]] * sn_shape(s_dof[i], 0);
1549#ifdef MFEM_THREAD_SAFE
1567 for (
int i=0; i<
dof; i++)
1569 if ( dof2tk[i] != 3 )
1571 curl_shape(i, 0) = -tn_shape(t_dof[i], 1) * s1_dshape(s_dof[i], 0);
1572 curl_shape(i, 1) = tn_shape(t_dof[i], 0) * s1_dshape(s_dof[i], 0);
1573 curl_shape(i, 2) = tn_dshape(t_dof[i], 0) * s1_shape[s_dof[i]];
1577 curl_shape(i, 0) = t1_dshape(t_dof[i], 1) * sn_shape(s_dof[i], 0);
1578 curl_shape(i, 1) = -t1_dshape(t_dof[i], 0) * sn_shape(s_dof[i], 0);
1579 curl_shape(i, 2) = 0.0;
1611const real_t ND_R1D_SegmentElement::tk[9] = { 1.,0.,0., 0.,1.,0., 0.,0.,1. };
1619 cbasis1d(
poly1d.GetBasis(
p, VerifyClosed(cb_type))),
1620 obasis1d(
poly1d.GetBasis(
p - 1, VerifyOpen(ob_type)))
1634#ifndef MFEM_THREAD_SAFE
1646 dof_map[
p] = o; dof2tk[o++] = 1;
1648 dof_map[2*
p+1] = o; dof2tk[o++] = 2;
1652 dof_map[2*
p] = o; dof2tk[o++] = 1;
1654 dof_map[3*
p+1] = o; dof2tk[o++] = 2;
1658 for (
int i = 0; i <
p; i++)
1661 dof_map[i] = o; dof2tk[o++] = 0;
1664 for (
int i = 1; i <
p; i++)
1667 dof_map[
p+i] = o; dof2tk[o++] = 1;
1670 for (
int i = 1; i <
p; i++)
1673 dof_map[2*
p+1+i] = o; dof2tk[o++] = 2;
1682#ifdef MFEM_THREAD_SAFE
1683 Vector shape_cx(
p + 1), shape_ox(
p);
1686 cbasis1d.
Eval(ip.
x, shape_cx);
1687 obasis1d.
Eval(ip.
x, shape_ox);
1691 for (
int i = 0; i <
p; i++)
1693 int idx = dof_map[o++];
1694 shape(idx,0) = shape_ox(i);
1699 for (
int i = 0; i <=
p; i++)
1701 int idx = dof_map[o++];
1703 shape(idx,1) = shape_cx(i);
1707 for (
int i = 0; i <=
p; i++)
1709 int idx = dof_map[o++];
1712 shape(idx,2) = shape_cx(i);
1722 "ND_R1D_SegmentElement cannot be embedded in "
1723 "2 or 3 dimensional spaces");
1724 for (
int i=0; i<
dof; i++)
1726 shape(i, 0) *= JI(0,0);
1735#ifdef MFEM_THREAD_SAFE
1736 Vector shape_cx(
p + 1), shape_ox(
p);
1740 cbasis1d.
Eval(ip.
x, shape_cx, dshape_cx);
1741 obasis1d.
Eval(ip.
x, shape_ox);
1745 for (
int i = 0; i <
p; i++)
1747 int idx = dof_map[o++];
1748 curl_shape(idx,0) = 0.;
1749 curl_shape(idx,1) = 0.;
1750 curl_shape(idx,2) = 0.;
1753 for (
int i = 0; i <=
p; i++)
1755 int idx = dof_map[o++];
1756 curl_shape(idx,0) = 0.;
1757 curl_shape(idx,1) = 0.;
1758 curl_shape(idx,2) = dshape_cx(i);
1761 for (
int i = 0; i <=
p; i++)
1763 int idx = dof_map[o++];
1764 curl_shape(idx,0) = 0.;
1765 curl_shape(idx,1) = -dshape_cx(i);
1766 curl_shape(idx,2) = 0.;
1776 "ND_R1D_SegmentElement cannot be embedded in "
1777 "2 or 3 dimensional spaces");
1778 curl_shape *= (1.0 / J.
Weight());
1788 for (
int k = 0; k <
dof; k++)
1795 dofs(k) = Trans.
Jacobian()(0,0) *
t(0) * vk(0) +
1796 t(1) * vk(1) +
t(2) * vk(2);
1813 for (
int k = 0; k <
dof; k++)
1817 Vector t1(&tk_ptr[dof2tk[k] * 3], 1);
1818 Vector t3(&tk_ptr[dof2tk[k] * 3], 3);
1830 for (
int d = 0; d <
vdim; d++)
1836 for (
int j = 0; j < shape.
Size(); j++)
1839 if (fabs(
s) < 1e-12)
1845 for (
int d = 0; d <
vdim; d++)
1847 I(k, j + d*shape.
Size()) =
s*vk[d];
1860 for (
int k = 0; k <
dof; k++)
1864 Vector t1(&tk_ptr[dof2tk[k] * 3], 1);
1865 Vector t3(&tk_ptr[dof2tk[k] * 3], 3);
1877 I(k, j) +=
vshape(j, 0) * vk[0];
1880 I(k, j) +=
vshape(j, 1) * t3(1);
1881 I(k, j) +=
vshape(j, 2) * t3(2);
1888const real_t ND_R2D_SegmentElement::tk[4] = { 1.,0., 0.,1. };
1896 cbasis1d(
poly1d.GetBasis(
p, VerifyClosed(cb_type))),
1897 obasis1d(
poly1d.GetBasis(
p - 1, VerifyOpen(ob_type)))
1906#ifndef MFEM_THREAD_SAFE
1918 dof_map[
p] = o; dof2tk[o++] = 1;
1922 dof_map[2*
p] = o; dof2tk[o++] = 1;
1926 for (
int i = 0; i <
p; i++)
1929 dof_map[i] = o; dof2tk[o++] = 0;
1932 for (
int i = 1; i <
p; i++)
1935 dof_map[
p+i] = o; dof2tk[o++] = 1;
1944#ifdef MFEM_THREAD_SAFE
1945 Vector shape_cx(
p + 1), shape_ox(
p);
1948 cbasis1d.
Eval(ip.
x, shape_cx);
1949 obasis1d.
Eval(ip.
x, shape_ox);
1953 for (
int i = 0; i <
p; i++)
1955 int idx = dof_map[o++];
1956 shape(idx,0) = shape_ox(i);
1960 for (
int i = 0; i <=
p; i++)
1962 int idx = dof_map[o++];
1964 shape(idx,1) = shape_cx(i);
1974 "ND_R2D_SegmentElement cannot be embedded in "
1975 "2 or 3 dimensional spaces");
1976 for (
int i=0; i<
dof; i++)
1978 shape(i, 0) *= JI(0,0);
1987#ifdef MFEM_THREAD_SAFE
1988 Vector shape_cx(
p + 1), shape_ox(
p);
1992 cbasis1d.
Eval(ip.
x, shape_cx, dshape_cx);
1993 obasis1d.
Eval(ip.
x, shape_ox);
1997 for (
int i = 0; i <
p; i++)
1999 int idx = dof_map[o++];
2000 curl_shape(idx,0) = 0.;
2003 for (
int i = 0; i <=
p; i++)
2005 int idx = dof_map[o++];
2006 curl_shape(idx,0) = -dshape_cx(i);
2026 for (
int k = 0; k <
dof; k++)
2028 Vector t1(&tk_ptr[dof2tk[k] * 2], 1);
2029 Vector t2(&tk_ptr[dof2tk[k] * 2], 2);
2040 for (
int i = 0; i <
dim; i++)
2042 Ikj +=
vshape(j, i) * vk[i];
2044 Ikj +=
vshape(j, 1) * t2(1);
2045 I(k, j) = (fabs(Ikj) < 1e-12) ? 0.0 : Ikj;
2061 for (
int k = 0; k <
dof; k++)
2067 Vector t1(&tk_ptr[dof2tk[k] * 2], 1);
2068 Vector t2(&tk_ptr[dof2tk[k] * 2], 2);
2099 "ND_R2D_FiniteElement cannot be embedded in "
2100 "3 dimensional spaces");
2101 for (
int i=0; i<
dof; i++)
2105 shape(i, 0) = sx * JI(0, 0) + sy * JI(1, 0);
2106 shape(i, 1) = sx * JI(0, 1) + sy * JI(1, 1);
2116 "ND_R2D_FiniteElement cannot be embedded in "
2117 "3 dimensional spaces");
2118 for (
int i=0; i<
dof; i++)
2120 real_t sx = curl_shape(i, 0);
2121 real_t sy = curl_shape(i, 1);
2122 curl_shape(i, 0) = sx * J(0, 0) + sy * J(0, 1);
2123 curl_shape(i, 1) = sx * J(1, 0) + sy * J(1, 1);
2125 curl_shape *= (1.0 / Trans.
Weight());
2128void ND_R2D_FiniteElement::LocalInterpolation(
2136#ifdef MFEM_THREAD_SAFE
2149 for (
int k = 0; k <
dof; k++)
2163 for (
int i = 0; i <
dim; i++)
2165 Ikj +=
vshape(j, i) * vk[i];
2167 Ikj +=
vshape(j, 2) * t3(2);
2168 I(k, j) = (fabs(Ikj) < 1e-12) ? 0.0 : Ikj;
2180#ifdef MFEM_THREAD_SAFE
2188 for (
int j = 0; j <
dof; j++)
2198 Jinv.
Mult(t2, pt_data);
2199 for (
int k = 0; k <
dof; k++)
2202 for (
int d = 0; d <
dim; d++)
2204 R_jk +=
vshape(k,d)*pt_data[d];
2206 R_jk +=
vshape(k, 2) * t3(2);
2229 for (
int k = 0; k <
dof; k++)
2255 for (
int k = 0; k <
dof; k++)
2271 for (
int d = 0; d <
vdim; d++)
2277 for (
int j = 0; j < shape.
Size(); j++)
2280 if (fabs(
s) < 1e-12)
2286 for (
int d = 0; d <
vdim; d++)
2288 I(k, j + d*shape.
Size()) =
s*vk[d];
2301 for (
int k = 0; k <
dof; k++)
2318 for (
int i=0; i<2; i++)
2320 I(k, j) +=
vshape(j, i) * vk[i];
2324 I(k, j) +=
vshape(j, 2) * t3(2);
2341 for (
int k = 0; k <
dof; k++)
2345 for (
int j = 0; j < grad_k.
Size(); j++)
2347 grad(k,j) = (fabs(grad_k(j)) < 1e-12) ? 0.0 : grad_k(j);
2352const real_t ND_R2D_TriangleElement::tk_t[15] =
2353{ 1.,0.,0., -1.,1.,0., 0.,-1.,0., 0.,1.,0., 0.,0.,1. };
2361 int pm1 =
p - 1, pm2 =
p - 2;
2363#ifndef MFEM_THREAD_SAFE
2379 for (
int e=0; e<3; e++)
2382 for (
int i=0; i<
p; i++)
2387 for (
int i=0; i<pm1; i++)
2394 for (
int j = 0; j <= pm2; j++)
2395 for (
int i = 0; i + j <= pm2; i++)
2402 for (
int j = 0; j < pm1; j++)
2403 for (
int i = 0; i + j < pm2; i++)
2408 MFEM_VERIFY(n == ND_FE.
GetDof(),
2409 "ND_R2D_Triangle incorrect number of ND dofs.");
2410 MFEM_VERIFY(h == H1_FE.
GetDof(),
2411 "ND_R2D_Triangle incorrect number of H1 dofs.");
2412 MFEM_VERIFY(o ==
GetDof(),
2413 "ND_R2D_Triangle incorrect number of dofs.");
2418 for (
int i=0; i<
dof; i++)
2437#ifdef MFEM_THREAD_SAFE
2445 for (
int i=0; i<
dof; i++)
2450 shape(i, 0) = nd_shape(idx, 0);
2451 shape(i, 1) = nd_shape(idx, 1);
2458 shape(i, 2) = h1_shape(-idx-1);
2466#ifdef MFEM_THREAD_SAFE
2474 for (
int i=0; i<
dof; i++)
2479 curl_shape(i, 0) = 0.0;
2480 curl_shape(i, 1) = 0.0;
2481 curl_shape(i, 2) = nd_dshape(idx, 0);
2485 curl_shape(i, 0) = h1_dshape(-idx-1, 1);
2486 curl_shape(i, 1) = -h1_dshape(-idx-1, 0);
2487 curl_shape(i, 2) = 0.0;
2493const real_t ND_R2D_QuadrilateralElement::tk_q[15] =
2494{ 1.,0.,0., 0.,1.,0., -1.,0.,0., 0.,-1.,0., 0.,0.,1. };
2500 cbasis1d(
poly1d.GetBasis(
p, VerifyClosed(cb_type))),
2501 obasis1d(
poly1d.GetBasis(
p - 1, VerifyOpen(ob_type)))
2505 const int dofx =
p*(
p+1);
2506 const int dofy =
p*(
p+1);
2507 const int dofxy = dofx+dofy;
2509#ifndef MFEM_THREAD_SAFE
2528 for (
int i = 0; i <
p; i++)
2532 for (
int i = 1; i <
p; i++)
2534 dof_map[dofxy + i + 0*(
p+1)] = o++;
2536 for (
int j = 0; j <
p; j++)
2540 for (
int j = 1; j <
p; j++)
2544 for (
int i = 0; i <
p; i++)
2548 for (
int i = 1; i <
p; i++)
2552 for (
int j = 0; j <
p; j++)
2554 dof_map[dofx + 0 + (
p - 1 - j)*(
p + 1)] = -1 - (o++);
2556 for (
int j = 1; j <
p; j++)
2563 for (
int j = 1; j <
p; j++)
2564 for (
int i = 0; i <
p; i++)
2569 for (
int j = 0; j <
p; j++)
2570 for (
int i = 1; i <
p; i++)
2572 dof_map[dofx + i + j*(
p + 1)] = o++;
2575 for (
int j = 1; j <
p; j++)
2576 for (
int i = 1; i <
p; i++)
2578 dof_map[dofxy + i + j*(
p + 1)] = o++;
2584 for (
int j = 0; j <=
p; j++)
2585 for (
int i = 0; i <
p; i++)
2590 dof2tk[idx = -1 - idx] = 2;
2599 for (
int j = 0; j <
p; j++)
2600 for (
int i = 0; i <=
p; i++)
2605 dof2tk[idx = -1 - idx] = 3;
2614 for (
int j = 0; j <=
p; j++)
2615 for (
int i = 0; i <=
p; i++)
2628#ifdef MFEM_THREAD_SAFE
2629 Vector shape_cx(
p + 1), shape_ox(
p), shape_cy(
p + 1), shape_oy(
p);
2632 cbasis1d.
Eval(ip.
x, shape_cx);
2633 obasis1d.
Eval(ip.
x, shape_ox);
2634 cbasis1d.
Eval(ip.
y, shape_cy);
2635 obasis1d.
Eval(ip.
y, shape_oy);
2639 for (
int j = 0; j <=
p; j++)
2640 for (
int i = 0; i <
p; i++)
2645 idx = -1 - idx,
s = -1;
2651 shape(idx,0) =
s*shape_ox(i)*shape_cy(j);
2656 for (
int j = 0; j <
p; j++)
2657 for (
int i = 0; i <=
p; i++)
2662 idx = -1 - idx,
s = -1;
2669 shape(idx,1) =
s*shape_cx(i)*shape_oy(j);
2673 for (
int j = 0; j <=
p; j++)
2674 for (
int i = 0; i <=
p; i++)
2679 shape(idx,2) = shape_cx(i)*shape_cy(j);
2688#ifdef MFEM_THREAD_SAFE
2689 Vector shape_cx(
p + 1), shape_ox(
p), shape_cy(
p + 1), shape_oy(
p);
2690 Vector dshape_cx(
p + 1), dshape_cy(
p + 1);
2693 cbasis1d.
Eval(ip.
x, shape_cx, dshape_cx);
2694 obasis1d.
Eval(ip.
x, shape_ox);
2695 cbasis1d.
Eval(ip.
y, shape_cy, dshape_cy);
2696 obasis1d.
Eval(ip.
y, shape_oy);
2700 for (
int j = 0; j <=
p; j++)
2701 for (
int i = 0; i <
p; i++)
2706 idx = -1 - idx,
s = -1;
2712 curl_shape(idx,0) = 0.;
2713 curl_shape(idx,1) = 0.;
2714 curl_shape(idx,2) = -
s*shape_ox(i)*dshape_cy(j);
2717 for (
int j = 0; j <
p; j++)
2718 for (
int i = 0; i <=
p; i++)
2723 idx = -1 - idx,
s = -1;
2729 curl_shape(idx,0) = 0.;
2730 curl_shape(idx,1) = 0.;
2731 curl_shape(idx,2) =
s*dshape_cx(i)*shape_oy(j);
2734 for (
int j = 0; j <=
p; j++)
2735 for (
int i = 0; i <=
p; i++)
2738 curl_shape(idx,0) = shape_cx(i)*dshape_cy(j);
2739 curl_shape(idx,1) = -dshape_cx(i)*shape_cy(j);
2740 curl_shape(idx,2) = 0.;
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 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.
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
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.
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.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
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.
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.
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...
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...
void ProjectIntegrated(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
virtual void GetFaceMap(const int face_id, Array< int > &face_map) const
Return the mapping from lexicographic face DOFs to lexicographic element DOFs for the given local fac...
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.
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...
void ProjectIntegrated(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
virtual void GetFaceMap(const int face_id, Array< int > &face_map) const
Return the mapping from lexicographic face DOFs to lexicographic element DOFs for the given local fac...
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...
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...
ND_R1D_PointElement(int p)
Construct the ND_R1D_PointElement.
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.
virtual void CalcPhysCurlShape(ElementTransformation &Trans, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in physical space at the point de...
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...
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
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 CalcPhysCurlShape(ElementTransformation &Trans, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in physical space at the point de...
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
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)
virtual void CalcVShape(ElementTransformation &Trans, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in physical space at the point ...
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Compute the discrete gradient matrix from the given FiniteElement onto 'this' FiniteElement....
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs.
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_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...
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.
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 Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
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_R2D_TriangleElement(const int p, const int cb_type=BasisType::GaussLobatto)
Construct the ND_R2D_TriangleElement of order p.
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...
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...
ND_SegmentElement(const int p, const int ob_type=BasisType::GaussLegendre)
Construct the ND_SegmentElement of order p and open BasisType ob_type.
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...
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...
ND_TetrahedronElement(const int p)
Construct the ND_TetrahedronElement of order p.
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_TriangleElement(const int p)
Construct the ND_TriangleElement of order p.
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...
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...
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 * OpenPoints(const int p, const int btype=BasisType::GaussLegendre)
Get coordinates of an open (GaussLegendre) set of points if degree p.
const real_t * ClosedPoints(const int p, const int btype=BasisType::GaussLobatto)
Get coordinates of a closed (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.
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)