28 for (
int i = 0; i <
dof; i++)
32 dofs(i) = coeff.
Eval(Trans, ip);
42 for (
int i = 0; i <
dof; i++)
46 vc.
Eval (x, Trans, ip);
47 for (
int j = 0; j < x.
Size(); j++)
76 pos_mass_inv.
Mult(mixed_mass, I);
82 const int dims,
const int p,
const DofMapType dmtype)
91 internal::GetTensorFaceMap(
dim,
order, face_id, face_map);
122 real_t l1x, l2x, l3x, l1y, l2y, l3y;
124 l1x = (1. - x) * (1. - x);
125 l2x = 2. * x * (1. - x);
127 l1y = (1. - y) * (1. - y);
128 l2y = 2. * y * (1. - y);
131 shape(0) = l1x * l1y;
132 shape(4) = l2x * l1y;
133 shape(1) = l3x * l1y;
134 shape(7) = l1x * l2y;
135 shape(8) = l2x * l2y;
136 shape(5) = l3x * l2y;
137 shape(3) = l1x * l3y;
138 shape(6) = l2x * l3y;
139 shape(2) = l3x * l3y;
146 real_t l1x, l2x, l3x, l1y, l2y, l3y;
147 real_t d1x, d2x, d3x, d1y, d2y, d3y;
149 l1x = (1. - x) * (1. - x);
150 l2x = 2. * x * (1. - x);
152 l1y = (1. - y) * (1. - y);
153 l2y = 2. * y * (1. - y);
163 dshape(0,0) = d1x * l1y;
164 dshape(0,1) = l1x * d1y;
166 dshape(4,0) = d2x * l1y;
167 dshape(4,1) = l2x * d1y;
169 dshape(1,0) = d3x * l1y;
170 dshape(1,1) = l3x * d1y;
172 dshape(7,0) = d1x * l2y;
173 dshape(7,1) = l1x * d2y;
175 dshape(8,0) = d2x * l2y;
176 dshape(8,1) = l2x * d2y;
178 dshape(5,0) = d3x * l2y;
179 dshape(5,1) = l3x * d2y;
181 dshape(3,0) = d1x * l3y;
182 dshape(3,1) = l1x * d3y;
184 dshape(6,0) = d2x * l3y;
185 dshape(6,1) = l2x * d3y;
187 dshape(2,0) = d3x * l3y;
188 dshape(2,1) = l3x * d3y;
196 Vector xx(&tr_ip.
x, 2), shape(s, 9);
198 for (
int i = 0; i < 9; i++)
202 for (
int j = 0; j < 9; j++)
203 if (fabs(I(i,j) = s[j]) < 1.0e-12)
208 for (
int i = 0; i < 9; i++)
211 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
212 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
213 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
214 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
215 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
216 0.25 * (d[0] + d[1] + d[2] + d[3]);
225 for (
int i = 0; i < 9; i++)
229 d[i] = coeff.
Eval(Trans, ip);
231 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
232 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
233 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
234 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
235 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
236 0.25 * (d[0] + d[1] + d[2] + d[3]);
246 for (
int i = 0; i < 9; i++)
250 vc.
Eval (x, Trans, ip);
251 for (
int j = 0; j < x.
Size(); j++)
256 for (
int j = 0; j < x.
Size(); j++)
260 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
261 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
262 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
263 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
264 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
265 0.25 * (d[0] + d[1] + d[2] + d[3]);
281 const real_t x = ip.
x, x1 = 1. - x;
285 shape(2) = 2. * x * x1;
293 dshape(0,0) = 2. * x - 2.;
294 dshape(1,0) = 2. * x;
295 dshape(2,0) = 2. - 4. * x;
302#ifndef MFEM_THREAD_SAFE
311 for (
int i = 1; i <
p; i++)
322#ifdef MFEM_THREAD_SAFE
329 shape(0) = shape_x(0);
330 shape(1) = shape_x(
p);
331 for (
int i = 1; i <
p; i++)
333 shape(i+1) = shape_x(i);
342#ifdef MFEM_THREAD_SAFE
349 dshape(0,0) = dshape_x(0);
350 dshape(1,0) = dshape_x(
p);
351 for (
int i = 1; i <
p; i++)
353 dshape(i+1,0) = dshape_x(i);
367#ifndef MFEM_THREAD_SAFE
368 const int p1 =
p + 1;
377 for (
int j = 0; j <=
p; j++)
378 for (
int i = 0; i <=
p; i++)
389#ifdef MFEM_THREAD_SAFE
397 for (
int o = 0, j = 0; j <=
p; j++)
398 for (
int i = 0; i <=
p; i++)
400 shape(
dof_map[o++]) = shape_x(i)*shape_y(j);
409#ifdef MFEM_THREAD_SAFE
410 Vector shape_x(
p+1), shape_y(
p+1), dshape_x(
p+1), dshape_y(
p+1);
417 for (
int o = 0, j = 0; j <=
p; j++)
418 for (
int i = 0; i <=
p; i++)
420 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j);
421 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j); o++;
435#ifndef MFEM_THREAD_SAFE
436 const int p1 =
p + 1;
447 for (
int k = 0; k <=
p; k++)
448 for (
int j = 0; j <=
p; j++)
449 for (
int i = 0; i <=
p; i++)
459#ifdef MFEM_THREAD_SAFE
460 Vector shape_x(
p+1), shape_y(
p+1), shape_z(
p+1);
467 for (
int o = 0, k = 0; k <=
p; k++)
468 for (
int j = 0; j <=
p; j++)
469 for (
int i = 0; i <=
p; i++)
471 shape(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_z(k);
480#ifdef MFEM_THREAD_SAFE
481 Vector shape_x(
p+1), shape_y(
p+1), shape_z(
p+1);
482 Vector dshape_x(
p+1), dshape_y(
p+1), dshape_z(
p+1);
489 for (
int o = 0, k = 0; k <=
p; k++)
490 for (
int j = 0; j <=
p; j++)
491 for (
int i = 0; i <=
p; i++)
493 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j)* shape_z(k);
494 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j)* shape_z(k);
495 dshape(
dof_map[o],2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
510#ifndef MFEM_THREAD_SAFE
520 Index(
int p) { p2p3 = 2*
p + 3; }
521 int operator()(
int i,
int j) {
return ((p2p3-j)*j)/2+i; }
535 for (
int i = 1; i <
p; i++)
540 for (
int i = 1; i <
p; i++)
545 for (
int i = 1; i <
p; i++)
552 for (
int j = 1; j <
p; j++)
553 for (
int i = 1; i + j <
p; i++)
564 const real_t l3 = 1. - l1 - l2;
574 for (
int o = 0, j = 0; j <=
p; j++)
578 for (
int i = 0; i <=
p - j; i++)
591 const int dof = ((
p + 1)*(
p + 2))/2;
592 const real_t l3 = 1. - l1 - l2;
596 for (
int o = 0, j = 0; j <=
p; j++)
600 for (
int i = 0; i <=
p - j; i++)
607 for (
int i = 0; i <=
p; i++)
611 for (
int o = i, j = 0; j <=
p - i; j++)
623#ifdef MFEM_THREAD_SAFE
627 for (
int i = 0; i <
dof; i++)
636#ifdef MFEM_THREAD_SAFE
641 for (
int d = 0; d < 2; d++)
643 for (
int i = 0; i <
dof; i++)
655#ifndef MFEM_THREAD_SAFE
665 int tri(
int k) {
return (k*(k + 1))/2; }
666 int tet(
int k) {
return (k*(k + 1)*(k + 2))/6; }
667 Index(
int p_) {
p = p_; dof = tet(
p + 1); }
668 int operator()(
int i,
int j,
int k)
669 {
return dof - tet(
p - k) - tri(
p + 1 - k - j) + i; }
685 for (
int i = 1; i <
p; i++)
690 for (
int i = 1; i <
p; i++)
695 for (
int i = 1; i <
p; i++)
700 for (
int i = 1; i <
p; i++)
705 for (
int i = 1; i <
p; i++)
710 for (
int i = 1; i <
p; i++)
717 for (
int j = 1; j <
p; j++)
718 for (
int i = 1; i + j <
p; i++)
723 for (
int j = 1; j <
p; j++)
724 for (
int i = 1; i + j <
p; i++)
729 for (
int j = 1; j <
p; j++)
730 for (
int i = 1; i + j <
p; i++)
735 for (
int j = 1; j <
p; j++)
736 for (
int i = 1; i + j <
p; i++)
743 for (
int k = 1; k <
p; k++)
744 for (
int j = 1; j + k <
p; j++)
745 for (
int i = 1; i + j + k <
p; i++)
757 const real_t l4 = 1. - l1 - l2 - l3;
766 for (
int o = 0, k = 0; k <=
p; k++)
769 const real_t ek = bp[k]*l3k;
771 for (
int j = 0; j <=
p - k; j++)
774 real_t ekj = ek*bpk[j]*l2j;
775 for (
int i = 0; i <=
p - k - j; i++)
790 const int dof = ((
p + 1)*(
p + 2)*(
p + 3))/6;
791 const real_t l4 = 1. - l1 - l2 - l3;
799 for (
int o = 0, k = 0; k <=
p; k++)
802 const real_t ek = bp[k]*l3k;
804 for (
int j = 0; j <=
p - k; j++)
807 real_t ekj = ek*bpk[j]*l2j;
808 for (
int i = 0; i <=
p - k - j; i++)
821 for (
int ok = 0, k = 0; k <=
p; k++)
824 const real_t ek = bp[k]*l3k;
826 for (
int i = 0; i <=
p - k; i++)
829 real_t eki = ek*bpk[i]*l1i;
831 for (
int j = 0; j <=
p - k - i; j++)
839 ok += ((
p - k + 2)*(
p - k + 1))/2;
846 for (
int j = 0; j <=
p; j++)
849 const real_t ej = bp[j]*l2j;
851 for (
int i = 0; i <=
p - j; i++)
854 real_t eji = ej*bpj[i]*l1i;
855 int m = ((
p + 2)*(
p + 1))/2;
856 int n = ((
p - j + 2)*(
p - j + 1))/2;
857 for (
int o = i, k = 0; k <=
p - j - i; k++)
875#ifdef MFEM_THREAD_SAFE
879 for (
int i = 0; i <
dof; i++)
888#ifdef MFEM_THREAD_SAFE
893 for (
int d = 0; d < 3; d++)
895 for (
int i = 0; i <
dof; i++)
909#ifndef MFEM_THREAD_SAFE
929 for (
int i=1; i<
p; i++)
931 t_dof[5 + 0 * ne + i] = 2 + 0 * ne + i;
s_dof[5 + 0 * ne + i] = 0;
932 t_dof[5 + 1 * ne + i] = 2 + 1 * ne + i;
s_dof[5 + 1 * ne + i] = 0;
933 t_dof[5 + 2 * ne + i] = 2 + 2 * ne + i;
s_dof[5 + 2 * ne + i] = 0;
934 t_dof[5 + 3 * ne + i] = 2 + 0 * ne + i;
s_dof[5 + 3 * ne + i] = 1;
935 t_dof[5 + 4 * ne + i] = 2 + 1 * ne + i;
s_dof[5 + 4 * ne + i] = 1;
936 t_dof[5 + 5 * ne + i] = 2 + 2 * ne + i;
s_dof[5 + 5 * ne + i] = 1;
937 t_dof[5 + 6 * ne + i] = 0;
s_dof[5 + 6 * ne + i] = i + 1;
938 t_dof[5 + 7 * ne + i] = 1;
s_dof[5 + 7 * ne + i] = i + 1;
939 t_dof[5 + 8 * ne + i] = 2;
s_dof[5 + 8 * ne + i] = i + 1;
944 int nt = (
p-1)*(
p-2)/2;
945 for (
int j=1; j<
p; j++)
947 for (
int i=1; i<j; i++)
949 t_dof[6 + 9 * ne + k] = 3 *
p + k;
s_dof[6 + 9 * ne + k] = 0;
950 t_dof[6 + 9 * ne + nt + k] = 3 *
p + k;
s_dof[6 + 9 * ne + nt + k] = 1;
957 int nq = (
p-1)*(
p-1);
958 for (
int j=1; j<
p; j++)
960 for (
int i=1; i<
p; i++)
962 t_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 2 + 0 * ne + i;
963 t_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 2 + 1 * ne + i;
964 t_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 2 + 2 * ne + i;
966 s_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 1 + j;
967 s_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 1 + j;
968 s_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 1 + j;
979 for (
int j=1; j<
p; j++)
981 for (
int i=1; i<j; i++)
983 t_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 3 *
p + l;
984 s_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 1 + k;
993 for (
int i=0; i<
dof; i++)
1004#ifdef MFEM_THREAD_SAFE
1014 for (
int i=0; i<
dof; i++)
1023#ifdef MFEM_THREAD_SAFE
1037 for (
int i=0; i<
dof; i++)
1047 ((
p + 1)*(
p + 2)*(2 *
p + 3))/6,
p,
1049 nterms(((
p + 1)*(
p + 2)*(
p + 3)*(
p + 4))/24)
1051#ifndef MFEM_THREAD_SAFE
1074 for (
int i = 1; i <
p; i++)
1079 for (
int i = 1; i <
p; i++)
1084 for (
int i = 1; i <
p; i++)
1089 for (
int i = 1; i <
p; i++)
1094 for (
int i = 1; i <
p; i++)
1099 for (
int i = 1; i <
p; i++)
1104 for (
int i = 1; i <
p; i++)
1109 for (
int i = 1; i <
p; i++)
1117 for (
int j = 1; j <
p; j++)
1125 for (
int i = 1; i <=
p - j; i++)
1129 dof_map[idx(i1,i2,i3,i4,i5)] = o;
1132 for (
int i =
p - j + 1; i <
p; i++)
1136 dof_map[idx(i1,i2,i3,i4,i5)] = o;
1140 for (
int j = 1; j <
p; j++)
1141 for (
int i = 1; i + j <
p; i++)
1146 for (
int j = 1; j <
p; j++)
1147 for (
int i = 1; i + j <
p; i++)
1152 for (
int j = 1; j <
p; j++)
1153 for (
int i = 1; i + j <
p; i++)
1158 for (
int j = 1; j <
p; j++)
1159 for (
int i = 1; i + j <
p; i++)
1166 for (
int k = 1; k <
p; k++)
1167 for (
int j = 1; j + k <
p; j++)
1175 for (
int i = 1; i <= j; i++)
1179 dof_map[idx(i1,i2,i3,i4,i5)] = o;
1182 for (
int i = j + 1; i + k <
p; i++)
1186 dof_map[idx(i1,i2,i3,i4,i5)] = o;
1198 const int lshape = ((
p + 1)*(
p + 2)*(
p + 3)*(
p + 4))/24;
1199 for (
int i=0; i<
lshape; i++) { shape[i] = 0.0; }
1216 for (
int i5 = 0; i5 <=
p; i5++)
1219 const real_t ei5 = bp[i5]*l5i5;
1221 for (
int i4 = 0; i4 <=
p - i5; i4++)
1224 const real_t ei45 = ei5*bpi5[i4]*l4i4;
1226 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
1229 real_t ei345 = ei45*bpi45[i3]*l3i3;
1230 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
1232 const int i1 =
p - i5 - i4 - i3 - i2;
1233 const int o = idx(i1,i2,i3,i4,i5);
1234 shape_1d[i2] *= ei345;
1235 shape[o] += shape_1d[i2];
1250 const int nterms = ((
p + 1)*(
p + 2)*(
p + 3)*(
p + 4))/24;
1251 for (
int i=0; i<3*
nterms; i++) { dshape[i] = 0.0; }
1275 for (
int i5 = 0; i5 <=
p; i5++)
1278 const real_t ei5 = bp[i5]*l5i5;
1280 for (
int i4 = 0; i4 <=
p - i5; i4++)
1283 const real_t ei45 = ei5*bpi5[i4]*l4i4;
1285 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
1288 real_t ei345 = ei45*bpi45[i3]*l3i3;
1289 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
1291 const int i1 =
p - i5 - i4 - i3 - i2;
1292 const int o = idx(i1,i2,i3,i4,i5);
1293 const real_t dshape_dl1 = dshape_1d[i2]*ei345;
1294 for (
int d = 0; d < 3; d++)
1296 dshape[o + d *
nterms] += dshape_dl1 * dl1[d];
1308 for (
int i5 = 0; i5 <=
p; i5++)
1311 const real_t ei5 = bp[i5]*l5i5;
1313 for (
int i4 = 0; i4 <=
p - i5; i4++)
1316 const real_t ei45 = ei5*bpi5[i4]*l4i4;
1318 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
1321 real_t ei345 = ei45*bpi45[i3]*l3i3;
1322 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
1324 const int i1 =
p - i5 - i4 - i3 - i2;
1325 const int o = idx(i1,i2,i3,i4,i5);
1326 const real_t dshape_dl2 = dshape_1d[i2]*ei345;
1327 for (
int d = 0; d < 3; d++)
1329 dshape[o + d *
nterms] += dshape_dl2*dl2[d];
1341 for (
int i5 = 0; i5 <=
p; i5++)
1344 const real_t ei5 = bp[i5]*l5i5;
1346 for (
int i4 = 0; i4 <=
p - i5; i4++)
1349 const real_t ei45 = ei5*bpi5[i4]*l4i4;
1351 for (
int i3 = 1; i3 <=
p - i5 - i4; i3++)
1354 real_t ei345 = i3*ei45*bpi45[i3]*l3i3;
1355 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
1357 const int i1 =
p - i5 - i4 - i3 - i2;
1358 const int o = idx(i1,i2,i3,i4,i5);
1359 const real_t dshape_dl3 = dshape_1d[i2]*ei345;
1360 for (
int d = 0; d < 3; d++)
1362 dshape[o + d *
nterms] += dshape_dl3*dl3[d];
1374 for (
int i5 = 0; i5 <=
p; i5++)
1377 const real_t ei5 = bp[i5]*l5i5;
1379 for (
int i4 = 1; i4 <=
p - i5; i4++)
1382 const real_t ei45 = i4*ei5*bpi5[i4]*l4i4;
1384 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
1387 real_t ei345 = ei45*bpi45[i3]*l3i3;
1388 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
1390 const int i1 =
p - i5 - i4 - i3 - i2;
1391 const int o = idx(i1,i2,i3,i4,i5);
1392 const real_t dshape_dl4 = dshape_1d[i2]*ei345;
1393 for (
int d = 0; d < 3; d++)
1395 dshape[o + d *
nterms] += dshape_dl4*dl4[d];
1407 for (
int i5 = 1; i5 <=
p; i5++)
1410 const real_t ei5 = i5*bp[i5]*l5i5;
1412 for (
int i4 = 0; i4 <=
p - i5; i4++)
1415 const real_t ei45 = ei5*bpi5[i4]*l4i4;
1417 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
1420 real_t ei345 = ei45*bpi45[i3]*l3i3;
1421 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
1423 const int i1 =
p - i5 - i4 - i3 - i2;
1424 const int o = idx(i1,i2,i3,i4,i5);
1425 const real_t dshape_dl5 = dshape_1d[i2]*ei345;
1426 for (
int d = 0; d < 3; d++)
1428 dshape[o + d *
nterms] += dshape_dl5*dl5[d];
1442#ifdef MFEM_THREAD_SAFE
1449 for (
auto const& it :
dof_map)
1458#ifdef MFEM_THREAD_SAFE
1466 for (
auto const& it :
dof_map)
1467 for (
int d=0; d<3; d++)
1469 dshape(it.second, d) =
m_dshape(it.first, d);
1477#ifndef MFEM_THREAD_SAFE
1488 for (
int i = 0; i <=
p; i++)
1504#ifdef MFEM_THREAD_SAFE
1515 dofs[vertex*
order] = 1.0;
1522#ifndef MFEM_THREAD_SAFE
1535 for (
int o = 0, j = 0; j <=
p; j++)
1536 for (
int i = 0; i <=
p; i++)
1548#ifdef MFEM_THREAD_SAFE
1555 for (
int o = 0, j = 0; j <=
p; j++)
1556 for (
int i = 0; i <=
p; i++)
1558 shape(o++) = shape_x(i)*shape_y(j);
1567#ifdef MFEM_THREAD_SAFE
1568 Vector shape_x(
p+1), shape_y(
p+1), dshape_x(
p+1), dshape_y(
p+1);
1574 for (
int o = 0, j = 0; j <=
p; j++)
1575 for (
int i = 0; i <=
p; i++)
1577 dshape(o,0) = dshape_x(i)* shape_y(j);
1578 dshape(o,1) = shape_x(i)*dshape_y(j); o++;
1589 case 0: dofs[0] = 1.0;
break;
1590 case 1: dofs[
p] = 1.0;
break;
1591 case 2: dofs[
p*(
p + 2)] = 1.0;
break;
1592 case 3: dofs[
p*(
p + 1)] = 1.0;
break;
1600#ifndef MFEM_THREAD_SAFE
1615 for (
int o = 0, k = 0; k <=
p; k++)
1616 for (
int j = 0; j <=
p; j++)
1617 for (
int i = 0; i <=
p; i++)
1629#ifdef MFEM_THREAD_SAFE
1630 Vector shape_x(
p+1), shape_y(
p+1), shape_z(
p+1);
1637 for (
int o = 0, k = 0; k <=
p; k++)
1638 for (
int j = 0; j <=
p; j++)
1639 for (
int i = 0; i <=
p; i++)
1641 shape(o++) = shape_x(i)*shape_y(j)*shape_z(k);
1650#ifdef MFEM_THREAD_SAFE
1651 Vector shape_x(
p+1), shape_y(
p+1), shape_z(
p+1);
1652 Vector dshape_x(
p+1), dshape_y(
p+1), dshape_z(
p+1);
1659 for (
int o = 0, k = 0; k <=
p; k++)
1660 for (
int j = 0; j <=
p; j++)
1661 for (
int i = 0; i <=
p; i++)
1663 dshape(o,0) = dshape_x(i)* shape_y(j)* shape_z(k);
1664 dshape(o,1) = shape_x(i)*dshape_y(j)* shape_z(k);
1665 dshape(o,2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
1676 case 0: dofs[0] = 1.0;
break;
1677 case 1: dofs[
p] = 1.0;
break;
1678 case 2: dofs[
p*(
p + 2)] = 1.0;
break;
1679 case 3: dofs[
p*(
p + 1)] = 1.0;
break;
1680 case 4: dofs[
p*(
p + 1)*(
p + 1)] = 1.0;
break;
1681 case 5: dofs[
p +
p*(
p + 1)*(
p + 1)] = 1.0;
break;
1682 case 6: dofs[
dof - 1] = 1.0;
break;
1683 case 7: dofs[
dof -
p - 1] = 1.0;
break;
1692#ifndef MFEM_THREAD_SAFE
1702 for (
int o = 0, j = 0; j <=
p; j++)
1703 for (
int i = 0; i + j <=
p; i++)
1719#ifdef MFEM_THREAD_SAFE
1732 case 0: dofs[0] = 1.0;
break;
1733 case 1: dofs[
order] = 1.0;
break;
1734 case 2: dofs[
dof-1] = 1.0;
break;
1743#ifndef MFEM_THREAD_SAFE
1753 for (
int o = 0, k = 0; k <=
p; k++)
1754 for (
int j = 0; j + k <=
p; j++)
1755 for (
int i = 0; i + j + k <=
p; i++)
1772#ifdef MFEM_THREAD_SAFE
1785 case 0: dofs[0] = 1.0;
break;
1786 case 1: dofs[
order] = 1.0;
break;
1787 case 2: dofs[(
order*(
order+3))/2] = 1.0;
break;
1788 case 3: dofs[
dof-1] = 1.0;
break;
1799#ifndef MFEM_THREAD_SAFE
1811 for (
int k=0; k<=
p; k++)
1814 for (
int j=0; j<=
p; j++)
1816 for (
int i=0; i<=j; i++)
1828 for (
int i=0; i<
dof; i++)
1839#ifdef MFEM_THREAD_SAFE
1849 for (
int i=0; i<
dof; i++)
1858#ifdef MFEM_THREAD_SAFE
1872 for (
int i=0; i<
dof; i++)
1882 ((
p + 1)*(
p + 2)*(2 *
p + 3))/6,
p,
1884 nterms(((
p + 1)*(
p + 2)*(
p + 3)*(
p + 4))/24)
1886#ifndef MFEM_THREAD_SAFE
1895 for (
int o = 0, k = 0; k <=
p; k++)
1896 for (
int j = 0; j + k <=
p; j++)
1904 for (
int i = 0; i <= j; i++)
1908 dof_map[idx(i1,i2,i3,i4,i5)] = o;
1911 for (
int i = j + 1; i + k <=
p; i++)
1915 dof_map[idx(i1,i2,i3,i4,i5)] = o;
1927 const int lshape = ((
p + 1)*(
p + 2)*(
p + 3)*(
p + 4))/24;
1928 for (
int i=0; i<
lshape; i++) { shape[i] = 0.0; }
1945 for (
int i5 = 0; i5 <=
p; i5++)
1948 const real_t ei5 = bp[i5]*l5i5;
1950 for (
int i4 = 0; i4 <=
p - i5; i4++)
1953 const real_t ei45 = ei5*bpi5[i4]*l4i4;
1955 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
1958 real_t ei345 = ei45*bpi45[i3]*l3i3;
1959 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
1961 const int i1 =
p - i5 - i4 - i3 - i2;
1962 const int o = idx(i1,i2,i3,i4,i5);
1963 shape_1d[i2] *= ei345;
1964 shape[o] += shape_1d[i2];
1979 const int nterms = ((
p + 1)*(
p + 2)*(
p + 3)*(
p + 4))/24;
1980 for (
int i=0; i<3*
nterms; i++) { dshape[i] = 0.0; }
2004 for (
int i5 = 0; i5 <=
p; i5++)
2007 const real_t ei5 = bp[i5]*l5i5;
2009 for (
int i4 = 0; i4 <=
p - i5; i4++)
2012 const real_t ei45 = ei5*bpi5[i4]*l4i4;
2014 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
2017 real_t ei345 = ei45*bpi45[i3]*l3i3;
2018 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
2020 const int i1 =
p - i5 - i4 - i3 - i2;
2021 const int o = idx(i1,i2,i3,i4,i5);
2022 const real_t dshape_dl1 = dshape_1d[i2]*ei345;
2023 for (
int d = 0; d < 3; d++)
2025 dshape[o + d *
nterms] += dshape_dl1 * dl1[d];
2037 for (
int i5 = 0; i5 <=
p; i5++)
2040 const real_t ei5 = bp[i5]*l5i5;
2042 for (
int i4 = 0; i4 <=
p - i5; i4++)
2045 const real_t ei45 = ei5*bpi5[i4]*l4i4;
2047 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
2050 real_t ei345 = ei45*bpi45[i3]*l3i3;
2051 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
2053 const int i1 =
p - i5 - i4 - i3 - i2;
2054 const int o = idx(i1,i2,i3,i4,i5);
2055 const real_t dshape_dl2 = dshape_1d[i2]*ei345;
2056 for (
int d = 0; d < 3; d++)
2058 dshape[o + d *
nterms] += dshape_dl2*dl2[d];
2070 for (
int i5 = 0; i5 <=
p; i5++)
2073 const real_t ei5 = bp[i5]*l5i5;
2075 for (
int i4 = 0; i4 <=
p - i5; i4++)
2078 const real_t ei45 = ei5*bpi5[i4]*l4i4;
2080 for (
int i3 = 1; i3 <=
p - i5 - i4; i3++)
2083 real_t ei345 = i3*ei45*bpi45[i3]*l3i3;
2084 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
2086 const int i1 =
p - i5 - i4 - i3 - i2;
2087 const int o = idx(i1,i2,i3,i4,i5);
2088 const real_t dshape_dl3 = dshape_1d[i2]*ei345;
2089 for (
int d = 0; d < 3; d++)
2091 dshape[o + d *
nterms] += dshape_dl3*dl3[d];
2103 for (
int i5 = 0; i5 <=
p; i5++)
2106 const real_t ei5 = bp[i5]*l5i5;
2108 for (
int i4 = 1; i4 <=
p - i5; i4++)
2111 const real_t ei45 = i4*ei5*bpi5[i4]*l4i4;
2113 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
2116 real_t ei345 = ei45*bpi45[i3]*l3i3;
2117 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
2119 const int i1 =
p - i5 - i4 - i3 - i2;
2120 const int o = idx(i1,i2,i3,i4,i5);
2121 const real_t dshape_dl4 = dshape_1d[i2]*ei345;
2122 for (
int d = 0; d < 3; d++)
2124 dshape[o + d *
nterms] += dshape_dl4*dl4[d];
2136 for (
int i5 = 1; i5 <=
p; i5++)
2139 const real_t ei5 = i5*bp[i5]*l5i5;
2141 for (
int i4 = 0; i4 <=
p - i5; i4++)
2144 const real_t ei45 = ei5*bpi5[i4]*l4i4;
2146 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
2149 real_t ei345 = ei45*bpi45[i3]*l3i3;
2150 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
2152 const int i1 =
p - i5 - i4 - i3 - i2;
2153 const int o = idx(i1,i2,i3,i4,i5);
2154 const real_t dshape_dl5 = dshape_1d[i2]*ei345;
2155 for (
int d = 0; d < 3; d++)
2157 dshape[o + d *
nterms] += dshape_dl5*dl5[d];
2171#ifdef MFEM_THREAD_SAFE
2178 for (
auto const& it :
dof_map)
2187#ifdef MFEM_THREAD_SAFE
2195 for (
auto const& it :
dof_map)
2196 for (
int d=0; d<3; d++)
2198 dshape(it.second, d) =
m_dshape(it.first, d);
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
Possible basis types. Note that not all elements can use all BasisType(s).
BiQuadPos2DFiniteElement()
Construct the BiQuadPos2DFiniteElement.
void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const override
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...
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 GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const override
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
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...
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the coefficient in the element described by T at the point ip.
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.
real_t * Data() const
Returns the matrix data array.
real_t * GetData() const
Returns the matrix data array.
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
void Invert()
Replaces the current matrix with its inverse.
Abstract class for all finite elements.
int dof
Number of degrees of freedom.
const IntegrationRule & GetNodes() const
Get a const reference to the nodes of the element.
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 real_t lam4(real_t x, real_t y, real_t z)
static Vector grad_lam5(real_t x, real_t y, real_t z)
static real_t lam3(real_t x, real_t y, real_t z)
static Vector grad_lam4(real_t x, real_t y, real_t z)
static real_t lam2(real_t x, real_t y, real_t z)
static real_t lam1(real_t x, real_t y, real_t z)
Pyramid "Affine" Coordinates.
static real_t lam5(real_t x, real_t y, real_t z)
static Vector grad_lam1(real_t x, real_t y, real_t z)
Gradients of the "Affine" Coordinates.
static Vector grad_lam2(real_t x, real_t y, real_t z)
static Vector grad_lam3(real_t x, real_t y, real_t z)
Describes the function space on each element.
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...
H1Pos_HexahedronElement(const int p)
Construct the H1Pos_HexahedronElement of order p.
void ProjectDelta(int vertex, Vector &dofs) const override
Project a delta function centered on the given vertex in the local finite dimensional space represent...
H1Pos_PyramidElement(const int p)
Construct the H1Pos_PyramidElement of order p.
static void CalcShape(const int p, const real_t x, const real_t y, const real_t z, real_t *shape_1d, real_t *shape)
static void CalcDShape(const int p, const real_t x, const real_t y, const real_t z, real_t *dshape_1d, real_t *dshape)
std::map< int, int > dof_map
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 ProjectDelta(int vertex, Vector &dofs) const override
Project a delta function centered on the given vertex in the local finite dimensional space represent...
H1Pos_QuadrilateralElement(const int p)
Construct the H1Pos_QuadrilateralElement of order p.
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...
void ProjectDelta(int vertex, Vector &dofs) const override
Project a delta function centered on the given vertex in the local finite dimensional space represent...
H1Pos_SegmentElement(const int p)
Construct the H1Pos_SegmentElement of order p.
H1Pos_TetrahedronElement(const int p)
Construct the H1Pos_TetrahedronElement of order p.
static void CalcShape(const int p, const real_t x, const real_t y, const real_t z, real_t *shape)
static void CalcDShape(const int p, const real_t x, const real_t y, const real_t z, real_t *dshape_1d, real_t *dshape)
H1Pos_TriangleElement(const int p)
Construct the H1Pos_TriangleElement of order p.
static void CalcDShape(const int p, const real_t x, const real_t y, real_t *dshape_1d, real_t *dshape)
static void CalcShape(const int p, const real_t x, const real_t y, real_t *shape)
H1Pos_TriangleElement TriangleFE
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...
H1Pos_SegmentElement SegmentFE
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...
H1Pos_WedgeElement(const int p)
Construct the H1Pos_WedgeElement of order p.
Class for integration point with weight.
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.
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
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 ProjectDelta(int vertex, Vector &dofs) const override
Project a delta function centered on the given vertex in the local finite dimensional space represent...
L2Pos_HexahedronElement(const int p)
Construct the L2Pos_HexahedronElement of order p.
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...
static void CalcDShape(const int p, const real_t x, const real_t y, const real_t z, real_t *dshape_1d, real_t *dshape)
std::map< int, int > dof_map
static void CalcShape(const int p, const real_t x, const real_t y, const real_t z, real_t *shape_1d, real_t *shape)
L2Pos_PyramidElement(const int p)
Construct the L2Pos_PyramidElement of order p.
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 ProjectDelta(int vertex, Vector &dofs) const override
Project a delta function centered on the given vertex in the local finite dimensional space represent...
L2Pos_QuadrilateralElement(const int p)
Construct the L2Pos_QuadrilateralElement of order p.
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...
L2Pos_SegmentElement(const int p)
Construct the L2Pos_SegmentElement of order p.
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 ProjectDelta(int vertex, Vector &dofs) const override
Project a delta function centered on the given vertex in the local finite dimensional space represent...
L2Pos_TetrahedronElement(const int p)
Construct the L2Pos_TetrahedronElement of order p.
void ProjectDelta(int vertex, Vector &dofs) const override
Project a delta function centered on the given vertex in the local finite dimensional space represent...
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...
L2Pos_TriangleElement(const int p)
Construct the L2Pos_TriangleElement of order p.
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 ProjectDelta(int vertex, Vector &dofs) const override
Project a delta function centered on the given vertex in the local finite dimensional space represent...
L2Pos_TriangleElement TriangleFE
L2Pos_WedgeElement(const int p)
Construct the L2Pos_WedgeElement of order p.
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...
L2Pos_SegmentElement SegmentFE
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 AssembleElementMatrix(const FiniteElement &el, ElementTransformation &Trans, DenseMatrix &elmat) override
void AssembleElementMatrix2(const FiniteElement &trial_fe, const FiniteElement &test_fe, ElementTransformation &Trans, DenseMatrix &elmat) override
Class for standard nodal finite elements.
void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const override
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...
static void CalcDBinomTerms(const int p, const real_t x, const real_t y, real_t *d)
Compute the derivatives (w.r.t. x) of the terms in the expansion of the binomial (x + y)^p assuming t...
static const int * Binom(const int p)
Get a pointer to an array containing the binomial coefficients "pchoose k" for k=0,...
static void CalcDyBinomTerms(const int p, const real_t x, const real_t y, real_t *d)
Compute the derivatives (w.r.t. y) of the terms in the expansion of the binomial (x + y)^p....
static void CalcBernstein(const int p, const real_t x, real_t *u)
Compute the values of the Bernstein basis functions of order p at coordinate x and store the results ...
static void CalcBinomTerms(const int p, const real_t x, const real_t y, real_t *u)
Compute the p terms in the expansion of the binomial (x + y)^p and store them in the already allocate...
static void CalcDxBinomTerms(const int p, const real_t x, const real_t y, real_t *d)
Compute the derivatives (w.r.t. x) of the terms in the expansion of the binomial (x + y)^p....
Class for finite elements utilizing the always positive Bernstein basis.
void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const override
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...
PositiveTensorFiniteElement(const int dims, const int p, const DofMapType dmtype)
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 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...
QuadPos1DFiniteElement()
Construct the QuadPos1DFiniteElement.
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...
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 ...
void SetDataAndSize(real_t *d, int s)
Set the Vector data and size.
int Size() const
Returns the size of the vector.
void SetSize(int s)
Resize the vector to size s.
real_t * GetData() const
Return a pointer to the beginning of the Vector data.
Linear1DFiniteElement SegmentFE
MFEM_EXPORT Linear2DFiniteElement TriangleFE
real_t p(const Vector &x, real_t t)