17 #define snprintf _snprintf_s 29 error_mode = RETURN_NULL;
34 if (fe !=
nullptr) {
break; }
36 error_mode = save_error_mode;
105 MFEM_ABORT(
"unknown geometry type");
112 MFEM_ABORT(
"this method is not implemented in this derived class!");
120 if (!strcmp(name,
"Linear"))
124 else if (!strcmp(name,
"Quadratic"))
128 else if (!strcmp(name,
"QuadraticPos"))
132 else if (!strcmp(name,
"Cubic"))
136 else if (!strcmp(name,
"Const3D"))
140 else if (!strcmp(name,
"Const2D"))
144 else if (!strcmp(name,
"LinearDiscont2D"))
148 else if (!strcmp(name,
"GaussLinearDiscont2D"))
152 else if (!strcmp(name,
"P1OnQuad"))
156 else if (!strcmp(name,
"QuadraticDiscont2D"))
160 else if (!strcmp(name,
"QuadraticPosDiscont2D"))
164 else if (!strcmp(name,
"GaussQuadraticDiscont2D"))
168 else if (!strcmp(name,
"CubicDiscont2D"))
172 else if (!strcmp(name,
"LinearDiscont3D"))
176 else if (!strcmp(name,
"QuadraticDiscont3D"))
180 else if (!strcmp(name,
"LinearNonConf3D"))
184 else if (!strcmp(name,
"CrouzeixRaviart"))
188 else if (!strcmp(name,
"ND1_3D"))
192 else if (!strcmp(name,
"RT0_2D"))
196 else if (!strcmp(name,
"RT1_2D"))
200 else if (!strcmp(name,
"RT2_2D"))
204 else if (!strcmp(name,
"RT0_3D"))
208 else if (!strcmp(name,
"RT1_3D"))
212 else if (!strncmp(name,
"H1_Trace_", 9))
216 else if (!strncmp(name,
"H1_Trace@", 9))
221 else if (!strncmp(name,
"H1_", 3))
225 else if (!strncmp(name,
"H1Pos_Trace_", 12))
230 else if (!strncmp(name,
"H1Pos_", 6))
234 else if (!strncmp(name,
"H1Ser_", 6))
238 else if (!strncmp(name,
"H1@", 3))
243 else if (!strncmp(name,
"L2_T", 4))
246 else if (!strncmp(name,
"L2_", 3))
250 else if (!strncmp(name,
"L2Int_T", 7))
255 else if (!strncmp(name,
"L2Int_", 6))
261 else if (!strncmp(name,
"RT_Trace_", 9))
265 else if (!strncmp(name,
"RT_ValTrace_", 12))
270 else if (!strncmp(name,
"RT_Trace@", 9))
276 else if (!strncmp(name,
"RT_ValTrace@", 12))
282 else if (!strncmp(name,
"DG_Iface_", 9))
286 else if (!strncmp(name,
"DG_Iface@", 9))
292 else if (!strncmp(name,
"DG_IntIface_", 12))
297 else if (!strncmp(name,
"DG_IntIface@", 12))
303 else if (!strncmp(name,
"RT_", 3))
307 else if (!strncmp(name,
"RT@", 3))
313 else if (!strncmp(name,
"ND_Trace_", 9))
317 else if (!strncmp(name,
"ND_Trace@", 9))
323 else if (!strncmp(name,
"ND_", 3))
327 else if (!strncmp(name,
"ND@", 3))
333 else if (!strncmp(name,
"Local_", 6))
337 else if (!strncmp(name,
"NURBS", 5))
352 MFEM_ABORT(
"unknown FiniteElementCollection: " << name);
354 MFEM_VERIFY(!strcmp(fec->
Name(), name),
"input name: \"" << name
355 <<
"\" does not match the created collection name: \"" 356 << fec->
Name() <<
'"');
364 MFEM_ABORT(
"Collection " << Name() <<
" does not support variable orders.");
371 if (
p >= var_orders.Size())
373 var_orders.SetSize(
p+1, NULL);
375 var_orders[
p] = Clone(
p);
380 for (
int i = 0; i < var_orders.Size(); i++)
382 delete var_orders[i];
386 template <Geometry::Type geom>
391 nv = g_consts::NumVert;
392 ne = g_consts::NumEdges;
395 template <Geometry::Type geom,
typename v_t>
397 GetEdge(
int &nv, v_t &v,
int &ne,
int &e,
int &eo,
const int edge_info)
402 nv = e_consts::NumVert;
406 MFEM_ASSERT(0 <= e && e < g_consts::NumEdges,
"");
407 MFEM_ASSERT(0 <= eo && eo < e_consts::NumOrient,
"");
408 v[0] = e_consts::Orient[eo][0];
409 v[1] = e_consts::Orient[eo][1];
410 v[0] = g_consts::Edges[e][v[0]];
411 v[1] = g_consts::Edges[e][v[1]];
415 typename v_t,
typename e_t,
typename eo_t>
417 GetFace(
int &nv, v_t &v,
int &ne, e_t &e, eo_t &eo,
423 nv = f_consts::NumVert;
428 MFEM_ASSERT(0 <=
f &&
f < g_consts::NumFaces,
"");
429 MFEM_ASSERT(0 <= fo && fo < f_consts::NumOrient,
"");
430 for (
int i = 0; i < f_consts::NumVert; i++)
432 v[i] = f_consts::Orient[fo][i];
433 v[i] = g_consts::FaceVert[
f][v[i]];
435 ne = f_consts::NumEdges;
436 for (
int i = 0; i < f_consts::NumEdges; i++)
438 int v0 = v[f_consts::Edges[i][0]];
439 int v1 = v[f_consts::Edges[i][1]];
441 if (v0 > v1) { swap(v0, v1); eor = 1; }
442 for (
int j = g_consts::VertToVert::I[v0];
true; j++)
444 MFEM_ASSERT(j < g_consts::VertToVert::I[v0+1],
445 "internal error, edge not found");
446 if (v1 == g_consts::VertToVert::J[j][0])
448 int en = g_consts::VertToVert::J[j][1];
468 "invalid Geom = " << Geom);
470 "invalid SDim = " << SDim <<
476 const int off = nvd*(Info/64);
478 for (
int i = 0; i < nvd; i++)
485 int v[4], e[4], eo[4],
f[1], fo[1];
486 int av = 0, nv = 0, ae = 0, ne = 0, nf = 0;
493 GetNVE<Geometry::SEGMENT>(av, ae);
494 GetEdge<Geometry::SEGMENT>(nv, v, ne, e[0], eo[0], Info);
500 GetNVE<Geometry::TRIANGLE>(av, ae);
504 GetEdge<Geometry::TRIANGLE>(nv, v, ne, e[0], eo[0], Info);
507 GetFace<Geometry::TRIANGLE,Geometry::TRIANGLE>(
508 nv, v, ne, e, eo, nf,
f[0], fg[0], fo[0], Info);
518 GetNVE<Geometry::SQUARE>(av, ae);
522 GetEdge<Geometry::SQUARE>(nv, v, ne, e[0], eo[0], Info);
525 GetFace<Geometry::SQUARE,Geometry::SQUARE>(
526 nv, v, ne, e, eo, nf,
f[0], fg[0], fo[0], Info);
536 GetNVE<Geometry::TETRAHEDRON>(av, ae);
540 GetEdge<Geometry::TETRAHEDRON>(nv, v, ne, e[0], eo[0], Info);
543 GetFace<Geometry::TETRAHEDRON,Geometry::TRIANGLE>(
544 nv, v, ne, e, eo, nf,
f[0], fg[0], fo[0], Info);
554 GetNVE<Geometry::CUBE>(av, ae);
558 GetEdge<Geometry::CUBE>(nv, v, ne, e[0], eo[0], Info);
561 GetFace<Geometry::CUBE,Geometry::SQUARE>(
562 nv, v, ne, e, eo, nf,
f[0], fg[0], fo[0], Info);
571 MFEM_ABORT(
"invalid Geom = " << Geom);
578 for (
int i = 0; i < nv; i++)
580 for (
int j = 0; j < nvd; j++)
582 dofs[i*nvd+j] = v[i]*nvd+j;
585 int l_off = nv*nvd, g_off = av*nvd;
590 for (
int i = 0; i < ne; i++)
594 for (
int j = 0; j < ned; j++)
596 dofs[l_off+i*ned+j] =
598 g_off+e[i]*ned+ed[j] :
599 -1-(g_off+e[i]*ned+(-1-ed[j]));
609 const int nfd = DofForGeometry(fg[0]);
611 for (
int i = 0; i < nf; i++)
613 const int *fd = DofOrderForOrientation(fg[i], fo[i]);
614 for (
int j = 0; j < nfd; j++)
616 dofs[l_off+i*nfd+j] =
618 g_off+
f[i]*nfd+fd[j] :
619 -1-(g_off+
f[i]*nfd+(-1-fd[j]));
630 ", SDim = " << SDim <<
" is not supported");
647 if (error_mode == RETURN_NULL) {
return nullptr; }
648 mfem_error (
"LinearFECollection: unknown geometry type.");
666 mfem_error (
"LinearFECollection: unknown geometry type.");
691 if (error_mode == RETURN_NULL) {
return nullptr; }
692 mfem_error (
"QuadraticFECollection: unknown geometry type.");
709 mfem_error (
"QuadraticFECollection: unknown geometry type.");
717 static int indexes[] = { 0 };
732 if (error_mode == RETURN_NULL) {
return nullptr; }
733 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
746 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
754 static int indexes[] = { 0 };
773 if (error_mode == RETURN_NULL) {
return nullptr; }
774 mfem_error (
"CubicFECollection: unknown geometry type.");
791 mfem_error (
"CubicFECollection: unknown geometry type.");
801 static int ind_pos[] = { 0, 1 };
802 static int ind_neg[] = { 1, 0 };
812 static int indexes[] = { 0 };
818 static int sq_ind[8][4] = {{0, 1, 2, 3}, {0, 2, 1, 3},
819 {2, 0, 3, 1}, {1, 0, 3, 2},
820 {3, 2, 1, 0}, {3, 1, 2, 0},
821 {1, 3, 0, 2}, {2, 3, 0, 1}
840 if (error_mode == RETURN_NULL) {
return nullptr; }
841 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
855 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
863 static int indexes[] = { 0 };
878 if (error_mode == RETURN_NULL) {
return nullptr; }
879 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
893 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
901 static int ind_pos[] = { 0 };
902 static int ind_neg[] = { -1 };
921 if (error_mode == RETURN_NULL) {
return nullptr; }
922 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
936 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
944 static int ind_pos[] = { 0, 1 };
945 static int ind_neg[] = { -2, -1 };
963 if (error_mode == RETURN_NULL) {
return nullptr; }
964 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
978 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
986 static int ind_pos[] = { 0, 1, 2 };
987 static int ind_neg[] = { -3, -2, -1 };
1005 if (error_mode == RETURN_NULL) {
return nullptr; }
1006 mfem_error (
"Const2DFECollection: unknown geometry type.");
1020 mfem_error (
"Const2DFECollection: unknown geometry type.");
1041 if (error_mode == RETURN_NULL) {
return nullptr; }
1042 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
1056 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
1077 if (error_mode == RETURN_NULL) {
return nullptr; }
1078 mfem_error (
"GaussLinearDiscont2DFECollection:" 1079 " unknown geometry type.");
1094 mfem_error (
"GaussLinearDiscont2DFECollection:" 1095 " unknown geometry type.");
1112 if (error_mode == RETURN_NULL) {
return nullptr; }
1113 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
1126 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
1147 if (error_mode == RETURN_NULL) {
return nullptr; }
1148 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1163 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1183 if (error_mode == RETURN_NULL) {
return nullptr; }
1184 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1198 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1214 if (error_mode == RETURN_NULL) {
return nullptr; }
1215 mfem_error (
"GaussQuadraticDiscont2DFECollection:" 1216 " unknown geometry type.");
1231 mfem_error (
"GaussQuadraticDiscont2DFECollection:" 1232 " unknown geometry type.");
1253 if (error_mode == RETURN_NULL) {
return nullptr; }
1254 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1268 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1291 if (error_mode == RETURN_NULL) {
return nullptr; }
1292 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1308 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1316 static int indexes[] = { 0 };
1332 if (error_mode == RETURN_NULL) {
return nullptr; }
1333 mfem_error (
"Const3DFECollection: unknown geometry type.");
1351 mfem_error (
"Const3DFECollection: unknown geometry type.");
1374 if (error_mode == RETURN_NULL) {
return nullptr; }
1375 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1393 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1414 if (error_mode == RETURN_NULL) {
return nullptr; }
1415 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1432 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1456 if (error_mode == RETURN_NULL) {
return nullptr; }
1457 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1473 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1481 static int indexes[] = { 0 };
1497 if (error_mode == RETURN_NULL) {
return nullptr; }
1498 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1516 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1524 static int ind_pos[] = { 0 };
1525 static int ind_neg[] = { -1 };
1547 if (error_mode == RETURN_NULL) {
return nullptr; }
1548 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1566 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1574 static int ind_pos[] = { 0 };
1575 static int ind_neg[] = { -1 };
1597 if (error_mode == RETURN_NULL) {
return nullptr; }
1598 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1613 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1623 static int sq_ind[8][4] =
1625 {0, 1, 2, 3}, {-1, -3, -2, -4},
1626 {2, 0, 3, 1}, {-2, -1, -4, -3},
1627 {3, 2, 1, 0}, {-4, -2, -3, -1},
1628 {1, 3, 0, 2}, {-3, -4, -1, -2}
1644 MFEM_VERIFY(
p >= 1,
"H1_FECollection requires order >= 1.");
1645 MFEM_VERIFY(
dim >= 0 &&
dim <= 3,
"H1_FECollection requires 0 <= dim <= 3.");
1647 const int pm1 =
p - 1, pm2 = pm1 - 1, pm3 = pm2 - 1, pm4 = pm3 - 1;
1674 snprintf(
h1_name, 32,
"H1@%c_%dD_P%d",
1684 for (
int i = 0; i < 2; i++)
1688 for (
int i = 0; i < 6; i++)
1692 for (
int i = 0; i < 8; i++)
1696 for (
int i = 0; i < 24; i++)
1716 SegDofOrd[0] = (pm1 > 0) ?
new int[2*pm1] :
nullptr;
1718 for (
int i = 0; i < pm1; i++)
1754 TriDofOrd[0] = (TriDof > 0) ?
new int[6*TriDof] :
nullptr;
1755 for (
int i = 1; i < 6; i++)
1760 for (
int j = 0; j < pm2; j++)
1762 for (
int i = 0; i + j < pm2; i++)
1764 int o = TriDof - ((pm1 - j)*(pm2 - j))/2 + i;
1765 int k = pm3 - j - i;
1767 TriDofOrd[1][o] = TriDof - ((pm1-j)*(pm2-j))/2 + k;
1768 TriDofOrd[2][o] = TriDof - ((pm1-i)*(pm2-i))/2 + k;
1769 TriDofOrd[3][o] = TriDof - ((pm1-k)*(pm2-k))/2 + i;
1770 TriDofOrd[4][o] = TriDof - ((pm1-k)*(pm2-k))/2 + j;
1771 TriDofOrd[5][o] = TriDof - ((pm1-i)*(pm2-i))/2 + j;
1775 QuadDofOrd[0] = (QuadDof > 0) ?
new int[8*QuadDof] :
nullptr;
1776 for (
int i = 1; i < 8; i++)
1799 for (
int j = 0; j < pm3; j++)
1801 for (
int i = 0; i < pm3; i++)
1808 QuadDofOrd[4][o] = (pm4 - i) + (pm4 - j)*pm3;
1809 QuadDofOrd[5][o] = (pm4 - j) + (pm4 - i)*pm3;
1819 for (
int j = 0; j < pm1; j++)
1821 for (
int i = 0; i < pm1; i++)
1828 QuadDofOrd[4][o] = (pm2 - i) + (pm2 - j)*pm1;
1829 QuadDofOrd[5][o] = (pm2 - j) + (pm2 - i)*pm1;
1858 TetDofOrd[0] = (TetDof > 0) ?
new int[24*TetDof] :
nullptr;
1859 for (
int i = 1; i < 24; i++)
1864 for (
int k = 0; k < pm3; k++)
1866 for (
int j = 0; j + k < pm3; j++)
1868 for (
int i = 0; i + j + k < pm3; i++)
1870 int l = pm4 - k - j - i;
1871 int o = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1872 + (j * (2 *
p - 5 - j - 2 * k)) / 2 + i;
1873 int o1 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1874 + (k * (2 *
p - 5 - k - 2 * j)) / 2 + i;
1875 int o2 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1876 + (k * (2 *
p - 5 - k - 2 * i)) / 2 + j;
1877 int o3 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1878 + (i * (2 *
p - 5 - i - 2 * k)) / 2 + j;
1879 int o4 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1880 + (i * (2 *
p - 5 - i - 2 * j)) / 2 + k;
1881 int o5 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1882 + (j * (2 *
p - 5 - j - 2 * i)) / 2 + k;
1883 int o6 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1884 + (l * (2 *
p - 5 - l - 2 * k)) / 2 + j;
1885 int o7 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1886 + (k * (2 *
p - 5 - k - 2 * l)) / 2 + j;
1887 int o8 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1888 + (j * (2 *
p - 5 - j - 2 * l)) / 2 + k;
1889 int o9 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1890 + (l * (2 *
p - 5 - l - 2 * j)) / 2 + k;
1891 int o10 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1892 + (k * (2 *
p - 5 - k - 2 * j)) / 2 + l;
1893 int o11 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1894 + (j * (2 *
p - 5 - j - 2 * k)) / 2 + l;
1895 int o12 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1896 + (l * (2 *
p - 5 - l - 2 * i)) / 2 + k;
1897 int o13 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1898 + (i * (2 *
p - 5 - i - 2 * l)) / 2 + k;
1899 int o14 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1900 + (i * (2 *
p - 5 - i - 2 * k)) / 2 + l;
1901 int o15 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1902 + (k * (2 *
p - 5 - k - 2 * i)) / 2 + l;
1903 int o16 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1904 + (k * (2 *
p - 5 - k - 2 * l)) / 2 + i;
1905 int o17 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1906 + (l * (2 *
p - 5 - l - 2 * k)) / 2 + i;
1907 int o18 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1908 + (j * (2 *
p - 5 - j - 2 * i)) / 2 + l;
1909 int o19 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1910 + (i * (2 *
p - 5 - i - 2 * j)) / 2 + l;
1911 int o20 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1912 + (l * (2 *
p - 5 - l - 2 * j)) / 2 + i;
1913 int o21 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1914 + (j * (2 *
p - 5 - j - 2 * l)) / 2 + i;
1915 int o22 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1916 + (i * (2 *
p - 5 - i - 2 * l)) / 2 + j;
1917 int o23 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1918 + (l * (2 *
p - 5 - l - 2 * i)) / 2 + j;
1960 MFEM_ABORT(
"H1 Pyramid basis functions are not yet supported " 1992 if (!strncmp(
h1_name,
"H1_", 3))
1996 else if (!strncmp(
h1_name,
"H1Pos_", 6))
2000 else if (!strncmp(
h1_name,
"H1@", 3))
2009 const int *dof_map = NULL;
2019 MFEM_ABORT(
"Geometry type " <<
Geometry::Name[GeomType] <<
" is not " 2051 snprintf(
h1_name, 32,
"H1_Trace_%dD_P%d",
dim,
p);
2055 snprintf(
h1_name, 32,
"H1Pos_Trace_%dD_P%d",
dim,
p);
2059 snprintf(
h1_name, 32,
"H1_Trace@%c_%dD_P%d",
2071 MFEM_VERIFY(
p >= 0,
"L2_FECollection requires order >= 0.");
2074 const char *prefix = NULL;
2080 MFEM_ABORT(
"invalid map_type: " << map_type);
2085 snprintf(d_name, 32,
"%s_%dD_P%d", prefix,
dim,
p);
2088 snprintf(d_name, 32,
"%s_T%d_%dD_P%d", prefix, btype,
dim,
p);
2093 L2_Elements[g] = NULL;
2094 Tr_Elements[g] = NULL;
2096 for (
int i = 0; i < 2; i++)
2098 SegDofOrd[i] = NULL;
2100 for (
int i = 0; i < 6; i++)
2102 TriDofOrd[i] = NULL;
2104 for (
int i = 0; i < 24; i++)
2106 TetDofOrd[i] = NULL;
2129 const int pp1 =
p + 1;
2130 SegDofOrd[0] = (pp1 > 0) ?
new int[2*pp1] :
nullptr;
2131 SegDofOrd[1] = SegDofOrd[0] + pp1;
2132 for (
int i = 0; i <=
p; i++)
2134 SegDofOrd[0][i] = i;
2135 SegDofOrd[1][i] =
p - i;
2163 TriDofOrd[0] = (TriDof > 0) ?
new int[6*TriDof] :
nullptr;
2164 for (
int i = 1; i < 6; i++)
2166 TriDofOrd[i] = TriDofOrd[i-1] + TriDof;
2168 const int pp1 =
p + 1, pp2 = pp1 + 1;
2169 for (
int j = 0; j <=
p; j++)
2171 for (
int i = 0; i + j <=
p; i++)
2173 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
2175 TriDofOrd[0][o] = o;
2176 TriDofOrd[1][o] = TriDof - ((pp2-j)*(pp1-j))/2 + k;
2177 TriDofOrd[2][o] = TriDof - ((pp2-i)*(pp1-i))/2 + k;
2178 TriDofOrd[3][o] = TriDof - ((pp2-k)*(pp1-k))/2 + i;
2179 TriDofOrd[4][o] = TriDof - ((pp2-k)*(pp1-k))/2 + j;
2180 TriDofOrd[5][o] = TriDof - ((pp2-i)*(pp1-i))/2 + j;
2184 OtherDofOrd = (QuadDof > 0) ?
new int[QuadDof] :
nullptr;
2185 for (
int j = 0; j < QuadDof; j++)
2226 const int MaxDof = std::max(TetDof, std::max(PriDof, HexDof));
2228 TetDofOrd[0] = (TetDof > 0) ?
new int[24*TetDof] :
nullptr;
2229 for (
int i = 1; i < 24; i++)
2231 TetDofOrd[i] = TetDofOrd[i-1] + TetDof;
2234 const int pp1 =
p + 1, pp2 = pp1 + 1, pp3 = pp2 + 1;
2235 for (
int k = 0; k <=
p; k++)
2237 for (
int j = 0; j + k <=
p; j++)
2239 for (
int i = 0; i + j + k <=
p; i++)
2241 int l =
p - k - j - i;
2242 int o = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2243 + (j * (2 *
p + 3 - j - 2 * k)) / 2 + i;
2244 int o1 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2245 + (k * (2 *
p + 3 - k - 2 * j)) / 2 + i;
2246 int o2 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2247 + (k * (2 *
p + 3 - k - 2 * i)) / 2 + j;
2248 int o3 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2249 + (i * (2 *
p + 3 - i - 2 * k)) / 2 + j;
2250 int o4 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2251 + (i * (2 *
p + 3 - i - 2 * j)) / 2 + k;
2252 int o5 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2253 + (j * (2 *
p + 3 - j - 2 * i)) / 2 + k;
2254 int o6 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2255 + (l * (2 *
p + 3 - l - 2 * k)) / 2 + j;
2256 int o7 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2257 + (k * (2 *
p + 3 - k - 2 * l)) / 2 + j;
2258 int o8 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2259 + (j * (2 *
p + 3 - j - 2 * l)) / 2 + k;
2260 int o9 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2261 + (l * (2 *
p + 3 - l - 2 * j)) / 2 + k;
2262 int o10 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2263 + (k * (2 *
p + 3 - k - 2 * j)) / 2 + l;
2264 int o11 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2265 + (j * (2 *
p + 3 - j - 2 * k)) / 2 + l;
2266 int o12 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2267 + (l * (2 *
p + 3 - l - 2 * i)) / 2 + k;
2268 int o13 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2269 + (i * (2 *
p + 3 - i - 2 * l)) / 2 + k;
2270 int o14 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2271 + (i * (2 *
p + 3 - i - 2 * k)) / 2 + l;
2272 int o15 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2273 + (k * (2 *
p + 3 - k - 2 * i)) / 2 + l;
2274 int o16 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2275 + (k * (2 *
p + 3 - k - 2 * l)) / 2 + i;
2276 int o17 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2277 + (l * (2 *
p + 3 - l - 2 * k)) / 2 + i;
2278 int o18 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2279 + (j * (2 *
p + 3 - j - 2 * i)) / 2 + l;
2280 int o19 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2281 + (i * (2 *
p + 3 - i - 2 * j)) / 2 + l;
2282 int o20 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2283 + (l * (2 *
p + 3 - l - 2 * j)) / 2 + i;
2284 int o21 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2285 + (j * (2 *
p + 3 - j - 2 * l)) / 2 + i;
2286 int o22 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2287 + (i * (2 *
p + 3 - i - 2 * l)) / 2 + j;
2288 int o23 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2289 + (l * (2 *
p + 3 - l - 2 * i)) / 2 + j;
2290 TetDofOrd[ 0][o] = o;
2291 TetDofOrd[ 1][o] = o1;
2292 TetDofOrd[ 2][o] = o2;
2293 TetDofOrd[ 3][o] = o3;
2294 TetDofOrd[ 4][o] = o4;
2295 TetDofOrd[ 5][o] = o5;
2296 TetDofOrd[ 6][o] = o6;
2297 TetDofOrd[ 7][o] = o7;
2298 TetDofOrd[ 8][o] = o8;
2299 TetDofOrd[ 9][o] = o9;
2300 TetDofOrd[10][o] = o10;
2301 TetDofOrd[11][o] = o11;
2302 TetDofOrd[12][o] = o12;
2303 TetDofOrd[13][o] = o13;
2304 TetDofOrd[14][o] = o14;
2305 TetDofOrd[15][o] = o15;
2306 TetDofOrd[16][o] = o16;
2307 TetDofOrd[17][o] = o17;
2308 TetDofOrd[18][o] = o18;
2309 TetDofOrd[19][o] = o19;
2310 TetDofOrd[20][o] = o20;
2311 TetDofOrd[21][o] = o21;
2312 TetDofOrd[22][o] = o22;
2313 TetDofOrd[23][o] = o23;
2317 OtherDofOrd = (MaxDof > 0) ?
new int[MaxDof] :
nullptr;
2318 for (
int j = 0; j < MaxDof; j++)
2325 mfem::err <<
"L2_FECollection::L2_FECollection : dim = " 2336 return L2_Elements[GeomType];
2341 MFEM_ABORT(
"L2 Pyramid basis functions are not yet supported " 2353 return (Or > 0) ? SegDofOrd[0] : SegDofOrd[1];
2356 return TriDofOrd[Or%6];
2359 return TetDofOrd[Or%24];
2362 return (Or == 0) ? OtherDofOrd : NULL;
2368 delete [] OtherDofOrd;
2369 delete [] SegDofOrd[0];
2370 delete [] TriDofOrd[0];
2371 delete [] TetDofOrd[0];
2374 delete L2_Elements[i];
2375 delete Tr_Elements[i];
2381 const int cb_type,
const int ob_type)
2388 MFEM_VERIFY(
p >= 0,
"RT_FECollection requires order >= 0.");
2396 MFEM_ABORT(
"unknown closed BasisType: " << cb_name);
2402 MFEM_ABORT(
"unknown open BasisType: " << ob_name);
2418 const int pp1 =
p + 1;
2447 MFEM_ABORT(
"invalid dim = " <<
dim);
2454 const int map_type,
const bool signs,
2463 MFEM_ABORT(
"Invalid open basis type: " << ob_name);
2475 "invalid open point type");
2477 const int pp1 =
p + 1, pp2 =
p + 2;
2485 for (
int i = 0; i < 2; i++)
2489 for (
int i = 0; i < 6; i++)
2493 for (
int i = 0; i < 8; i++)
2505 SegDofOrd[0] = (pp1 > 0) ?
new int[2*pp1] :
nullptr;
2507 for (
int i = 0; i <=
p; i++)
2510 SegDofOrd[1][i] = signs ? (-1 - (
p - i)) : (
p - i);
2526 TriDofOrd[0] = (TriDof > 0) ?
new int[6*TriDof] :
nullptr;
2527 for (
int i = 1; i < 6; i++)
2533 for (
int j = 0; j <=
p; j++)
2535 for (
int i = 0; i + j <=
p; i++)
2537 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
2540 TriDofOrd[1][o] = -1-(TriDof-((pp2-j)*(pp1-j))/2+k);
2541 TriDofOrd[2][o] = TriDof-((pp2-i)*(pp1-i))/2+k;
2542 TriDofOrd[3][o] = -1-(TriDof-((pp2-k)*(pp1-k))/2+i);
2543 TriDofOrd[4][o] = TriDof-((pp2-k)*(pp1-k))/2+j;
2544 TriDofOrd[5][o] = -1-(TriDof-((pp2-i)*(pp1-i))/2+j);
2547 for (
int kk = 1; kk < 6; kk += 2)
2556 QuadDofOrd[0] = (QuadDof > 0) ?
new int[8*QuadDof] :
nullptr;
2557 for (
int i = 1; i < 8; i++)
2562 for (
int j = 0; j <=
p; j++)
2564 for (
int i = 0; i <=
p; i++)
2577 for (
int k = 1; k < 8; k += 2)
2597 MFEM_ABORT(
"RT Pyramid basis functions are not yet supported " 2624 if (!strncmp(
rt_name,
"RT_", 3))
2655 const char *prefix =
2657 char ob_str[3] = {
'\0',
'\0',
'\0' };
2664 snprintf(
rt_name, 32,
"%s%s_%dD_P%d", prefix, ob_str,
dim,
p);
2666 MFEM_VERIFY(
dim == 2 ||
dim == 3,
"Wrong dimension, dim = " <<
dim);
2675 MFEM_VERIFY(
dim == 2 ||
dim == 3,
"Wrong dimension, dim = " <<
dim);
2677 const char *prefix =
2681 snprintf(
rt_name, 32,
"%s_%dD_P%d", prefix,
dim,
p);
2685 snprintf(
rt_name, 32,
"%s@%c_%dD_P%d", prefix,
2691 const int cb_type,
const int ob_type)
2697 MFEM_VERIFY(
p >= 1,
"ND_FECollection requires order >= 1.");
2698 MFEM_VERIFY(
dim >= 1 &&
dim <= 3,
"ND_FECollection requires 1 <= dim <= 3.");
2700 const int pm1 =
p - 1, pm2 =
p - 2;
2718 for (
int i = 0; i < 2; i++)
2722 for (
int i = 0; i < 6; i++)
2726 for (
int i = 0; i < 8; i++)
2739 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
2744 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
2754 for (
int i = 0; i <
p; i++)
2772 QuadDofOrd[0] = (QuadDof > 0) ?
new int[8*QuadDof] :
nullptr;
2773 for (
int i = 1; i < 8; i++)
2778 for (
int j = 0; j < pm1; j++)
2780 for (
int i = 0; i <
p; i++)
2783 int d2 =
p*pm1 + j + i*pm1;
2793 QuadDofOrd[2][d1] = -1 - (
p*pm1 + j + (pm1 - i)*pm1);
2799 QuadDofOrd[4][d1] = -1 - ((pm1 - i) + (pm2 - j)*
p);
2800 QuadDofOrd[4][d2] = -1 - (
p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2802 QuadDofOrd[5][d1] = -1 - (
p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2803 QuadDofOrd[5][d2] = -1 - ((pm1 - i) + (pm2 - j)*
p);
2811 QuadDofOrd[7][d2] = -1 - (
p*pm1 + j + (pm1 - i)*pm1);
2816 TriDofOrd[0] = (TriDof > 0) ?
new int[6*TriDof] :
nullptr;
2817 for (
int i = 1; i < 6; i++)
2823 for (
int j = 0; j <= pm2; j++)
2825 for (
int i = 0; i + j <= pm2; i++)
2827 int k0 =
p*pm1 - (
p - j)*(pm1 - j) + 2*i;
2828 int k1 = 2*pm2 - 2*i + ((2*
p-3)-j)*j;
2829 int k2 = 2*pm2 - 2*j + ((2*
p-3)-i)*i;
2830 int k3 =
p*pm1 - 2 - 3*j - i - (i+j)*(i+j);
2831 int k4 =
p*pm1 - 2 - 3*i - j - (i+j)*(i+j);
2832 int k5 =
p*pm1 - (
p - i)*(pm1 - i) + 2*j;
2883 MFEM_ABORT(
"ND Pyramid basis functions are not yet supported " 2922 int tr_p, tr_dim, tr_cb_type, tr_ob_type;
2960 snprintf(
nd_name, 32,
"ND_Trace_%dD_P%d",
dim,
p);
2964 snprintf(
nd_name, 32,
"ND_Trace@%c%c_%dD_P%d",
2972 const int cb_type,
const int ob_type)
2975 MFEM_VERIFY(
p >= 1,
"ND_R1D_FECollection requires order >= 1.");
2976 MFEM_VERIFY(
dim == 1,
"ND_R1D_FECollection requires dim == 1.");
2985 snprintf(
nd_name, 32,
"ND_R1D@%c%c_%dD_P%d",
3003 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
3008 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
3041 const int cb_type,
const int ob_type)
3044 MFEM_VERIFY(
p >= 0,
"RT_R1D_FECollection requires order >= 0.");
3045 MFEM_VERIFY(
dim == 1,
"RT_R1D_FECollection requires dim == 1.");
3054 snprintf(
rt_name, 32,
"RT_R1D@%c%c_%dD_P%d",
3072 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
3077 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
3097 MFEM_ABORT(
"this method is not implemented in RT_R1D_FECollection!");
3111 const int cb_type,
const int ob_type)
3114 MFEM_VERIFY(
p >= 1,
"ND_R2D_FECollection requires order >= 1.");
3115 MFEM_VERIFY(
dim >= 1 &&
dim <= 2,
3116 "ND_R2D_FECollection requires 1 <= dim <= 2.");
3118 const int pm1 =
p - 1, pm2 =
p - 2;
3127 snprintf(
nd_name, 32,
"ND_R2D@%c%c_%dD_P%d",
3137 for (
int i = 0; i < 2; i++)
3149 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
3154 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
3166 SegDofOrd[0] = (4*
p > 2) ?
new int[4 *
p - 2] :
nullptr;
3168 for (
int i = 0; i <
p; i++)
3173 for (
int i = 0; i < pm1; i++)
3205 int p,
dim, cb_type, ob_type;
3241 snprintf(
nd_name, 32,
"ND_R2D_Trace_%dD_P%d",
dim,
p);
3245 snprintf(
nd_name, 32,
"ND_R2D_Trace@%c%c_%dD_P%d",
3253 const int cb_type,
const int ob_type)
3257 MFEM_VERIFY(
p >= 0,
"RT_R2D_FECollection requires order >= 0.");
3258 MFEM_VERIFY(
dim >= 1 &&
dim <= 2,
3259 "RT_R2D_FECollection requires 1 <= dim <= 2.");
3267 MFEM_ABORT(
"unknown closed BasisType: " << cb_name);
3272 MFEM_ABORT(
"unknown open BasisType: " << ob_name);
3284 snprintf(
rt_name, 32,
"RT_R2D@%c%c_%dD_P%d",
3289 const int pp1 =
p + 1;
3290 const int pp2 =
p + 2;
3309 const bool signs,
const int ob_type)
3316 MFEM_ABORT(
"Invalid open basis type: " << ob_name);
3328 "invalid open point type");
3330 const int pp1 =
p + 1;
3338 for (
int i = 0; i < 2; i++)
3350 SegDofOrd[0] = (pp1 > 0) ?
new int[2*pp1] :
nullptr;
3352 for (
int i = 0; i <=
p; i++)
3355 SegDofOrd[1][i] = signs ? (-1 - (
p - i)) : (
p - i);
3373 if (!strncmp(
rt_name,
"RT_R2D_", 7))
3401 const char *prefix =
3403 char ob_str[3] = {
'\0',
'\0',
'\0' };
3410 snprintf(
rt_name, 32,
"%s%s_%dD_P%d", prefix, ob_str,
dim,
p);
3412 MFEM_VERIFY(
dim == 2,
"Wrong dimension, dim = " <<
dim);
3418 snprintf(d_name, 32,
"Local_%s", fe_name);
3420 Local_Element = NULL;
3422 if (!strcmp(fe_name,
"BiCubic2DFiniteElement") ||
3423 !strcmp(fe_name,
"Quad_Q3"))
3428 else if (!strcmp(fe_name,
"Nedelec1HexFiniteElement") ||
3429 !strcmp(fe_name,
"Hex_ND1"))
3434 else if (!strncmp(fe_name,
"H1_", 3))
3439 else if (!strncmp(fe_name,
"H1Pos_", 6))
3444 else if (!strncmp(fe_name,
"L2_", 3))
3451 mfem::err <<
"Local_FECollection::Local_FECollection : fe_name = " 3475 snprintf(name, 16,
"NURBS%i", Order);
3479 snprintf(name, 16,
"NURBS");
3487 delete QuadrilateralFE;
3488 delete ParallelepipedFE;
3502 mfem_error (
"NURBSFECollection: unknown geometry type.");
3509 mfem_error(
"NURBSFECollection::DofForGeometry");
3516 mfem_error(
"NURBSFECollection::DofOrderForOrientation");
3522 MFEM_ABORT(
"NURBS finite elements can not be statically condensed!");
Abstract class for all finite elements.
Arbitrary order non-uniform rational B-splines (NURBS) finite elements.
A 0D Nedelec finite element for the boundary of a 1D domain.
H1_Trace_FECollection(const int p, const int dim, const int btype=BasisType::GaussLobatto)
Arbitrary order L2 elements in 3D on a wedge.
Arbitrary order Nedelec elements in 1D on a segment.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Piecewise-cubic discontinuous finite elements in 2D. This class is kept only for backward compatibili...
Version of QuadraticDiscont2DFECollection with dofs in the Gaussian points.
BiLinear2DFiniteElement QuadrilateralFE
int RT_dof[Geometry::NumGeom]
FiniteElement * ND_Elements[Geometry::NumGeom]
void SubDofOrder(Geometry::Type Geom, int SDim, int Info, Array< int > &dofs) const
Get the local dofs for a given sub-manifold.
FiniteElementCollection * GetTraceCollection() const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
static int Check(int b_type)
If the input does not represents a valid BasisType, abort with an error; otherwise return the input...
int RT_dof[Geometry::NumGeom]
Arbitrary order L2 elements in 2D utilizing the Bernstein basis on a triangle.
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual ~NURBSFECollection()
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
OutStream err(std::cerr)
Global stream used by the library for standard error output. Initially it uses the same std::streambu...
RT_FECollection(const int p, const int dim, const int map_type, const bool signs, const int ob_type=BasisType::GaussLegendre)
Arbitrary order L2 elements in 2D on a triangle.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
ErrorMode
How to treat errors in FiniteElementForGeometry() calls.
Linear1DFiniteElement SegmentFE
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Arbitrary order Nedelec 3D elements in 2D on a square.
class LinearPyramidFiniteElement PyramidFE
virtual int DofForGeometry(Geometry::Type GeomType) const
A 3D 1st order Nedelec element on a pyramid.
Arbitrary order L2 elements in 3D on a cube.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual ~L2_FECollection()
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Arbitrary order L2 elements in 1D utilizing the Bernstein basis on a segment.
int GetOrder() const
Return the order (polynomial degree) of the FE collection, corresponding to the order/degree returned...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
T * GetData()
Returns the data.
Arbitrary order H1 elements in 2D on a square.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Piecewise-(bi/tri)linear continuous finite elements.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
A 0D point finite element.
Arbitrary order 3D H(curl)-trace finite elements in 2D defined on the interface between mesh elements...
static int GetQuadrature1D(int b_type)
Get the corresponding Quadrature1D constant, when that makes sense; otherwise return Quadrature1D::In...
Arbitrary order Nedelec elements in 3D on a tetrahedron.
Arbitrary order 3D H(curl)-conforming Nedelec finite elements in 2D.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Arbitrary order, three component, Raviart-Thomas elements in 1D on a segment.
virtual ~RT_R2D_FECollection()
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
TriLinear3DFiniteElement HexahedronFE
const int base_p
Order as returned by GetOrder().
Second order Raviart-Thomas finite elements in 2D. This class is kept only for backward compatibility...
void InitFaces(const int p, const int dim, const int map_type, const bool signs)
Arbitrary order, three component, Nedelec elements in 1D on a segment.
DG_Interface_FECollection(const int p, const int dim, const int map_type=FiniteElement::VALUE, const int ob_type=BasisType::GaussLegendre)
virtual int DofForGeometry(Geometry::Type GeomType) const
RT_R2D_FECollection(const int p, const int dim, const int map_type, const bool signs, const int ob_type=BasisType::GaussLegendre)
static const char * Name(int b_type)
Check and convert a BasisType constant to a string identifier.
A 2D bi-cubic element on a square with uniformly spaces nodes.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Arbitrary order Nedelec elements in 2D on a triangle.
static int GetType(char b_ident)
Convert char basis identifier to a BasisType constant.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
NURBSFECollection(int Order=VariableOrder)
The parameter Order must be either a positive number, for fixed order, or VariableOrder (default)...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
std::function< double(const Vector &)> f(double mass_coeff)
Arbitrary order Raviart-Thomas 3D elements in 2D on a triangle.
virtual int GetRangeType(int dim) const
virtual ~RT_FECollection()
Arbitrary order Raviart-Thomas 3D elements in 2D on a square.
L2_FECollection(const int p, const int dim, const int btype=BasisType::GaussLegendre, const int map_type=FiniteElement::VALUE)
virtual const FiniteElement * FiniteElementForDim(int dim) const
Returns the first non-NULL FiniteElement for the given dimension.
virtual FiniteElementCollection * Clone(int p) const
Instantiate a new collection of the same type with a different order.
Class for standard nodal finite elements.
Piecewise-(bi)cubic continuous finite elements.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Arbitrary order L2 elements in 2D utilizing the Bernstein basis on a square.
FiniteElementCollection * GetTraceCollection() const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual void SetMapType(int M)
Set the FiniteElement::MapType of the element to either VALUE or INTEGRAL. Also sets the FiniteElemen...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
int H1_dof[Geometry::NumGeom]
Arbitrary order L2 elements in 1D on a segment.
static void GetFace(int &nv, v_t &v, int &ne, e_t &e, eo_t &eo, int &nf, int &f, Geometry::Type &fg, int &fo, const int face_info)
FiniteElement * RT_Elements[Geometry::NumGeom]
virtual int DofForGeometry(Geometry::Type GeomType) const
static const int Dimension[NumGeom]
static void GetNVE(int &nv, int &ne)
FiniteElement * ND_Elements[Geometry::NumGeom]
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int GetDerivType(int dim) const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
Piecewise-linear discontinuous finite elements in 2D. This class is kept only for backward compatibil...
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
FiniteElement * ND_Elements[Geometry::NumGeom]
void mfem_error(const char *msg)
Function called when an error is encountered. Used by the macros MFEM_ABORT, MFEM_ASSERT, MFEM_VERIFY.
H1_FECollection(const int p, const int dim=3, const int btype=BasisType::GaussLobatto)
ND_Trace_FECollection(const int p, const int dim, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Arbitrary order "H^{1/2}-conforming" trace finite elements defined on the interface between mesh elem...
ND_R2D_Trace_FECollection(const int p, const int dim, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
ND_FECollection(const int p, const int dim, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
ErrorMode error_mode
How to treat errors in FiniteElementForGeometry() calls.
Discontinuous collection defined locally by a given finite element.
Arbitrary order H(curl)-trace finite elements defined on the interface between mesh elements (faces...
Version of QuadraticDiscont2DFECollection with positive basis functions.
virtual ~ND_FECollection()
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
RT_R1D_FECollection(const int p, const int dim, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual FiniteElementCollection * GetTraceCollection() const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
Array< FiniteElementCollection * > var_orders
Third order Raviart-Thomas finite elements in 2D. This class is kept only for backward compatibility...
PointFiniteElement PointFE
First order Raviart-Thomas finite elements in 3D. This class is kept only for backward compatibility...
virtual const char * Name() const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Version of QuadraticFECollection with positive basis functions.
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual ~H1_FECollection()
Piecewise-constant discontinuous finite elements in 3D. This class is kept only for backward compatib...
Arbitrary order H1 elements in 3D on a tetrahedron.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
int ND_dof[Geometry::NumGeom]
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Piecewise-constant discontinuous finite elements in 2D. This class is kept only for backward compatib...
FiniteElement * H1_Elements[Geometry::NumGeom]
static const char * Name[NumGeom]
Piecewise-linear nonconforming finite elements in 3D.
Arbitrary order H1 elements in 3D utilizing the Bernstein basis on a wedge.
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Crouzeix-Raviart nonconforming elements in 2D.
FiniteElement * RT_Elements[Geometry::NumGeom]
virtual int DofForGeometry(Geometry::Type GeomType) const
const Array< int > & GetLexicographicOrdering() const
Get an Array<int> that maps lexicographically ordered indices to the indices of the respective nodes/...
Arbitrary order H(div)-conforming Raviart-Thomas finite elements.
Arbitrary order L2 elements in 3D on a tetrahedron.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
static void GetEdge(int &nv, v_t &v, int &ne, int &e, int &eo, const int edge_info)
double p(const Vector &x, double t)
static int CheckClosed(int type)
If the Quadrature1D type is not closed return Invalid; otherwise return type.
Arbitrary order Raviart-Thomas elements in 3D on a tetrahedron.
int GetDerivType() const
Returns the FiniteElement::DerivType of the element describing the spatial derivative method implemen...
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Arbitrary order H1 elements in 3D utilizing the Bernstein basis on a cube.
ND_R1D_FECollection(const int p, const int dim, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
FiniteElementCollection * GetTraceCollection() const
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
Piecewise-quadratic discontinuous finite elements in 3D. This class is kept only for backward compati...
Arbitrary order L2 elements in 3D utilizing the Bernstein basis on a wedge.
Arbitrary order H1 elements in 3D on a cube.
FiniteElementCollection * GetTraceCollection() const
Serendipity basis (squares / cubes)
int GetDof() const
Returns the number of degrees of freedom in the finite element.
virtual int GetDerivMapType(int dim) const
MFEM_EXPORT class Linear3DFiniteElement TetrahedronFE
Arbitrary order Raviart-Thomas elements in 2D on a triangle.
MFEM_EXPORT Linear2DFiniteElement TriangleFE
static int CheckOpen(int type)
If the Quadrature1D type is not open return Invalid; otherwise return type.
void SetMapType(const int map_type_) override
Set the FiniteElement::MapType of the element to either VALUE or INTEGRAL. Also sets the FiniteElemen...
Integrated GLL indicator functions.
Version of LinearDiscont2DFECollection with dofs in the Gaussian points.
int GetDerivMapType() const
Returns the FiniteElement::DerivType of the element describing how reference function derivatives are...
ND_R2D_FECollection(const int p, const int dim, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
static FiniteElementCollection * New(const char *name)
Factory method: return a newly allocated FiniteElementCollection according to the given name...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
static char GetChar(int b_type)
Check and convert a BasisType constant to a char basis identifier.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Arbitrary order H1-conforming (continuous) finite elements with positive basis functions.
Lowest order Nedelec finite elements in 3D. This class is kept only for backward compatibility, consider using the new ND_FECollection instead.
FiniteElementCollection * GetTraceCollection() const
Arbitrary order Nedelec elements in 2D on a square.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
static bool IsTensorProduct(Type geom)
virtual int DofForGeometry(Geometry::Type GeomType) const
FiniteElementCollection * GetTraceCollection() const
int HasFaceDofs(Geometry::Type geom, int p) const
virtual StatelessDofTransformation * GetDofTransformation() const
Return a DoF transformation object for this particular type of basis.
Arbitrary order H1 serendipity elements in 2D on a quad.
Arbitrary order Raviart-Thomas elements in 2D on a square.
static const int DimStart[MaxDim+2]
virtual int GetMapType(int dim) const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
MFEM_EXPORT class LinearWedgeFiniteElement WedgeFE
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Arbitrary order H1 elements in 2D on a triangle.
void InitFaces(const int p, const int dim, const int map_type, const bool signs)
Piecewise-linear discontinuous finite elements in 3D. This class is kept only for backward compatibil...
RT_R2D_Trace_FECollection(const int p, const int dim, const int map_type=FiniteElement::INTEGRAL, const int ob_type=BasisType::GaussLegendre)
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Arbitrary order L2 elements in 2D on a square.
int ND_dof[Geometry::NumGeom]
Arbitrary order H1 elements in 1D.
int GetDerivRangeType() const
Returns the FiniteElement::RangeType of the element derivative, either SCALAR or VECTOR.
int RT_dof[Geometry::NumGeom]
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
RT_Trace_FECollection(const int p, const int dim, const int map_type=FiniteElement::INTEGRAL, const int ob_type=BasisType::GaussLegendre)
Arbitrary order H1 elements in 1D utilizing the Bernstein basis.
int GetMapType() const
Returns the FiniteElement::MapType of the element describing how reference functions are mapped to ph...
Arbitrary order Nedelec 3D elements in 2D on a triangle.
Piecewise-(bi)quadratic continuous finite elements.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
First order Raviart-Thomas finite elements in 2D. This class is kept only for backward compatibility...
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
int Size() const
Return the logical size of the array.
Arbitrary order Nedelec elements in 3D on a cube.
Arbitrary order H1 elements in 2D utilizing the Bernstein basis on a square.
A 3D constant element on a pyramid.
Arbitrary order L2 elements in 3D utilizing the Bernstein basis on a cube.
virtual ~RT_R1D_FECollection()
A linear element defined on a square pyramid.
const int * GetDofMap(Geometry::Type GeomType) const
Get the Cartesian to local H1 dof map.
virtual int GetDerivRangeType(int dim) const
virtual int DofForGeometry(Geometry::Type GeomType) const
Arbitrary order H(curl)-conforming Nedelec finite elements.
Arbitrary order "H^{-1/2}-conforming" face finite elements defined on the interface between mesh elem...
virtual int DofForGeometry(Geometry::Type GeomType) const
Arbitrary order 3D H(div)-conforming Raviart-Thomas finite elements in 2D.
virtual ~ND_R1D_FECollection()
int GetRangeType() const
Returns the FiniteElement::RangeType of the element, one of {SCALAR, VECTOR}.
Arbitrary order H1-conforming (continuous) finite elements.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Second order Raviart-Thomas finite elements in 3D. This class is kept only for backward compatibility...
virtual int DofForGeometry(Geometry::Type GeomType) const
A 3D 0th order Raviert-Thomas element on a pyramid.
FiniteElementCollection * GetTraceCollection() const
Arbitrary order H1 elements in 3D on a wedge.
virtual int DofForGeometry(Geometry::Type GeomType) const
Piecewise-quadratic discontinuous finite elements in 2D. This class is kept only for backward compati...
virtual ~FiniteElementCollection()
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Arbitrary order 3D "H^{-1/2}-conforming" face finite elements defined on the interface between mesh e...
Local_FECollection(const char *fe_name)
FiniteElementCollection * GetTraceCollection() const
Arbitrary order Raviart-Thomas elements in 3D on a cube.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
void SetOrder(int Order) const
Set the order and the name, based on the given Order: either a positive number for fixed order...
Linear (P1) finite elements on quadrilaterals.
void InitVarOrder(int p) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
An arbitrary order 3D NURBS element on a cube.
An arbitrary order 1D NURBS element on a segment.
int ND_dof[Geometry::NumGeom]
FiniteElement * RT_Elements[Geometry::NumGeom]
An arbitrary order 2D NURBS element on a square.
Arbitrary order H1 elements in 2D utilizing the Bernstein basis on a triangle.
virtual StatelessDofTransformation * DofTransformationForGeometry(Geometry::Type GeomType) const
Returns a DoF transformation object compatible with this basis and geometry type. ...
A 3D 1st order Nedelec element on a cube.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual ~ND_R2D_FECollection()
No derivatives implemented.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Arbitrary order "L2-conforming" discontinuous finite elements.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const