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++)
568#if defined(MFEM_THREAD_SAFE) && defined(MFEM_USE_OPENMP)
569 #pragma omp critical (DofToQuad)
575 if (d2q->
IntRule != &ir || d2q->
mode != mode) { d2q =
nullptr; }
601 Vector shape_a1(ndof), shape_a2(ndof * ndof);
602 Vector shape_Ga1(ndof-1), shape_Ga2((ndof-1) * (ndof-1));
603 for (
int i = 0; i < nqpt; i++)
616 for (
int j = 0; j < ndof; j++)
618 rd2q->
Ba1t[i+nqpt*j] = rd2q->
Ba1[j+ndof*i] = shape_a1(j);
621 rd2q->
Ga1t[i+nqpt*j] = rd2q->
Ga1[j+(ndof-1)*i] = shape_Ga1(j);
626 for (
int k = 0; k < ndof-j; k++)
628 rd2q->
Ba2t[i + nqpt*(j + ndof*k)] = rd2q->
Ba2[k + ndof*(j + ndof*i)] = shape_a2(
630 if (j < ndof-1 && k < ndof-j-1)
632 rd2q->
Ga2t[i + nqpt*(j + (ndof-1)*k)] = rd2q->
Ga2[k + (ndof-1)*(j +
633 (ndof-1)*i)] = shape_Ga2(k);
641 for (
int i = 0; i < ndof; i++)
643 for (
int j = 0; j < ndof-i; j++)
645 int idx = ((2 * (ndof-1) + 3) - j) * j / 2 + i;
646 rd2q->
lex_map[j + ndof*i] = idx;
659 const real_t l3 = 1. - l1 - l2;
669 for (
int o = 0, j = 0; j <=
p; j++)
673 for (
int i = 0; i <=
p - j; i++)
686 const int dof = ((
p + 1)*(
p + 2))/2;
687 const real_t l3 = 1. - l1 - l2;
691 for (
int o = 0, j = 0; j <=
p; j++)
695 for (
int i = 0; i <=
p - j; i++)
702 for (
int i = 0; i <=
p; i++)
706 for (
int o = i, j = 0; j <=
p - i; j++)
718#ifdef MFEM_THREAD_SAFE
722 for (
int i = 0; i <
dof; i++)
731#ifdef MFEM_THREAD_SAFE
736 for (
int d = 0; d < 2; d++)
738 for (
int i = 0; i <
dof; i++)
750#ifndef MFEM_THREAD_SAFE
760 int tri(
int k) {
return (k*(k + 1))/2; }
761 int tet(
int k) {
return (k*(k + 1)*(k + 2))/6; }
762 Index(
int p_) {
p = p_; dof = tet(
p + 1); }
763 int operator()(
int i,
int j,
int k)
764 {
return dof - tet(
p - k) - tri(
p + 1 - k - j) + i; }
780 for (
int i = 1; i <
p; i++)
785 for (
int i = 1; i <
p; i++)
790 for (
int i = 1; i <
p; i++)
795 for (
int i = 1; i <
p; i++)
800 for (
int i = 1; i <
p; i++)
805 for (
int i = 1; i <
p; i++)
812 for (
int j = 1; j <
p; j++)
813 for (
int i = 1; i + j <
p; i++)
818 for (
int j = 1; j <
p; j++)
819 for (
int i = 1; i + j <
p; i++)
824 for (
int j = 1; j <
p; j++)
825 for (
int i = 1; i + j <
p; i++)
830 for (
int j = 1; j <
p; j++)
831 for (
int i = 1; i + j <
p; i++)
838 for (
int k = 1; k <
p; k++)
839 for (
int j = 1; j + k <
p; j++)
840 for (
int i = 1; i + j + k <
p; i++)
855#if defined(MFEM_THREAD_SAFE) && defined(MFEM_USE_OPENMP)
856 #pragma omp critical (DofToQuad)
862 if (d2q->
IntRule != &ir || d2q->
mode != mode) { d2q =
nullptr; }
869 const int basis_dim2d = ndof*(ndof+1) / 2;
870 const int basis_dim3d = ndof*(ndof+1)*(ndof+2) / 6;
871 const int basis_dim2d_diff = (ndof-1)*(ndof) / 2;
872 const int basis_dim3d_diff = (ndof-1)*(ndof)*(ndof+1) / 6;
912 for (
int i = 0; i < ndof-1; i++)
914 for (
int j = 0; j < ndof-i-1; j++)
924 for (
int k = 0; k < ndof-1; k++)
926 for (
int j = 0; j < ndof-k-1; j++)
928 for (
int i = 0; i < ndof-k-j-1; i++)
941 for (
int j = 0; j < ndof; j++)
943 for (
int i = 0; i < ndof-j; i++)
953 for (
int k = 0; k < ndof; k++)
955 for (
int j = 0; j < ndof-k; j++)
957 for (
int i = 0; i < ndof-k-j; i++)
968 Vector shape_a1(ndof), shape_a2(ndof * ndof), shape_a3(ndof * ndof * ndof);
969 Vector shape_Ga1(ndof-1), shape_Ga2(ndof-1), shape_Ga3(ndof-1);
970 for (
int i = 0; i < nqpt; i++)
985 for (
int j = 0; j < ndof; j++)
987 rd2q->
Ba1t[i+nqpt*j] = rd2q->
Ba1[j+ndof*i] = shape_a1(j);
990 rd2q->
Ga1t[i+nqpt*j] = rd2q->
Ga1[j+(ndof-1)*i] = shape_Ga1(j);
995 for (
int k = 0; k < ndof-j; k++)
998 rd2q->
Ba2t[i + nqpt*a_2d_mass] = rd2q->
Ba2[a_2d_mass + basis_dim2d*i] =
1001 if (j < ndof-1 && k < ndof-j-1)
1004 rd2q->
Ga2t[i + nqpt*a_2d_diff] = rd2q->
Ga2[a_2d_diff + basis_dim2d_diff*i] =
1010 for (
int m = 0; m < ndof-j-k; m++)
1013 rd2q->
Ba3t[i + nqpt*a_3d_mass] = rd2q->
Ba3[a_3d_mass + basis_dim3d*i] =
1016 if (j < ndof-1 && k < ndof-j-1 && m < ndof-j-k-1)
1022 rd2q->
Ga3t[i + nqpt*a_3d_diff] = rd2q->
Ga3[a_3d_diff + basis_dim3d_diff*i] =
1033 for (
int i = 0; i < ndof; i++)
1035 for (
int j = 0; j < ndof-i; j++)
1037 for (
int k = 0; k < ndof-i-j; k++)
1039 int dof = (
p+1)*(
p+2)*(
p+3) / 6;
1040 int tet = (
p-k)*(
p-k+1)*(
p-k+2) / 6;
1041 int tri = (
p+1-k-j)*(
p+2-k-j)/2;
1042 int multi_idx =
dof - tet - tri + i;
1043 rd2q->
lex_map[k + ndof*(j + ndof*i)] = multi_idx;
1059 const real_t l4 = 1. - l1 - l2 - l3;
1068 for (
int o = 0, k = 0; k <=
p; k++)
1071 const real_t ek = bp[k]*l3k;
1073 for (
int j = 0; j <=
p - k; j++)
1076 real_t ekj = ek*bpk[j]*l2j;
1077 for (
int i = 0; i <=
p - k - j; i++)
1092 const int dof = ((
p + 1)*(
p + 2)*(
p + 3))/6;
1093 const real_t l4 = 1. - l1 - l2 - l3;
1101 for (
int o = 0, k = 0; k <=
p; k++)
1104 const real_t ek = bp[k]*l3k;
1106 for (
int j = 0; j <=
p - k; j++)
1109 real_t ekj = ek*bpk[j]*l2j;
1110 for (
int i = 0; i <=
p - k - j; i++)
1123 for (
int ok = 0, k = 0; k <=
p; k++)
1126 const real_t ek = bp[k]*l3k;
1128 for (
int i = 0; i <=
p - k; i++)
1131 real_t eki = ek*bpk[i]*l1i;
1133 for (
int j = 0; j <=
p - k - i; j++)
1141 ok += ((
p - k + 2)*(
p - k + 1))/2;
1148 for (
int j = 0; j <=
p; j++)
1151 const real_t ej = bp[j]*l2j;
1153 for (
int i = 0; i <=
p - j; i++)
1156 real_t eji = ej*bpj[i]*l1i;
1157 int m = ((
p + 2)*(
p + 1))/2;
1158 int n = ((
p - j + 2)*(
p - j + 1))/2;
1159 for (
int o = i, k = 0; k <=
p - j - i; k++)
1177#ifdef MFEM_THREAD_SAFE
1181 for (
int i = 0; i <
dof; i++)
1190#ifdef MFEM_THREAD_SAFE
1195 for (
int d = 0; d < 3; d++)
1197 for (
int i = 0; i <
dof; i++)
1211#ifndef MFEM_THREAD_SAFE
1231 for (
int i=1; i<
p; i++)
1233 t_dof[5 + 0 * ne + i] = 2 + 0 * ne + i;
s_dof[5 + 0 * ne + i] = 0;
1234 t_dof[5 + 1 * ne + i] = 2 + 1 * ne + i;
s_dof[5 + 1 * ne + i] = 0;
1235 t_dof[5 + 2 * ne + i] = 2 + 2 * ne + i;
s_dof[5 + 2 * ne + i] = 0;
1236 t_dof[5 + 3 * ne + i] = 2 + 0 * ne + i;
s_dof[5 + 3 * ne + i] = 1;
1237 t_dof[5 + 4 * ne + i] = 2 + 1 * ne + i;
s_dof[5 + 4 * ne + i] = 1;
1238 t_dof[5 + 5 * ne + i] = 2 + 2 * ne + i;
s_dof[5 + 5 * ne + i] = 1;
1239 t_dof[5 + 6 * ne + i] = 0;
s_dof[5 + 6 * ne + i] = i + 1;
1240 t_dof[5 + 7 * ne + i] = 1;
s_dof[5 + 7 * ne + i] = i + 1;
1241 t_dof[5 + 8 * ne + i] = 2;
s_dof[5 + 8 * ne + i] = i + 1;
1246 int nt = (
p-1)*(
p-2)/2;
1247 for (
int j=1; j<
p; j++)
1249 for (
int i=1; i<j; i++)
1251 t_dof[6 + 9 * ne + k] = 3 *
p + k;
s_dof[6 + 9 * ne + k] = 0;
1252 t_dof[6 + 9 * ne + nt + k] = 3 *
p + k;
s_dof[6 + 9 * ne + nt + k] = 1;
1259 int nq = (
p-1)*(
p-1);
1260 for (
int j=1; j<
p; j++)
1262 for (
int i=1; i<
p; i++)
1264 t_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 2 + 0 * ne + i;
1265 t_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 2 + 1 * ne + i;
1266 t_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 2 + 2 * ne + i;
1268 s_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 1 + j;
1269 s_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 1 + j;
1270 s_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 1 + j;
1281 for (
int j=1; j<
p; j++)
1283 for (
int i=1; i<j; i++)
1285 t_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 3 *
p + l;
1286 s_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 1 + k;
1295 for (
int i=0; i<
dof; i++)
1306#ifdef MFEM_THREAD_SAFE
1316 for (
int i=0; i<
dof; i++)
1325#ifdef MFEM_THREAD_SAFE
1339 for (
int i=0; i<
dof; i++)
1349 ((
p + 1)*(
p + 2)*(2 *
p + 3))/6,
p,
1351 nterms(((
p + 1)*(
p + 2)*(
p + 3)*(
p + 4))/24)
1353#ifndef MFEM_THREAD_SAFE
1376 for (
int i = 1; i <
p; i++)
1381 for (
int i = 1; i <
p; i++)
1386 for (
int i = 1; i <
p; i++)
1391 for (
int i = 1; i <
p; i++)
1396 for (
int i = 1; i <
p; i++)
1401 for (
int i = 1; i <
p; i++)
1406 for (
int i = 1; i <
p; i++)
1411 for (
int i = 1; i <
p; i++)
1419 for (
int j = 1; j <
p; j++)
1427 for (
int i = 1; i <=
p - j; i++)
1431 dof_map[idx(i1,i2,i3,i4,i5)] = o;
1434 for (
int i =
p - j + 1; i <
p; i++)
1438 dof_map[idx(i1,i2,i3,i4,i5)] = o;
1442 for (
int j = 1; j <
p; j++)
1443 for (
int i = 1; i + j <
p; i++)
1448 for (
int j = 1; j <
p; j++)
1449 for (
int i = 1; i + j <
p; i++)
1454 for (
int j = 1; j <
p; j++)
1455 for (
int i = 1; i + j <
p; i++)
1460 for (
int j = 1; j <
p; j++)
1461 for (
int i = 1; i + j <
p; i++)
1468 for (
int k = 1; k <
p; k++)
1469 for (
int j = 1; j + k <
p; j++)
1477 for (
int i = 1; i <= j; i++)
1481 dof_map[idx(i1,i2,i3,i4,i5)] = o;
1484 for (
int i = j + 1; i + k <
p; i++)
1488 dof_map[idx(i1,i2,i3,i4,i5)] = o;
1500 const int lshape = ((
p + 1)*(
p + 2)*(
p + 3)*(
p + 4))/24;
1501 for (
int i=0; i<
lshape; i++) { shape[i] = 0.0; }
1518 for (
int i5 = 0; i5 <=
p; i5++)
1521 const real_t ei5 = bp[i5]*l5i5;
1523 for (
int i4 = 0; i4 <=
p - i5; i4++)
1526 const real_t ei45 = ei5*bpi5[i4]*l4i4;
1528 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
1531 real_t ei345 = ei45*bpi45[i3]*l3i3;
1532 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
1534 const int i1 =
p - i5 - i4 - i3 - i2;
1535 const int o = idx(i1,i2,i3,i4,i5);
1536 shape_1d[i2] *= ei345;
1537 shape[o] += shape_1d[i2];
1552 const int nterms = ((
p + 1)*(
p + 2)*(
p + 3)*(
p + 4))/24;
1553 for (
int i=0; i<3*
nterms; i++) { dshape[i] = 0.0; }
1577 for (
int i5 = 0; i5 <=
p; i5++)
1580 const real_t ei5 = bp[i5]*l5i5;
1582 for (
int i4 = 0; i4 <=
p - i5; i4++)
1585 const real_t ei45 = ei5*bpi5[i4]*l4i4;
1587 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
1590 real_t ei345 = ei45*bpi45[i3]*l3i3;
1591 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
1593 const int i1 =
p - i5 - i4 - i3 - i2;
1594 const int o = idx(i1,i2,i3,i4,i5);
1595 const real_t dshape_dl1 = dshape_1d[i2]*ei345;
1596 for (
int d = 0; d < 3; d++)
1598 dshape[o + d *
nterms] += dshape_dl1 * dl1[d];
1610 for (
int i5 = 0; i5 <=
p; i5++)
1613 const real_t ei5 = bp[i5]*l5i5;
1615 for (
int i4 = 0; i4 <=
p - i5; i4++)
1618 const real_t ei45 = ei5*bpi5[i4]*l4i4;
1620 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
1623 real_t ei345 = ei45*bpi45[i3]*l3i3;
1624 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
1626 const int i1 =
p - i5 - i4 - i3 - i2;
1627 const int o = idx(i1,i2,i3,i4,i5);
1628 const real_t dshape_dl2 = dshape_1d[i2]*ei345;
1629 for (
int d = 0; d < 3; d++)
1631 dshape[o + d *
nterms] += dshape_dl2*dl2[d];
1643 for (
int i5 = 0; i5 <=
p; i5++)
1646 const real_t ei5 = bp[i5]*l5i5;
1648 for (
int i4 = 0; i4 <=
p - i5; i4++)
1651 const real_t ei45 = ei5*bpi5[i4]*l4i4;
1653 for (
int i3 = 1; i3 <=
p - i5 - i4; i3++)
1656 real_t ei345 = i3*ei45*bpi45[i3]*l3i3;
1657 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
1659 const int i1 =
p - i5 - i4 - i3 - i2;
1660 const int o = idx(i1,i2,i3,i4,i5);
1661 const real_t dshape_dl3 = dshape_1d[i2]*ei345;
1662 for (
int d = 0; d < 3; d++)
1664 dshape[o + d *
nterms] += dshape_dl3*dl3[d];
1676 for (
int i5 = 0; i5 <=
p; i5++)
1679 const real_t ei5 = bp[i5]*l5i5;
1681 for (
int i4 = 1; i4 <=
p - i5; i4++)
1684 const real_t ei45 = i4*ei5*bpi5[i4]*l4i4;
1686 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
1689 real_t ei345 = ei45*bpi45[i3]*l3i3;
1690 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
1692 const int i1 =
p - i5 - i4 - i3 - i2;
1693 const int o = idx(i1,i2,i3,i4,i5);
1694 const real_t dshape_dl4 = dshape_1d[i2]*ei345;
1695 for (
int d = 0; d < 3; d++)
1697 dshape[o + d *
nterms] += dshape_dl4*dl4[d];
1709 for (
int i5 = 1; i5 <=
p; i5++)
1712 const real_t ei5 = i5*bp[i5]*l5i5;
1714 for (
int i4 = 0; i4 <=
p - i5; i4++)
1717 const real_t ei45 = ei5*bpi5[i4]*l4i4;
1719 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
1722 real_t ei345 = ei45*bpi45[i3]*l3i3;
1723 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
1725 const int i1 =
p - i5 - i4 - i3 - i2;
1726 const int o = idx(i1,i2,i3,i4,i5);
1727 const real_t dshape_dl5 = dshape_1d[i2]*ei345;
1728 for (
int d = 0; d < 3; d++)
1730 dshape[o + d *
nterms] += dshape_dl5*dl5[d];
1744#ifdef MFEM_THREAD_SAFE
1751 for (
auto const& it :
dof_map)
1760#ifdef MFEM_THREAD_SAFE
1768 for (
auto const& it :
dof_map)
1769 for (
int d=0; d<3; d++)
1771 dshape(it.second, d) =
m_dshape(it.first, d);
1779#ifndef MFEM_THREAD_SAFE
1790 for (
int i = 0; i <=
p; i++)
1806#ifdef MFEM_THREAD_SAFE
1817 dofs[vertex*
order] = 1.0;
1824#ifndef MFEM_THREAD_SAFE
1837 for (
int o = 0, j = 0; j <=
p; j++)
1838 for (
int i = 0; i <=
p; i++)
1850#ifdef MFEM_THREAD_SAFE
1857 for (
int o = 0, j = 0; j <=
p; j++)
1858 for (
int i = 0; i <=
p; i++)
1860 shape(o++) = shape_x(i)*shape_y(j);
1869#ifdef MFEM_THREAD_SAFE
1870 Vector shape_x(
p+1), shape_y(
p+1), dshape_x(
p+1), dshape_y(
p+1);
1876 for (
int o = 0, j = 0; j <=
p; j++)
1877 for (
int i = 0; i <=
p; i++)
1879 dshape(o,0) = dshape_x(i)* shape_y(j);
1880 dshape(o,1) = shape_x(i)*dshape_y(j); o++;
1891 case 0: dofs[0] = 1.0;
break;
1892 case 1: dofs[
p] = 1.0;
break;
1893 case 2: dofs[
p*(
p + 2)] = 1.0;
break;
1894 case 3: dofs[
p*(
p + 1)] = 1.0;
break;
1902#ifndef MFEM_THREAD_SAFE
1917 for (
int o = 0, k = 0; k <=
p; k++)
1918 for (
int j = 0; j <=
p; j++)
1919 for (
int i = 0; i <=
p; i++)
1931#ifdef MFEM_THREAD_SAFE
1932 Vector shape_x(
p+1), shape_y(
p+1), shape_z(
p+1);
1939 for (
int o = 0, k = 0; k <=
p; k++)
1940 for (
int j = 0; j <=
p; j++)
1941 for (
int i = 0; i <=
p; i++)
1943 shape(o++) = shape_x(i)*shape_y(j)*shape_z(k);
1952#ifdef MFEM_THREAD_SAFE
1953 Vector shape_x(
p+1), shape_y(
p+1), shape_z(
p+1);
1954 Vector dshape_x(
p+1), dshape_y(
p+1), dshape_z(
p+1);
1961 for (
int o = 0, k = 0; k <=
p; k++)
1962 for (
int j = 0; j <=
p; j++)
1963 for (
int i = 0; i <=
p; i++)
1965 dshape(o,0) = dshape_x(i)* shape_y(j)* shape_z(k);
1966 dshape(o,1) = shape_x(i)*dshape_y(j)* shape_z(k);
1967 dshape(o,2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
1978 case 0: dofs[0] = 1.0;
break;
1979 case 1: dofs[
p] = 1.0;
break;
1980 case 2: dofs[
p*(
p + 2)] = 1.0;
break;
1981 case 3: dofs[
p*(
p + 1)] = 1.0;
break;
1982 case 4: dofs[
p*(
p + 1)*(
p + 1)] = 1.0;
break;
1983 case 5: dofs[
p +
p*(
p + 1)*(
p + 1)] = 1.0;
break;
1984 case 6: dofs[
dof - 1] = 1.0;
break;
1985 case 7: dofs[
dof -
p - 1] = 1.0;
break;
1994#ifndef MFEM_THREAD_SAFE
2004 for (
int o = 0, j = 0; j <=
p; j++)
2005 for (
int i = 0; i + j <=
p; i++)
2021#ifdef MFEM_THREAD_SAFE
2034 case 0: dofs[0] = 1.0;
break;
2035 case 1: dofs[
order] = 1.0;
break;
2036 case 2: dofs[
dof-1] = 1.0;
break;
2045#ifndef MFEM_THREAD_SAFE
2055 for (
int o = 0, k = 0; k <=
p; k++)
2056 for (
int j = 0; j + k <=
p; j++)
2057 for (
int i = 0; i + j + k <=
p; i++)
2074#ifdef MFEM_THREAD_SAFE
2087 case 0: dofs[0] = 1.0;
break;
2088 case 1: dofs[
order] = 1.0;
break;
2089 case 2: dofs[(
order*(
order+3))/2] = 1.0;
break;
2090 case 3: dofs[
dof-1] = 1.0;
break;
2101#ifndef MFEM_THREAD_SAFE
2113 for (
int k=0; k<=
p; k++)
2116 for (
int j=0; j<=
p; j++)
2118 for (
int i=0; i<=j; i++)
2130 for (
int i=0; i<
dof; i++)
2141#ifdef MFEM_THREAD_SAFE
2151 for (
int i=0; i<
dof; i++)
2160#ifdef MFEM_THREAD_SAFE
2174 for (
int i=0; i<
dof; i++)
2184 ((
p + 1)*(
p + 2)*(2 *
p + 3))/6,
p,
2186 nterms(((
p + 1)*(
p + 2)*(
p + 3)*(
p + 4))/24)
2188#ifndef MFEM_THREAD_SAFE
2203 for (
int o = 0, k = 0; k <=
p; k++)
2204 for (
int j = 0; j + k <=
p; j++)
2212 for (
int i = 0; i <= j; i++)
2216 dof_map[idx(i1,i2,i3,i4,i5)] = o;
2219 for (
int i = j + 1; i + k <=
p; i++)
2223 dof_map[idx(i1,i2,i3,i4,i5)] = o;
2236 const int lshape = ((
p + 1)*(
p + 2)*(
p + 3)*(
p + 4))/24;
2237 for (
int i=0; i<
lshape; i++) { shape[i] = 0.0; }
2254 for (
int i5 = 0; i5 <=
p; i5++)
2257 const real_t ei5 = bp[i5]*l5i5;
2259 for (
int i4 = 0; i4 <=
p - i5; i4++)
2262 const real_t ei45 = ei5*bpi5[i4]*l4i4;
2264 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
2267 real_t ei345 = ei45*bpi45[i3]*l3i3;
2268 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
2270 const int i1 =
p - i5 - i4 - i3 - i2;
2271 const int o = idx(i1,i2,i3,i4,i5);
2272 shape_1d[i2] *= ei345;
2273 shape[o] += shape_1d[i2];
2288 const int nterms = ((
p + 1)*(
p + 2)*(
p + 3)*(
p + 4))/24;
2289 for (
int i=0; i<3*
nterms; i++) { dshape[i] = 0.0; }
2313 for (
int i5 = 0; i5 <=
p; i5++)
2316 const real_t ei5 = bp[i5]*l5i5;
2318 for (
int i4 = 0; i4 <=
p - i5; i4++)
2321 const real_t ei45 = ei5*bpi5[i4]*l4i4;
2323 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
2326 real_t ei345 = ei45*bpi45[i3]*l3i3;
2327 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
2329 const int i1 =
p - i5 - i4 - i3 - i2;
2330 const int o = idx(i1,i2,i3,i4,i5);
2331 const real_t dshape_dl1 = dshape_1d[i2]*ei345;
2332 for (
int d = 0; d < 3; d++)
2334 dshape[o + d *
nterms] += dshape_dl1 * dl1[d];
2346 for (
int i5 = 0; i5 <=
p; i5++)
2349 const real_t ei5 = bp[i5]*l5i5;
2351 for (
int i4 = 0; i4 <=
p - i5; i4++)
2354 const real_t ei45 = ei5*bpi5[i4]*l4i4;
2356 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
2359 real_t ei345 = ei45*bpi45[i3]*l3i3;
2360 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
2362 const int i1 =
p - i5 - i4 - i3 - i2;
2363 const int o = idx(i1,i2,i3,i4,i5);
2364 const real_t dshape_dl2 = dshape_1d[i2]*ei345;
2365 for (
int d = 0; d < 3; d++)
2367 dshape[o + d *
nterms] += dshape_dl2*dl2[d];
2379 for (
int i5 = 0; i5 <=
p; i5++)
2382 const real_t ei5 = bp[i5]*l5i5;
2384 for (
int i4 = 0; i4 <=
p - i5; i4++)
2387 const real_t ei45 = ei5*bpi5[i4]*l4i4;
2389 for (
int i3 = 1; i3 <=
p - i5 - i4; i3++)
2392 real_t ei345 = i3*ei45*bpi45[i3]*l3i3;
2393 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
2395 const int i1 =
p - i5 - i4 - i3 - i2;
2396 const int o = idx(i1,i2,i3,i4,i5);
2397 const real_t dshape_dl3 = dshape_1d[i2]*ei345;
2398 for (
int d = 0; d < 3; d++)
2400 dshape[o + d *
nterms] += dshape_dl3*dl3[d];
2412 for (
int i5 = 0; i5 <=
p; i5++)
2415 const real_t ei5 = bp[i5]*l5i5;
2417 for (
int i4 = 1; i4 <=
p - i5; i4++)
2420 const real_t ei45 = i4*ei5*bpi5[i4]*l4i4;
2422 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
2425 real_t ei345 = ei45*bpi45[i3]*l3i3;
2426 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
2428 const int i1 =
p - i5 - i4 - i3 - i2;
2429 const int o = idx(i1,i2,i3,i4,i5);
2430 const real_t dshape_dl4 = dshape_1d[i2]*ei345;
2431 for (
int d = 0; d < 3; d++)
2433 dshape[o + d *
nterms] += dshape_dl4*dl4[d];
2445 for (
int i5 = 1; i5 <=
p; i5++)
2448 const real_t ei5 = i5*bp[i5]*l5i5;
2450 for (
int i4 = 0; i4 <=
p - i5; i4++)
2453 const real_t ei45 = ei5*bpi5[i4]*l4i4;
2455 for (
int i3 = 0; i3 <=
p - i5 - i4; i3++)
2458 real_t ei345 = ei45*bpi45[i3]*l3i3;
2459 for (
int i2 = 0; i2 <=
p - i5 - i4 - i3; i2++)
2461 const int i1 =
p - i5 - i4 - i3 - i2;
2462 const int o = idx(i1,i2,i3,i4,i5);
2463 const real_t dshape_dl5 = dshape_1d[i2]*ei345;
2464 for (
int d = 0; d < 3; d++)
2466 dshape[o + d *
nterms] += dshape_dl5*dl5[d];
2480#ifdef MFEM_THREAD_SAFE
2487 for (
auto const& it :
dof_map)
2496#ifdef MFEM_THREAD_SAFE
2504 for (
auto const& it :
dof_map)
2505 for (
int d=0; d<3; d++)
2507 dshape(it.second, d) =
m_dshape(it.first, d);
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
int Append(const T &el)
Append element 'el' to array, resize if necessary.
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. Warning: this method casts away constness.
real_t * GetData() const
Returns the matrix data array. Warning: this method casts away constness.
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
void Invert()
Replaces the current matrix with its inverse.
Structure representing the matrices/tensors needed to evaluate (in reference space) the values,...
Mode mode
Describes the contents of the B, Bt, G, and Gt arrays, see Mode.
const IntegrationRule * IntRule
IntegrationRule that defines the quadrature points at which the basis functions of the FE are evaluat...
Mode
Type of data stored in the arrays B, Bt, G, and Gt.
@ RAGGED_TENSOR
Ragged tensor product representation using 1D matrices/tensors with dimensions using 1D number of qua...
int ndof
Number of degrees of freedom = number of basis functions. When mode is TENSOR, this is the 1D number.
const class FiniteElement * FE
The FiniteElement that created and owns this object.
int nqpt
Number of quadrature points. When mode is TENSOR, this is the 1D number.
Abstract class for all finite elements.
int dof
Number of degrees of freedom.
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
int GetDim() const
Returns the reference space dimension for the finite element.
const IntegrationRule & GetNodes() const
Get a const reference to the nodes of the element.
Array< DofToQuad * > dof2quad_array
Container for all DofToQuad objects created by the FiniteElement.
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.
static const DofToQuad & GetRaggedTensorDofToQuad(const FiniteElement &fe, const IntegrationRule &ir, DofToQuad::Mode mode, Array< DofToQuad * > &dof2quad_array)
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 const DofToQuad & GetRaggedTensorDofToQuad(const FiniteElement &fe, const IntegrationRule &ir, DofToQuad::Mode mode, Array< DofToQuad * > &dof2quad_array)
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.
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.
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...
Structure representing the matrices/tensors needed to evaluate (in reference space) the values,...
Array< int > inverse_map2d_mass
Array< int > forward_map3d_mass
Array< real_t > Ba1
Special basis function structures for positive (Bernstein) basis with partial assembly....
Array< int > inverse_map3d_mass
Array< real_t > Ga1
Special structures for gradients of positive basis with partial assembly. The gradient arrays exploit...
Array< int > forward_map2d_mass
Array< int > inverse_map3d_diff
Array< int > forward_map3d_diff
Array< int > inverse_map2d_diff
Array< int > forward_map2d_diff
Array< int > lex_map
Mapping from the Bernstein multi-index (a_1, ..., a_d) to the lexicographic dof index.
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)