17 #define snprintf _snprintf_s
40 MFEM_ABORT(
"unknown geometry type");
47 MFEM_ABORT(
"this method is not implemented in this derived class!");
55 if (!strcmp(name,
"Linear"))
59 else if (!strcmp(name,
"Quadratic"))
63 else if (!strcmp(name,
"QuadraticPos"))
67 else if (!strcmp(name,
"Cubic"))
71 else if (!strcmp(name,
"Const3D"))
75 else if (!strcmp(name,
"Const2D"))
79 else if (!strcmp(name,
"LinearDiscont2D"))
83 else if (!strcmp(name,
"GaussLinearDiscont2D"))
87 else if (!strcmp(name,
"P1OnQuad"))
91 else if (!strcmp(name,
"QuadraticDiscont2D"))
95 else if (!strcmp(name,
"QuadraticPosDiscont2D"))
99 else if (!strcmp(name,
"GaussQuadraticDiscont2D"))
103 else if (!strcmp(name,
"CubicDiscont2D"))
107 else if (!strcmp(name,
"LinearDiscont3D"))
111 else if (!strcmp(name,
"QuadraticDiscont3D"))
115 else if (!strcmp(name,
"LinearNonConf3D"))
119 else if (!strcmp(name,
"CrouzeixRaviart"))
123 else if (!strcmp(name,
"ND1_3D"))
127 else if (!strcmp(name,
"RT0_2D"))
131 else if (!strcmp(name,
"RT1_2D"))
135 else if (!strcmp(name,
"RT2_2D"))
139 else if (!strcmp(name,
"RT0_3D"))
143 else if (!strcmp(name,
"RT1_3D"))
147 else if (!strncmp(name,
"H1_Trace_", 9))
151 else if (!strncmp(name,
"H1_Trace@", 9))
156 else if (!strncmp(name,
"H1_", 3))
160 else if (!strncmp(name,
"H1Pos_Trace_", 12))
165 else if (!strncmp(name,
"H1Pos_", 6))
169 else if (!strncmp(name,
"H1Ser_", 6))
173 else if (!strncmp(name,
"H1@", 3))
178 else if (!strncmp(name,
"L2_T", 4))
181 else if (!strncmp(name,
"L2_", 3))
185 else if (!strncmp(name,
"L2Int_T", 7))
190 else if (!strncmp(name,
"L2Int_", 6))
196 else if (!strncmp(name,
"RT_Trace_", 9))
200 else if (!strncmp(name,
"RT_ValTrace_", 12))
205 else if (!strncmp(name,
"RT_Trace@", 9))
211 else if (!strncmp(name,
"RT_ValTrace@", 12))
217 else if (!strncmp(name,
"DG_Iface_", 9))
221 else if (!strncmp(name,
"DG_Iface@", 9))
227 else if (!strncmp(name,
"DG_IntIface_", 12))
232 else if (!strncmp(name,
"DG_IntIface@", 12))
238 else if (!strncmp(name,
"RT_", 3))
242 else if (!strncmp(name,
"RT@", 3))
248 else if (!strncmp(name,
"ND_Trace_", 9))
252 else if (!strncmp(name,
"ND_Trace@", 9))
258 else if (!strncmp(name,
"ND_", 3))
262 else if (!strncmp(name,
"ND@", 3))
268 else if (!strncmp(name,
"Local_", 6))
272 else if (!strncmp(name,
"NURBS", 5))
287 MFEM_ABORT(
"unknown FiniteElementCollection: " << name);
289 MFEM_VERIFY(!strcmp(fec->
Name(), name),
"input name: \"" << name
290 <<
"\" does not match the created collection name: \""
291 << fec->
Name() <<
'"');
299 MFEM_ABORT(
"Collection " << Name() <<
" does not support variable orders.");
306 if (p >= var_orders.Size())
308 var_orders.SetSize(p+1, NULL);
310 var_orders[
p] = Clone(p);
315 for (
int i = 0; i < var_orders.Size(); i++)
317 delete var_orders[i];
321 template <Geometry::Type geom>
326 nv = g_consts::NumVert;
327 ne = g_consts::NumEdges;
330 template <Geometry::Type geom,
typename v_t>
332 GetEdge(
int &nv, v_t &v,
int &ne,
int &e,
int &eo,
const int edge_info)
337 nv = e_consts::NumVert;
341 MFEM_ASSERT(0 <= e && e < g_consts::NumEdges,
"");
342 MFEM_ASSERT(0 <= eo && eo < e_consts::NumOrient,
"");
343 v[0] = e_consts::Orient[eo][0];
344 v[1] = e_consts::Orient[eo][1];
345 v[0] = g_consts::Edges[e][v[0]];
346 v[1] = g_consts::Edges[e][v[1]];
350 typename v_t,
typename e_t,
typename eo_t>
352 GetFace(
int &nv, v_t &v,
int &ne, e_t &e, eo_t &eo,
358 nv = f_consts::NumVert;
363 MFEM_ASSERT(0 <= f && f < g_consts::NumFaces,
"");
364 MFEM_ASSERT(0 <= fo && fo < f_consts::NumOrient,
"");
365 for (
int i = 0; i < f_consts::NumVert; i++)
367 v[i] = f_consts::Orient[fo][i];
368 v[i] = g_consts::FaceVert[
f][v[i]];
370 ne = f_consts::NumEdges;
371 for (
int i = 0; i < f_consts::NumEdges; i++)
373 int v0 = v[f_consts::Edges[i][0]];
374 int v1 = v[f_consts::Edges[i][1]];
376 if (v0 > v1) { swap(v0, v1); eor = 1; }
377 for (
int j = g_consts::VertToVert::I[v0];
true; j++)
379 MFEM_ASSERT(j < g_consts::VertToVert::I[v0+1],
380 "internal error, edge not found");
381 if (v1 == g_consts::VertToVert::J[j][0])
383 int en = g_consts::VertToVert::J[j][1];
403 "invalid Geom = " << Geom);
405 "invalid SDim = " << SDim <<
411 const int off = nvd*(Info/64);
413 for (
int i = 0; i < nvd; i++)
420 int v[4], e[4], eo[4],
f[1], fo[1];
421 int av = 0, nv = 0, ae = 0, ne = 0, nf = 0;
428 GetNVE<Geometry::SEGMENT>(av, ae);
429 GetEdge<Geometry::SEGMENT>(nv, v, ne, e[0], eo[0], Info);
435 GetNVE<Geometry::TRIANGLE>(av, ae);
439 GetEdge<Geometry::TRIANGLE>(nv, v, ne, e[0], eo[0], Info);
442 GetFace<Geometry::TRIANGLE,Geometry::TRIANGLE>(
443 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
453 GetNVE<Geometry::SQUARE>(av, ae);
457 GetEdge<Geometry::SQUARE>(nv, v, ne, e[0], eo[0], Info);
460 GetFace<Geometry::SQUARE,Geometry::SQUARE>(
461 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
471 GetNVE<Geometry::TETRAHEDRON>(av, ae);
475 GetEdge<Geometry::TETRAHEDRON>(nv, v, ne, e[0], eo[0], Info);
478 GetFace<Geometry::TETRAHEDRON,Geometry::TRIANGLE>(
479 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
489 GetNVE<Geometry::CUBE>(av, ae);
493 GetEdge<Geometry::CUBE>(nv, v, ne, e[0], eo[0], Info);
496 GetFace<Geometry::CUBE,Geometry::SQUARE>(
497 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
506 MFEM_ABORT(
"invalid Geom = " << Geom);
513 for (
int i = 0; i < nv; i++)
515 for (
int j = 0; j < nvd; j++)
517 dofs[i*nvd+j] = v[i]*nvd+j;
520 int l_off = nv*nvd, g_off = av*nvd;
525 for (
int i = 0; i < ne; i++)
529 for (
int j = 0; j < ned; j++)
531 dofs[l_off+i*ned+j] =
533 g_off+e[i]*ned+ed[j] :
534 -1-(g_off+e[i]*ned+(-1-ed[j]));
544 const int nfd = DofForGeometry(fg[0]);
546 for (
int i = 0; i < nf; i++)
548 const int *fd = DofOrderForOrientation(fg[i], fo[i]);
549 for (
int j = 0; j < nfd; j++)
551 dofs[l_off+i*nfd+j] =
553 g_off+f[i]*nfd+fd[j] :
554 -1-(g_off+f[i]*nfd+(-1-fd[j]));
565 ", SDim = " << SDim <<
" is not supported");
582 mfem_error (
"LinearFECollection: unknown geometry type.");
600 mfem_error (
"LinearFECollection: unknown geometry type.");
625 mfem_error (
"QuadraticFECollection: unknown geometry type.");
642 mfem_error (
"QuadraticFECollection: unknown geometry type.");
650 static int indexes[] = { 0 };
665 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
678 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
686 static int indexes[] = { 0 };
705 mfem_error (
"CubicFECollection: unknown geometry type.");
722 mfem_error (
"CubicFECollection: unknown geometry type.");
732 static int ind_pos[] = { 0, 1 };
733 static int ind_neg[] = { 1, 0 };
743 static int indexes[] = { 0 };
749 static int sq_ind[8][4] = {{0, 1, 2, 3}, {0, 2, 1, 3},
750 {2, 0, 3, 1}, {1, 0, 3, 2},
751 {3, 2, 1, 0}, {3, 1, 2, 0},
752 {1, 3, 0, 2}, {2, 3, 0, 1}
771 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
785 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
793 static int indexes[] = { 0 };
808 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
822 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
830 static int ind_pos[] = { 0 };
831 static int ind_neg[] = { -1 };
850 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
864 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
872 static int ind_pos[] = { 0, 1 };
873 static int ind_neg[] = { -2, -1 };
891 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
905 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
913 static int ind_pos[] = { 0, 1, 2 };
914 static int ind_neg[] = { -3, -2, -1 };
932 mfem_error (
"Const2DFECollection: unknown geometry type.");
946 mfem_error (
"Const2DFECollection: unknown geometry type.");
967 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
981 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
1002 mfem_error (
"GaussLinearDiscont2DFECollection:"
1003 " unknown geometry type.");
1018 mfem_error (
"GaussLinearDiscont2DFECollection:"
1019 " unknown geometry type.");
1036 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
1049 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
1070 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1085 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1105 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1119 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1135 mfem_error (
"GaussQuadraticDiscont2DFECollection:"
1136 " unknown geometry type.");
1151 mfem_error (
"GaussQuadraticDiscont2DFECollection:"
1152 " unknown geometry type.");
1173 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1187 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1210 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1226 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1234 static int indexes[] = { 0 };
1250 mfem_error (
"Const3DFECollection: unknown geometry type.");
1268 mfem_error (
"Const3DFECollection: unknown geometry type.");
1291 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1309 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1330 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1347 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1371 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1387 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1395 static int indexes[] = { 0 };
1411 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1429 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1437 static int ind_pos[] = { 0 };
1438 static int ind_neg[] = { -1 };
1460 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1478 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1486 static int ind_pos[] = { 0 };
1487 static int ind_neg[] = { -1 };
1509 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1524 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1534 static int sq_ind[8][4] =
1536 {0, 1, 2, 3}, {-1, -3, -2, -4},
1537 {2, 0, 3, 1}, {-2, -1, -4, -3},
1538 {3, 2, 1, 0}, {-4, -2, -3, -1},
1539 {1, 3, 0, 2}, {-3, -4, -1, -2}
1555 MFEM_VERIFY(p >= 1,
"H1_FECollection requires order >= 1.");
1556 MFEM_VERIFY(dim >= 0 && dim <= 3,
"H1_FECollection requires 0 <= dim <= 3.");
1558 const int pm1 = p - 1, pm2 = pm1 - 1, pm3 = pm2 - 1, pm4 = pm3 - 1;
1566 snprintf(
h1_name, 32,
"H1_%dD_P%d", dim, p);
1571 snprintf(
h1_name, 32,
"H1Pos_%dD_P%d", dim, p);
1576 snprintf(
h1_name, 32,
"H1Ser_%dD_P%d", dim, p);
1585 snprintf(
h1_name, 32,
"H1@%c_%dD_P%d",
1595 for (
int i = 0; i < 2; i++)
1599 for (
int i = 0; i < 6; i++)
1603 for (
int i = 0; i < 8; i++)
1607 for (
int i = 0; i < 24; i++)
1629 for (
int i = 0; i < pm1; i++)
1666 for (
int i = 1; i < 6; i++)
1671 for (
int j = 0; j < pm2; j++)
1673 for (
int i = 0; i + j < pm2; i++)
1675 int o = TriDof - ((pm1 - j)*(pm2 - j))/2 + i;
1676 int k = pm3 - j - i;
1678 TriDofOrd[1][o] = TriDof - ((pm1-j)*(pm2-j))/2 + k;
1679 TriDofOrd[2][o] = TriDof - ((pm1-i)*(pm2-i))/2 + k;
1680 TriDofOrd[3][o] = TriDof - ((pm1-k)*(pm2-k))/2 + i;
1681 TriDofOrd[4][o] = TriDof - ((pm1-k)*(pm2-k))/2 + j;
1682 TriDofOrd[5][o] = TriDof - ((pm1-i)*(pm2-i))/2 + j;
1687 for (
int i = 1; i < 8; i++)
1710 for (
int j = 0; j < pm3; j++)
1712 for (
int i = 0; i < pm3; i++)
1719 QuadDofOrd[4][o] = (pm4 - i) + (pm4 - j)*pm3;
1720 QuadDofOrd[5][o] = (pm4 - j) + (pm4 - i)*pm3;
1721 QuadDofOrd[6][o] = (pm4 - j) + i*pm3;
1722 QuadDofOrd[7][o] = i + (pm4 - j)*pm3;
1730 for (
int j = 0; j < pm1; j++)
1732 for (
int i = 0; i < pm1; i++)
1739 QuadDofOrd[4][o] = (pm2 - i) + (pm2 - j)*pm1;
1740 QuadDofOrd[5][o] = (pm2 - j) + (pm2 - i)*pm1;
1741 QuadDofOrd[6][o] = (pm2 - j) + i*pm1;
1742 QuadDofOrd[7][o] = i + (pm2 - j)*pm1;
1770 for (
int i = 1; i < 24; i++)
1775 for (
int k = 0; k < pm3; k++)
1777 for (
int j = 0; j + k < pm3; j++)
1779 for (
int i = 0; i + j + k < pm3; i++)
1781 int l = pm4 - k - j - i;
1782 int o = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1783 + (j * (2 * p - 5 - j - 2 * k)) / 2 + i;
1784 int o1 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1785 + (k * (2 * p - 5 - k - 2 * j)) / 2 + i;
1786 int o2 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1787 + (k * (2 * p - 5 - k - 2 * i)) / 2 + j;
1788 int o3 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1789 + (i * (2 * p - 5 - i - 2 * k)) / 2 + j;
1790 int o4 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1791 + (i * (2 * p - 5 - i - 2 * j)) / 2 + k;
1792 int o5 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1793 + (j * (2 * p - 5 - j - 2 * i)) / 2 + k;
1794 int o6 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1795 + (l * (2 * p - 5 - l - 2 * k)) / 2 + j;
1796 int o7 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1797 + (k * (2 * p - 5 - k - 2 * l)) / 2 + j;
1798 int o8 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1799 + (j * (2 * p - 5 - j - 2 * l)) / 2 + k;
1800 int o9 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1801 + (l * (2 * p - 5 - l - 2 * j)) / 2 + k;
1802 int o10 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1803 + (k * (2 * p - 5 - k - 2 * j)) / 2 + l;
1804 int o11 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1805 + (j * (2 * p - 5 - j - 2 * k)) / 2 + l;
1806 int o12 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1807 + (l * (2 * p - 5 - l - 2 * i)) / 2 + k;
1808 int o13 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1809 + (i * (2 * p - 5 - i - 2 * l)) / 2 + k;
1810 int o14 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1811 + (i * (2 * p - 5 - i - 2 * k)) / 2 + l;
1812 int o15 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1813 + (k * (2 * p - 5 - k - 2 * i)) / 2 + l;
1814 int o16 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1815 + (k * (2 * p - 5 - k - 2 * l)) / 2 + i;
1816 int o17 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1817 + (l * (2 * p - 5 - l - 2 * k)) / 2 + i;
1818 int o18 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1819 + (j * (2 * p - 5 - j - 2 * i)) / 2 + l;
1820 int o19 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1821 + (i * (2 * p - 5 - i - 2 * j)) / 2 + l;
1822 int o20 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1823 + (l * (2 * p - 5 - l - 2 * j)) / 2 + i;
1824 int o21 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1825 + (j * (2 * p - 5 - j - 2 * l)) / 2 + i;
1826 int o22 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1827 + (i * (2 * p - 5 - i - 2 * l)) / 2 + j;
1828 int o23 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1829 + (l * (2 * p - 5 - l - 2 * i)) / 2 + j;
1870 MFEM_ABORT(
"H1 Pyramid basis functions are not yet supported "
1902 if (!strncmp(
h1_name,
"H1_", 3))
1906 else if (!strncmp(
h1_name,
"H1Pos_", 6))
1910 else if (!strncmp(
h1_name,
"H1@", 3))
1919 const int *dof_map = NULL;
1929 MFEM_ABORT(
"Geometry type " <<
Geometry::Name[GeomType] <<
" is not "
1961 snprintf(
h1_name, 32,
"H1_Trace_%dD_P%d", dim, p);
1965 snprintf(
h1_name, 32,
"H1Pos_Trace_%dD_P%d", dim, p);
1969 snprintf(
h1_name, 32,
"H1_Trace@%c_%dD_P%d",
1981 MFEM_VERIFY(p >= 0,
"L2_FECollection requires order >= 0.");
1984 const char *prefix = NULL;
1990 MFEM_ABORT(
"invalid map_type: " << map_type);
1995 snprintf(d_name, 32,
"%s_%dD_P%d", prefix, dim, p);
1998 snprintf(d_name, 32,
"%s_T%d_%dD_P%d", prefix, btype, dim, p);
2003 L2_Elements[g] = NULL;
2004 Tr_Elements[g] = NULL;
2006 for (
int i = 0; i < 2; i++)
2008 SegDofOrd[i] = NULL;
2010 for (
int i = 0; i < 6; i++)
2012 TriDofOrd[i] = NULL;
2014 for (
int i = 0; i < 24; i++)
2016 TetDofOrd[i] = NULL;
2039 const int pp1 = p + 1;
2040 SegDofOrd[0] =
new int[2*pp1];
2041 SegDofOrd[1] = SegDofOrd[0] + pp1;
2042 for (
int i = 0; i <=
p; i++)
2044 SegDofOrd[0][i] = i;
2045 SegDofOrd[1][i] = p - i;
2073 TriDofOrd[0] =
new int[6*TriDof];
2074 for (
int i = 1; i < 6; i++)
2076 TriDofOrd[i] = TriDofOrd[i-1] + TriDof;
2078 const int pp1 = p + 1, pp2 = pp1 + 1;
2079 for (
int j = 0; j <=
p; j++)
2081 for (
int i = 0; i + j <=
p; i++)
2083 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
2085 TriDofOrd[0][o] = o;
2086 TriDofOrd[1][o] = TriDof - ((pp2-j)*(pp1-j))/2 + k;
2087 TriDofOrd[2][o] = TriDof - ((pp2-i)*(pp1-i))/2 + k;
2088 TriDofOrd[3][o] = TriDof - ((pp2-k)*(pp1-k))/2 + i;
2089 TriDofOrd[4][o] = TriDof - ((pp2-k)*(pp1-k))/2 + j;
2090 TriDofOrd[5][o] = TriDof - ((pp2-i)*(pp1-i))/2 + j;
2094 OtherDofOrd =
new int[QuadDof];
2095 for (
int j = 0; j < QuadDof; j++)
2136 const int MaxDof = std::max(TetDof, std::max(PriDof, HexDof));
2138 TetDofOrd[0] =
new int[24*TetDof];
2139 for (
int i = 1; i < 24; i++)
2141 TetDofOrd[i] = TetDofOrd[i-1] + TetDof;
2144 const int pp1 = p + 1, pp2 = pp1 + 1, pp3 = pp2 + 1;
2145 for (
int k = 0; k <=
p; k++)
2147 for (
int j = 0; j + k <=
p; j++)
2149 for (
int i = 0; i + j + k <=
p; i++)
2151 int l = p - k - j - i;
2152 int o = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2153 + (j * (2 * p + 3 - j - 2 * k)) / 2 + i;
2154 int o1 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2155 + (k * (2 * p + 3 - k - 2 * j)) / 2 + i;
2156 int o2 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2157 + (k * (2 * p + 3 - k - 2 * i)) / 2 + j;
2158 int o3 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2159 + (i * (2 * p + 3 - i - 2 * k)) / 2 + j;
2160 int o4 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2161 + (i * (2 * p + 3 - i - 2 * j)) / 2 + k;
2162 int o5 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2163 + (j * (2 * p + 3 - j - 2 * i)) / 2 + k;
2164 int o6 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2165 + (l * (2 * p + 3 - l - 2 * k)) / 2 + j;
2166 int o7 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2167 + (k * (2 * p + 3 - k - 2 * l)) / 2 + j;
2168 int o8 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2169 + (j * (2 * p + 3 - j - 2 * l)) / 2 + k;
2170 int o9 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2171 + (l * (2 * p + 3 - l - 2 * j)) / 2 + k;
2172 int o10 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2173 + (k * (2 * p + 3 - k - 2 * j)) / 2 + l;
2174 int o11 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2175 + (j * (2 * p + 3 - j - 2 * k)) / 2 + l;
2176 int o12 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2177 + (l * (2 * p + 3 - l - 2 * i)) / 2 + k;
2178 int o13 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2179 + (i * (2 * p + 3 - i - 2 * l)) / 2 + k;
2180 int o14 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2181 + (i * (2 * p + 3 - i - 2 * k)) / 2 + l;
2182 int o15 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2183 + (k * (2 * p + 3 - k - 2 * i)) / 2 + l;
2184 int o16 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2185 + (k * (2 * p + 3 - k - 2 * l)) / 2 + i;
2186 int o17 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2187 + (l * (2 * p + 3 - l - 2 * k)) / 2 + i;
2188 int o18 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2189 + (j * (2 * p + 3 - j - 2 * i)) / 2 + l;
2190 int o19 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2191 + (i * (2 * p + 3 - i - 2 * j)) / 2 + l;
2192 int o20 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2193 + (l * (2 * p + 3 - l - 2 * j)) / 2 + i;
2194 int o21 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2195 + (j * (2 * p + 3 - j - 2 * l)) / 2 + i;
2196 int o22 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2197 + (i * (2 * p + 3 - i - 2 * l)) / 2 + j;
2198 int o23 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2199 + (l * (2 * p + 3 - l - 2 * i)) / 2 + j;
2200 TetDofOrd[ 0][o] = o;
2201 TetDofOrd[ 1][o] = o1;
2202 TetDofOrd[ 2][o] = o2;
2203 TetDofOrd[ 3][o] = o3;
2204 TetDofOrd[ 4][o] = o4;
2205 TetDofOrd[ 5][o] = o5;
2206 TetDofOrd[ 6][o] = o6;
2207 TetDofOrd[ 7][o] = o7;
2208 TetDofOrd[ 8][o] = o8;
2209 TetDofOrd[ 9][o] = o9;
2210 TetDofOrd[10][o] = o10;
2211 TetDofOrd[11][o] = o11;
2212 TetDofOrd[12][o] = o12;
2213 TetDofOrd[13][o] = o13;
2214 TetDofOrd[14][o] = o14;
2215 TetDofOrd[15][o] = o15;
2216 TetDofOrd[16][o] = o16;
2217 TetDofOrd[17][o] = o17;
2218 TetDofOrd[18][o] = o18;
2219 TetDofOrd[19][o] = o19;
2220 TetDofOrd[20][o] = o20;
2221 TetDofOrd[21][o] = o21;
2222 TetDofOrd[22][o] = o22;
2223 TetDofOrd[23][o] = o23;
2227 OtherDofOrd =
new int[MaxDof];
2228 for (
int j = 0; j < MaxDof; j++)
2235 mfem::err <<
"L2_FECollection::L2_FECollection : dim = "
2246 return L2_Elements[GeomType];
2250 MFEM_ABORT(
"L2 Pyramid basis functions are not yet supported "
2262 return (Or > 0) ? SegDofOrd[0] : SegDofOrd[1];
2265 return TriDofOrd[Or%6];
2268 return TetDofOrd[Or%24];
2271 return (Or == 0) ? OtherDofOrd : NULL;
2277 delete [] OtherDofOrd;
2278 delete [] SegDofOrd[0];
2279 delete [] TriDofOrd[0];
2280 delete [] TetDofOrd[0];
2283 delete L2_Elements[i];
2284 delete Tr_Elements[i];
2290 const int cb_type,
const int ob_type)
2297 MFEM_VERIFY(p >= 0,
"RT_FECollection requires order >= 0.");
2305 MFEM_ABORT(
"unknown closed BasisType: " << cb_name);
2311 MFEM_ABORT(
"unknown open BasisType: " << ob_name);
2319 snprintf(
rt_name, 32,
"RT_%dD_P%d", dim, p);
2327 const int pp1 = p + 1;
2356 MFEM_ABORT(
"invalid dim = " << dim);
2363 const int map_type,
const bool signs,
2372 MFEM_ABORT(
"Invalid open basis type: " << ob_name);
2384 "invalid open point type");
2386 const int pp1 = p + 1, pp2 = p + 2;
2394 for (
int i = 0; i < 2; i++)
2398 for (
int i = 0; i < 6; i++)
2402 for (
int i = 0; i < 8; i++)
2416 for (
int i = 0; i <=
p; i++)
2419 SegDofOrd[1][i] = signs ? (-1 - (p - i)) : (p - i);
2436 for (
int i = 1; i < 6; i++)
2442 for (
int j = 0; j <=
p; j++)
2444 for (
int i = 0; i + j <=
p; i++)
2446 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
2449 TriDofOrd[1][o] = -1-(TriDof-((pp2-j)*(pp1-j))/2+k);
2450 TriDofOrd[2][o] = TriDof-((pp2-i)*(pp1-i))/2+k;
2451 TriDofOrd[3][o] = -1-(TriDof-((pp2-k)*(pp1-k))/2+i);
2452 TriDofOrd[4][o] = TriDof-((pp2-k)*(pp1-k))/2+j;
2453 TriDofOrd[5][o] = -1-(TriDof-((pp2-i)*(pp1-i))/2+j);
2456 for (
int kk = 1; kk < 6; kk += 2)
2458 TriDofOrd[kk][o] = -1 - TriDofOrd[kk][o];
2466 for (
int i = 1; i < 8; i++)
2471 for (
int j = 0; j <=
p; j++)
2473 for (
int i = 0; i <=
p; i++)
2480 QuadDofOrd[4][o] = (p - i) + (p - j)*pp1;
2481 QuadDofOrd[5][o] = -1 - ((p - j) + (p - i)*pp1);
2482 QuadDofOrd[6][o] = (p - j) + i*pp1;
2483 QuadDofOrd[7][o] = -1 - (i + (p - j)*pp1);
2486 for (
int k = 1; k < 8; k += 2)
2488 QuadDofOrd[k][o] = -1 - QuadDofOrd[k][o];
2505 MFEM_ABORT(
"RT Pyramid basis functions are not yet supported "
2532 if (!strncmp(
rt_name,
"RT_", 3))
2563 const char *prefix =
2565 char ob_str[3] = {
'\0',
'\0',
'\0' };
2572 snprintf(
rt_name, 32,
"%s%s_%dD_P%d", prefix, ob_str, dim, p);
2574 MFEM_VERIFY(dim == 2 || dim == 3,
"Wrong dimension, dim = " << dim);
2583 MFEM_VERIFY(dim == 2 || dim == 3,
"Wrong dimension, dim = " << dim);
2585 const char *prefix =
2589 snprintf(
rt_name, 32,
"%s_%dD_P%d", prefix, dim, p);
2593 snprintf(
rt_name, 32,
"%s@%c_%dD_P%d", prefix,
2599 const int cb_type,
const int ob_type)
2605 MFEM_VERIFY(p >= 1,
"ND_FECollection requires order >= 1.");
2606 MFEM_VERIFY(dim >= 1 && dim <= 3,
"ND_FECollection requires 1 <= dim <= 3.");
2608 const int pm1 = p - 1, pm2 = p - 2;
2613 snprintf(
nd_name, 32,
"ND_%dD_P%d", dim, p);
2626 for (
int i = 0; i < 2; i++)
2630 for (
int i = 0; i < 6; i++)
2634 for (
int i = 0; i < 8; i++)
2647 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
2652 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
2662 for (
int i = 0; i <
p; i++)
2681 for (
int i = 1; i < 8; i++)
2686 for (
int j = 0; j < pm1; j++)
2688 for (
int i = 0; i <
p; i++)
2691 int d2 = p*pm1 + j + i*pm1;
2701 QuadDofOrd[2][d1] = -1 - (p*pm1 + j + (pm1 - i)*pm1);
2705 QuadDofOrd[3][d2] = p*pm1 + (pm2 - j) + i*pm1;
2707 QuadDofOrd[4][d1] = -1 - ((pm1 - i) + (pm2 - j)*
p);
2708 QuadDofOrd[4][d2] = -1 - (p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2710 QuadDofOrd[5][d1] = -1 - (p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2711 QuadDofOrd[5][d2] = -1 - ((pm1 - i) + (pm2 - j)*
p);
2715 QuadDofOrd[6][d1] = p*pm1 + (pm2 - j) + i*pm1;
2716 QuadDofOrd[6][d2] = -1 - ((pm1 - i) + j*p);
2718 QuadDofOrd[7][d1] = i + (pm2 - j)*p;
2719 QuadDofOrd[7][d2] = -1 - (p*pm1 + j + (pm1 - i)*pm1);
2725 for (
int i = 1; i < 6; i++)
2731 for (
int j = 0; j <= pm2; j++)
2733 for (
int i = 0; i + j <= pm2; i++)
2735 int k0 = p*pm1 - (p - j)*(pm1 - j) + 2*i;
2736 int k1 = 2*pm2 - 2*i + ((2*p-3)-j)*j;
2737 int k2 = 2*pm2 - 2*j + ((2*p-3)-i)*i;
2738 int k3 = p*pm1 - 2 - 3*j - i - (i+j)*(i+j);
2739 int k4 = p*pm1 - 2 - 3*i - j - (i+j)*(i+j);
2740 int k5 = p*pm1 - (p - i)*(pm1 - i) + 2*j;
2790 MFEM_ABORT(
"ND Pyramid basis functions are not yet supported "
2816 int tr_p, tr_dim, tr_cb_type, tr_ob_type;
2854 snprintf(
nd_name, 32,
"ND_Trace_%dD_P%d", dim, p);
2858 snprintf(
nd_name, 32,
"ND_Trace@%c%c_%dD_P%d",
2866 const int cb_type,
const int ob_type)
2869 MFEM_VERIFY(p >= 1,
"ND_R1D_FECollection requires order >= 1.");
2870 MFEM_VERIFY(dim == 1,
"ND_R1D_FECollection requires dim == 1.");
2875 snprintf(
nd_name, 32,
"ND_R1D_%dD_P%d", dim, p);
2879 snprintf(
nd_name, 32,
"ND_R1D@%c%c_%dD_P%d",
2897 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
2902 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
2935 const int cb_type,
const int ob_type)
2938 MFEM_VERIFY(p >= 0,
"RT_R1D_FECollection requires order >= 0.");
2939 MFEM_VERIFY(dim == 1,
"RT_R1D_FECollection requires dim == 1.");
2944 snprintf(
rt_name, 32,
"RT_R1D_%dD_P%d", dim, p);
2948 snprintf(
rt_name, 32,
"RT_R1D@%c%c_%dD_P%d",
2966 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
2971 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
2991 MFEM_ABORT(
"this method is not implemented in RT_R1D_FECollection!");
3005 const int cb_type,
const int ob_type)
3008 MFEM_VERIFY(p >= 1,
"ND_R2D_FECollection requires order >= 1.");
3009 MFEM_VERIFY(dim >= 1 && dim <= 2,
3010 "ND_R2D_FECollection requires 1 <= dim <= 2.");
3012 const int pm1 = p - 1, pm2 = p - 2;
3017 snprintf(
nd_name, 32,
"ND_R2D_%dD_P%d", dim, p);
3021 snprintf(
nd_name, 32,
"ND_R2D@%c%c_%dD_P%d",
3031 for (
int i = 0; i < 2; i++)
3043 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
3048 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
3062 for (
int i = 0; i <
p; i++)
3067 for (
int i = 0; i < pm1; i++)
3099 int p,
dim, cb_type, ob_type;
3135 snprintf(
nd_name, 32,
"ND_R2D_Trace_%dD_P%d", dim, p);
3139 snprintf(
nd_name, 32,
"ND_R2D_Trace@%c%c_%dD_P%d",
3147 const int cb_type,
const int ob_type)
3151 MFEM_VERIFY(p >= 0,
"RT_R2D_FECollection requires order >= 0.");
3152 MFEM_VERIFY(dim >= 1 && dim <= 2,
3153 "RT_R2D_FECollection requires 1 <= dim <= 2.");
3161 MFEM_ABORT(
"unknown closed BasisType: " << cb_name);
3166 MFEM_ABORT(
"unknown open BasisType: " << ob_name);
3174 snprintf(
rt_name, 32,
"RT_R2D_%dD_P%d", dim, p);
3178 snprintf(
rt_name, 32,
"RT_R2D@%c%c_%dD_P%d",
3183 const int pp1 = p + 1;
3184 const int pp2 = p + 2;
3203 const bool signs,
const int ob_type)
3210 MFEM_ABORT(
"Invalid open basis type: " << ob_name);
3222 "invalid open point type");
3224 const int pp1 = p + 1;
3232 for (
int i = 0; i < 2; i++)
3246 for (
int i = 0; i <=
p; i++)
3249 SegDofOrd[1][i] = signs ? (-1 - (p - i)) : (p - i);
3267 if (!strncmp(
rt_name,
"RT_R2D_", 7))
3295 const char *prefix =
3297 char ob_str[3] = {
'\0',
'\0',
'\0' };
3304 snprintf(
rt_name, 32,
"%s%s_%dD_P%d", prefix, ob_str, dim, p);
3306 MFEM_VERIFY(dim == 2,
"Wrong dimension, dim = " << dim);
3312 snprintf(d_name, 32,
"Local_%s", fe_name);
3314 Local_Element = NULL;
3316 if (!strcmp(fe_name,
"BiCubic2DFiniteElement") ||
3317 !strcmp(fe_name,
"Quad_Q3"))
3322 else if (!strcmp(fe_name,
"Nedelec1HexFiniteElement") ||
3323 !strcmp(fe_name,
"Hex_ND1"))
3328 else if (!strncmp(fe_name,
"H1_", 3))
3333 else if (!strncmp(fe_name,
"H1Pos_", 6))
3338 else if (!strncmp(fe_name,
"L2_", 3))
3345 mfem::err <<
"Local_FECollection::Local_FECollection : fe_name = "
3368 snprintf(name, 16,
"NURBS%i", Order);
3372 snprintf(name, 16,
"NURBS");
3378 delete ParallelepipedFE;
3379 delete QuadrilateralFE;
3392 mfem_error (
"NURBSFECollection: unknown geometry type.");
3399 mfem_error(
"NURBSFECollection::DofForGeometry");
3406 mfem_error(
"NURBSFECollection::DofOrderForOrientation");
3412 MFEM_ABORT(
"NURBS finite elements can not be statically condensed!");
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]...
Abstract class for all 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 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)
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Arbitrary order L2 elements in 3D on a wedge.
Arbitrary order Nedelec elements in 1D on a segment.
int Size() const
Return the logical size of the array.
Piecewise-cubic discontinuous finite elements in 2D. This class is kept only for backward compatibili...
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]...
Version of QuadraticDiscont2DFECollection with dofs in the Gaussian points.
int RT_dof[Geometry::NumGeom]
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
FiniteElement * ND_Elements[Geometry::NumGeom]
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
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]...
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 FiniteElementCollection * GetTraceCollection() const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual ~NURBSFECollection()
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_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]...
Arbitrary order Nedelec 3D elements in 2D on a square.
class LinearPyramidFiniteElement PyramidFE
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]...
FiniteElementCollection * GetTraceCollection() const
A 3D 1st order Nedelec element on a pyramid.
Arbitrary order L2 elements in 3D 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 ~L2_FECollection()
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Arbitrary order L2 elements in 1D utilizing the Bernstein basis on a segment.
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]...
T * GetData()
Returns the data.
Arbitrary order H1 elements in 2D on a square.
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 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...
virtual int DofForGeometry(Geometry::Type GeomType) const
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.
Arbitrary order, three component, Raviart-Thomas elements in 1D on a segment.
virtual ~RT_R2D_FECollection()
FiniteElementCollection * GetTraceCollection() const
virtual void SetMapType(const int map_type_)
Set the FiniteElement::MapType of the element to either VALUE or INTEGRAL. Also sets the FiniteElemen...
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
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)
FiniteElementCollection * GetTraceCollection() const
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)
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.
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]...
int GetOrder() const
Return the order (polynomial degree) of the FE collection, corresponding to the order/degree returned...
NURBSFECollection(int Order=VariableOrder)
The parameter Order must be either a positive number, for fixed order, or VariableOrder (default)...
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Arbitrary order Raviart-Thomas 3D 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]...
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 ~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)
Class for standard nodal finite elements.
Piecewise-(bi)cubic continuous finite elements.
PointFiniteElement PointFE
FiniteElementCollection * GetTraceCollection() const
virtual int DofForGeometry(Geometry::Type GeomType) const
const int * GetDofMap(Geometry::Type GeomType) const
Get the Cartesian to local H1 dof map.
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.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
int HasFaceDofs(Geometry::Type geom, int p) const
virtual void SetMapType(int M)
Set the FiniteElement::MapType of the element to either VALUE or INTEGRAL. Also sets the FiniteElemen...
int H1_dof[Geometry::NumGeom]
double f(const Vector &xvec)
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]
static const int Dimension[NumGeom]
virtual int DofForGeometry(Geometry::Type GeomType) const
static void GetNVE(int &nv, int &ne)
FiniteElement * ND_Elements[Geometry::NumGeom]
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]...
Piecewise-linear discontinuous finite elements in 2D. This class is kept only for backward compatibil...
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)
Discontinuous collection defined locally by a given finite element.
Arbitrary order H(curl)-trace finite elements defined on the interface between mesh elements (faces...
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]...
Version of QuadraticDiscont2DFECollection with positive basis functions.
virtual ~ND_FECollection()
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
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
Array< FiniteElementCollection * > var_orders
Third order Raviart-Thomas finite elements in 2D. This class is kept only for backward compatibility...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
First order Raviart-Thomas finite elements in 3D. This class is kept only for backward compatibility...
virtual int DofForGeometry(Geometry::Type GeomType) const
void SubDofOrder(Geometry::Type Geom, int SDim, int Info, Array< int > &dofs) const
Get the local dofs for a given sub-manifold.
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
Version of QuadraticFECollection with positive basis functions.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual ~H1_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]...
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]...
int ND_dof[Geometry::NumGeom]
FiniteElementCollection * GetTraceCollection() const
Piecewise-constant discontinuous finite elements in 2D. This class is kept only for backward compatib...
FiniteElement * H1_Elements[Geometry::NumGeom]
FiniteElementCollection * GetTraceCollection() const
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.
Crouzeix-Raviart nonconforming elements in 2D.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
FiniteElementCollection * GetTraceCollection() const
FiniteElement * RT_Elements[Geometry::NumGeom]
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
Arbitrary order H(div)-conforming Raviart-Thomas finite elements.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Arbitrary order L2 elements in 3D on a tetrahedron.
static void GetEdge(int &nv, v_t &v, int &ne, int &e, int &eo, const int edge_info)
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]...
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.
void SetOrder(int Order) const
Set the order and the name, based on the given Order: either a positive number for fixed order...
virtual int DofForGeometry(Geometry::Type GeomType) const
int GetDof() const
Returns the number of degrees of freedom in the finite element.
OutStream err(std::cerr)
Global stream used by the library for standard error output. Initially it uses the same std::streambu...
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 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)
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
virtual int DofForGeometry(Geometry::Type GeomType) 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.
virtual int DofForGeometry(Geometry::Type GeomType) const
Arbitrary order H1 elements in 3D on a cube.
Serendipity basis (squares / cubes)
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
class Linear3DFiniteElement TetrahedronFE
const Array< int > & GetLexicographicOrdering() const
Get an Array<int> that maps lexicographically ordered indices to the indices of the respective nodes/...
Arbitrary order Raviart-Thomas elements in 2D on a triangle.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Linear2DFiniteElement TriangleFE
static int CheckOpen(int type)
If the Quadrature1D type is not open return Invalid; otherwise return type.
virtual int DofForGeometry(Geometry::Type GeomType) const
Integrated GLL indicator functions.
Version of LinearDiscont2DFECollection with dofs in the Gaussian points.
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...
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
virtual FiniteElementCollection * Clone(int p) const
Instantiate a new collection of the same type with a different order.
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.
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 const char * Name() const
Arbitrary order Nedelec elements in 2D on a square.
virtual int DofForGeometry(Geometry::Type GeomType) const
void InitVarOrder(int p) const
Arbitrary order H1 serendipity elements in 2D on a quad.
Arbitrary order Raviart-Thomas 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]...
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]...
FiniteElementCollection * GetTraceCollection() const
virtual int DofForGeometry(Geometry::Type GeomType) const
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
virtual int DofForGeometry(Geometry::Type GeomType) const
Arbitrary order L2 elements in 2D on a square.
int ND_dof[Geometry::NumGeom]
Arbitrary order H1 elements in 1D.
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]...
int RT_dof[Geometry::NumGeom]
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
RT_Trace_FECollection(const int p, const int dim, const int map_type=FiniteElement::INTEGRAL, const int ob_type=BasisType::GaussLegendre)
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 1D utilizing the Bernstein basis.
virtual int DofForGeometry(Geometry::Type GeomType) const
Arbitrary order Nedelec 3D elements in 2D on a triangle.
Piecewise-(bi)quadratic continuous finite elements.
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]...
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.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
BiLinear2DFiniteElement QuadrilateralFE
Arbitrary order H(curl)-conforming Nedelec finite elements.
virtual int DofForGeometry(Geometry::Type GeomType) const
Arbitrary order "H^{-1/2}-conforming" face finite elements defined on the interface between mesh elem...
Arbitrary order 3D H(div)-conforming Raviart-Thomas finite elements in 2D.
virtual ~ND_R1D_FECollection()
Arbitrary order H1-conforming (continuous) finite elements.
Second order Raviart-Thomas finite elements in 3D. This class is kept only for backward compatibility...
A 3D 0th order Raviert-Thomas element on a pyramid.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
TriLinear3DFiniteElement HexahedronFE
Arbitrary order H1 elements in 3D on a wedge.
Piecewise-quadratic discontinuous finite elements in 2D. This class is kept only for backward compati...
virtual ~FiniteElementCollection()
Arbitrary order 3D "H^{-1/2}-conforming" face finite elements defined on the interface between mesh e...
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Local_FECollection(const char *fe_name)
Arbitrary order Raviart-Thomas elements in 3D on a cube.
virtual int DofForGeometry(Geometry::Type GeomType) const
Linear (P1) finite elements on quadrilaterals.
Linear1DFiniteElement SegmentFE
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]...
An arbitrary order 3D NURBS element on a cube.
An arbitrary order 1D NURBS element on a segment.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
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.
A 3D 1st order Nedelec element on a cube.
virtual ~ND_R2D_FECollection()
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Arbitrary order "L2-conforming" discontinuous 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]...