17 #define snprintf _snprintf_s
35 mfem_error (
"FiniteElementCollection::HasFaceDofs:"
36 " unknown geometry type.");
43 MFEM_ABORT(
"this method is not implemented in this derived class!");
51 if (!strcmp(name,
"Linear"))
55 else if (!strcmp(name,
"Quadratic"))
59 else if (!strcmp(name,
"QuadraticPos"))
63 else if (!strcmp(name,
"Cubic"))
67 else if (!strcmp(name,
"Const3D"))
71 else if (!strcmp(name,
"Const2D"))
75 else if (!strcmp(name,
"LinearDiscont2D"))
79 else if (!strcmp(name,
"GaussLinearDiscont2D"))
83 else if (!strcmp(name,
"P1OnQuad"))
87 else if (!strcmp(name,
"QuadraticDiscont2D"))
91 else if (!strcmp(name,
"QuadraticPosDiscont2D"))
95 else if (!strcmp(name,
"GaussQuadraticDiscont2D"))
99 else if (!strcmp(name,
"CubicDiscont2D"))
103 else if (!strcmp(name,
"LinearDiscont3D"))
107 else if (!strcmp(name,
"QuadraticDiscont3D"))
111 else if (!strcmp(name,
"LinearNonConf3D"))
115 else if (!strcmp(name,
"CrouzeixRaviart"))
119 else if (!strcmp(name,
"ND1_3D"))
123 else if (!strcmp(name,
"RT0_2D"))
127 else if (!strcmp(name,
"RT1_2D"))
131 else if (!strcmp(name,
"RT2_2D"))
135 else if (!strcmp(name,
"RT0_3D"))
139 else if (!strcmp(name,
"RT1_3D"))
143 else if (!strncmp(name,
"H1_Trace_", 9))
147 else if (!strncmp(name,
"H1_Trace@", 9))
152 else if (!strncmp(name,
"H1_", 3))
156 else if (!strncmp(name,
"H1Pos_Trace_", 12))
161 else if (!strncmp(name,
"H1Pos_", 6))
165 else if (!strncmp(name,
"H1Ser_", 6))
169 else if (!strncmp(name,
"H1@", 3))
174 else if (!strncmp(name,
"L2_T", 4))
177 else if (!strncmp(name,
"L2_", 3))
181 else if (!strncmp(name,
"L2Int_T", 7))
186 else if (!strncmp(name,
"L2Int_", 6))
192 else if (!strncmp(name,
"RT_Trace_", 9))
196 else if (!strncmp(name,
"RT_ValTrace_", 12))
201 else if (!strncmp(name,
"RT_Trace@", 9))
207 else if (!strncmp(name,
"RT_ValTrace@", 12))
213 else if (!strncmp(name,
"DG_Iface_", 9))
217 else if (!strncmp(name,
"DG_Iface@", 9))
223 else if (!strncmp(name,
"DG_IntIface_", 12))
228 else if (!strncmp(name,
"DG_IntIface@", 12))
234 else if (!strncmp(name,
"RT_", 3))
238 else if (!strncmp(name,
"RT@", 3))
244 else if (!strncmp(name,
"ND_Trace_", 9))
248 else if (!strncmp(name,
"ND_Trace@", 9))
254 else if (!strncmp(name,
"ND_", 3))
258 else if (!strncmp(name,
"ND@", 3))
264 else if (!strncmp(name,
"Local_", 6))
268 else if (!strncmp(name,
"NURBS", 5))
283 MFEM_ABORT(
"unknown FiniteElementCollection: " << name);
285 MFEM_VERIFY(!strcmp(fec->
Name(), name),
"input name: \"" << name
286 <<
"\" does not match the created collection name: \""
287 << fec->
Name() <<
'"');
292 template <Geometry::Type geom>
297 nv = g_consts::NumVert;
298 ne = g_consts::NumEdges;
301 template <Geometry::Type geom,
typename v_t>
303 GetEdge(
int &nv, v_t &v,
int &ne,
int &e,
int &eo,
const int edge_info)
308 nv = e_consts::NumVert;
312 MFEM_ASSERT(0 <= e && e < g_consts::NumEdges,
"");
313 MFEM_ASSERT(0 <= eo && eo < e_consts::NumOrient,
"");
314 v[0] = e_consts::Orient[eo][0];
315 v[1] = e_consts::Orient[eo][1];
316 v[0] = g_consts::Edges[e][v[0]];
317 v[1] = g_consts::Edges[e][v[1]];
321 typename v_t,
typename e_t,
typename eo_t>
323 GetFace(
int &nv, v_t &v,
int &ne, e_t &e, eo_t &eo,
329 nv = f_consts::NumVert;
334 MFEM_ASSERT(0 <= f && f < g_consts::NumFaces,
"");
335 MFEM_ASSERT(0 <= fo && fo < f_consts::NumOrient,
"");
336 for (
int i = 0; i < f_consts::NumVert; i++)
338 v[i] = f_consts::Orient[fo][i];
339 v[i] = g_consts::FaceVert[
f][v[i]];
341 ne = f_consts::NumEdges;
342 for (
int i = 0; i < f_consts::NumEdges; i++)
344 int v0 = v[f_consts::Edges[i][0]];
345 int v1 = v[f_consts::Edges[i][1]];
347 if (v0 > v1) { swap(v0, v1); eor = 1; }
348 for (
int j = g_consts::VertToVert::I[v0];
true; j++)
350 MFEM_ASSERT(j < g_consts::VertToVert::I[v0+1],
351 "internal error, edge not found");
352 if (v1 == g_consts::VertToVert::J[j][0])
354 int en = g_consts::VertToVert::J[j][1];
374 "invalid Geom = " << Geom);
376 "invalid SDim = " << SDim <<
382 const int off = nvd*(Info/64);
384 for (
int i = 0; i < nvd; i++)
391 int v[4], e[4], eo[4],
f[1], fo[1];
392 int av = 0, nv = 0, ae = 0, ne = 0, nf = 0;
399 GetNVE<Geometry::SEGMENT>(av, ae);
400 GetEdge<Geometry::SEGMENT>(nv, v, ne, e[0], eo[0], Info);
406 GetNVE<Geometry::TRIANGLE>(av, ae);
410 GetEdge<Geometry::TRIANGLE>(nv, v, ne, e[0], eo[0], Info);
413 GetFace<Geometry::TRIANGLE,Geometry::TRIANGLE>(
414 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
424 GetNVE<Geometry::SQUARE>(av, ae);
428 GetEdge<Geometry::SQUARE>(nv, v, ne, e[0], eo[0], Info);
431 GetFace<Geometry::SQUARE,Geometry::SQUARE>(
432 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
442 GetNVE<Geometry::TETRAHEDRON>(av, ae);
446 GetEdge<Geometry::TETRAHEDRON>(nv, v, ne, e[0], eo[0], Info);
449 GetFace<Geometry::TETRAHEDRON,Geometry::TRIANGLE>(
450 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
460 GetNVE<Geometry::CUBE>(av, ae);
464 GetEdge<Geometry::CUBE>(nv, v, ne, e[0], eo[0], Info);
467 GetFace<Geometry::CUBE,Geometry::SQUARE>(
468 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
477 MFEM_ABORT(
"invalid Geom = " << Geom);
484 for (
int i = 0; i < nv; i++)
486 for (
int j = 0; j < nvd; j++)
488 dofs[i*nvd+j] = v[i]*nvd+j;
491 int l_off = nv*nvd, g_off = av*nvd;
496 for (
int i = 0; i < ne; i++)
500 for (
int j = 0; j < ned; j++)
502 dofs[l_off+i*ned+j] =
504 g_off+e[i]*ned+ed[j] :
505 -1-(g_off+e[i]*ned+(-1-ed[j]));
515 const int nfd = DofForGeometry(fg[0]);
517 for (
int i = 0; i < nf; i++)
519 const int *fd = DofOrderForOrientation(fg[i], fo[i]);
520 for (
int j = 0; j < nfd; j++)
522 dofs[l_off+i*nfd+j] =
524 g_off+f[i]*nfd+fd[j] :
525 -1-(g_off+f[i]*nfd+(-1-fd[j]));
536 ", SDim = " << SDim <<
" is not supported");
552 mfem_error (
"LinearFECollection: unknown geometry type.");
569 mfem_error (
"LinearFECollection: unknown geometry type.");
594 mfem_error (
"QuadraticFECollection: unknown geometry type.");
611 mfem_error (
"QuadraticFECollection: unknown geometry type.");
619 static int indexes[] = { 0 };
634 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
647 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
655 static int indexes[] = { 0 };
674 mfem_error (
"CubicFECollection: unknown geometry type.");
691 mfem_error (
"CubicFECollection: unknown geometry type.");
701 static int ind_pos[] = { 0, 1 };
702 static int ind_neg[] = { 1, 0 };
712 static int indexes[] = { 0 };
718 static int sq_ind[8][4] = {{0, 1, 2, 3}, {0, 2, 1, 3},
719 {2, 0, 3, 1}, {1, 0, 3, 2},
720 {3, 2, 1, 0}, {3, 1, 2, 0},
721 {1, 3, 0, 2}, {2, 3, 0, 1}
740 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
754 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
762 static int indexes[] = { 0 };
777 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
791 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
799 static int ind_pos[] = { 0 };
800 static int ind_neg[] = { -1 };
819 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
833 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
841 static int ind_pos[] = { 0, 1 };
842 static int ind_neg[] = { -2, -1 };
860 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
874 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
882 static int ind_pos[] = { 0, 1, 2 };
883 static int ind_neg[] = { -3, -2, -1 };
901 mfem_error (
"Const2DFECollection: unknown geometry type.");
915 mfem_error (
"Const2DFECollection: unknown geometry type.");
936 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
950 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
971 mfem_error (
"GaussLinearDiscont2DFECollection:"
972 " unknown geometry type.");
987 mfem_error (
"GaussLinearDiscont2DFECollection:"
988 " unknown geometry type.");
1005 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
1018 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
1039 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1054 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1074 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1088 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1104 mfem_error (
"GaussQuadraticDiscont2DFECollection:"
1105 " unknown geometry type.");
1120 mfem_error (
"GaussQuadraticDiscont2DFECollection:"
1121 " unknown geometry type.");
1142 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1156 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1179 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1195 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1203 static int indexes[] = { 0 };
1218 mfem_error (
"Const3DFECollection: unknown geometry type.");
1235 mfem_error (
"Const3DFECollection: unknown geometry type.");
1256 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1272 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1293 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1310 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1334 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1350 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1358 static int indexes[] = { 0 };
1372 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1388 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1396 static int ind_pos[] = { 0 };
1397 static int ind_neg[] = { -1 };
1417 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1433 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1441 static int ind_pos[] = { 0 };
1442 static int ind_neg[] = { -1 };
1464 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1479 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1489 static int sq_ind[8][4] =
1491 {0, 1, 2, 3}, {-1, -3, -2, -4},
1492 {2, 0, 3, 1}, {-2, -1, -4, -3},
1493 {3, 2, 1, 0}, {-4, -2, -3, -1},
1494 {1, 3, 0, 2}, {-3, -4, -1, -2}
1508 MFEM_VERIFY(p >= 1,
"H1_FECollection requires order >= 1.");
1509 MFEM_VERIFY(dim >= 0 && dim <= 3,
"H1_FECollection requires 0 <= dim <= 3.");
1511 const int pm1 = p - 1, pm2 = pm1 - 1, pm3 = pm2 - 1, pm4 = pm3 - 1;
1519 snprintf(h1_name, 32,
"H1_%dD_P%d", dim, p);
1524 snprintf(h1_name, 32,
"H1Pos_%dD_P%d", dim, p);
1529 snprintf(h1_name, 32,
"H1Ser_%dD_P%d", dim, p);
1538 snprintf(h1_name, 32,
"H1@%c_%dD_P%d",
1546 H1_Elements[g] = NULL;
1548 for (
int i = 0; i < 2; i++)
1550 SegDofOrd[i] = NULL;
1552 for (
int i = 0; i < 6; i++)
1554 TriDofOrd[i] = NULL;
1556 for (
int i = 0; i < 8; i++)
1558 QuadDofOrd[i] = NULL;
1560 for (
int i = 0; i < 24; i++)
1562 TetDofOrd[i] = NULL;
1580 SegDofOrd[0] =
new int[2*pm1];
1581 SegDofOrd[1] = SegDofOrd[0] + pm1;
1582 for (
int i = 0; i < pm1; i++)
1584 SegDofOrd[0][i] = i;
1585 SegDofOrd[1][i] = pm2 - i;
1618 TriDofOrd[0] =
new int[6*TriDof];
1619 for (
int i = 1; i < 6; i++)
1621 TriDofOrd[i] = TriDofOrd[i-1] + TriDof;
1624 for (
int j = 0; j < pm2; j++)
1626 for (
int i = 0; i + j < pm2; i++)
1628 int o = TriDof - ((pm1 - j)*(pm2 - j))/2 + i;
1629 int k = pm3 - j - i;
1630 TriDofOrd[0][o] = o;
1631 TriDofOrd[1][o] = TriDof - ((pm1-j)*(pm2-j))/2 + k;
1632 TriDofOrd[2][o] = TriDof - ((pm1-i)*(pm2-i))/2 + k;
1633 TriDofOrd[3][o] = TriDof - ((pm1-k)*(pm2-k))/2 + i;
1634 TriDofOrd[4][o] = TriDof - ((pm1-k)*(pm2-k))/2 + j;
1635 TriDofOrd[5][o] = TriDof - ((pm1-i)*(pm2-i))/2 + j;
1639 QuadDofOrd[0] =
new int[8*QuadDof];
1640 for (
int i = 1; i < 8; i++)
1642 QuadDofOrd[i] = QuadDofOrd[i-1] + QuadDof;
1663 for (
int j = 0; j < pm3; j++)
1665 for (
int i = 0; i < pm3; i++)
1668 QuadDofOrd[0][o] = i + j*pm3;
1669 QuadDofOrd[1][o] = j + i*pm3;
1670 QuadDofOrd[2][o] = j + (pm4 - i)*pm3;
1671 QuadDofOrd[3][o] = (pm4 - i) + j*pm3;
1672 QuadDofOrd[4][o] = (pm4 - i) + (pm4 - j)*pm3;
1673 QuadDofOrd[5][o] = (pm4 - j) + (pm4 - i)*pm3;
1674 QuadDofOrd[6][o] = (pm4 - j) + i*pm3;
1675 QuadDofOrd[7][o] = i + (pm4 - j)*pm3;
1683 for (
int j = 0; j < pm1; j++)
1685 for (
int i = 0; i < pm1; i++)
1688 QuadDofOrd[0][o] = i + j*pm1;
1689 QuadDofOrd[1][o] = j + i*pm1;
1690 QuadDofOrd[2][o] = j + (pm2 - i)*pm1;
1691 QuadDofOrd[3][o] = (pm2 - i) + j*pm1;
1692 QuadDofOrd[4][o] = (pm2 - i) + (pm2 - j)*pm1;
1693 QuadDofOrd[5][o] = (pm2 - j) + (pm2 - i)*pm1;
1694 QuadDofOrd[6][o] = (pm2 - j) + i*pm1;
1695 QuadDofOrd[7][o] = i + (pm2 - j)*pm1;
1720 TetDofOrd[0] =
new int[24*TetDof];
1721 for (
int i = 1; i < 24; i++)
1723 TetDofOrd[i] = TetDofOrd[i-1] + TetDof;
1726 for (
int k = 0; k < pm3; k++)
1728 for (
int j = 0; j + k < pm3; j++)
1730 for (
int i = 0; i + j + k < pm3; i++)
1732 int l = pm4 - k - j - i;
1733 int o = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1734 + (j * (2 * p - 5 - j - 2 * k)) / 2 + i;
1735 int o1 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1736 + (k * (2 * p - 5 - k - 2 * j)) / 2 + i;
1737 int o2 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1738 + (k * (2 * p - 5 - k - 2 * i)) / 2 + j;
1739 int o3 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1740 + (i * (2 * p - 5 - i - 2 * k)) / 2 + j;
1741 int o4 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1742 + (i * (2 * p - 5 - i - 2 * j)) / 2 + k;
1743 int o5 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1744 + (j * (2 * p - 5 - j - 2 * i)) / 2 + k;
1745 int o6 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1746 + (l * (2 * p - 5 - l - 2 * k)) / 2 + j;
1747 int o7 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1748 + (k * (2 * p - 5 - k - 2 * l)) / 2 + j;
1749 int o8 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1750 + (j * (2 * p - 5 - j - 2 * l)) / 2 + k;
1751 int o9 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1752 + (l * (2 * p - 5 - l - 2 * j)) / 2 + k;
1753 int o10 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1754 + (k * (2 * p - 5 - k - 2 * j)) / 2 + l;
1755 int o11 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1756 + (j * (2 * p - 5 - j - 2 * k)) / 2 + l;
1757 int o12 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1758 + (l * (2 * p - 5 - l - 2 * i)) / 2 + k;
1759 int o13 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1760 + (i * (2 * p - 5 - i - 2 * l)) / 2 + k;
1761 int o14 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1762 + (i * (2 * p - 5 - i - 2 * k)) / 2 + l;
1763 int o15 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1764 + (k * (2 * p - 5 - k - 2 * i)) / 2 + l;
1765 int o16 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1766 + (k * (2 * p - 5 - k - 2 * l)) / 2 + i;
1767 int o17 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1768 + (l * (2 * p - 5 - l - 2 * k)) / 2 + i;
1769 int o18 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1770 + (j * (2 * p - 5 - j - 2 * i)) / 2 + l;
1771 int o19 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1772 + (i * (2 * p - 5 - i - 2 * j)) / 2 + l;
1773 int o20 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1774 + (l * (2 * p - 5 - l - 2 * j)) / 2 + i;
1775 int o21 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1776 + (j * (2 * p - 5 - j - 2 * l)) / 2 + i;
1777 int o22 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1778 + (i * (2 * p - 5 - i - 2 * l)) / 2 + j;
1779 int o23 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1780 + (l * (2 * p - 5 - l - 2 * i)) / 2 + j;
1781 TetDofOrd[ 0][o] = o;
1782 TetDofOrd[ 1][o] = o1;
1783 TetDofOrd[ 2][o] = o2;
1784 TetDofOrd[ 3][o] = o3;
1785 TetDofOrd[ 4][o] = o4;
1786 TetDofOrd[ 5][o] = o5;
1787 TetDofOrd[ 6][o] = o6;
1788 TetDofOrd[ 7][o] = o7;
1789 TetDofOrd[ 8][o] = o8;
1790 TetDofOrd[ 9][o] = o9;
1791 TetDofOrd[10][o] = o10;
1792 TetDofOrd[11][o] = o11;
1793 TetDofOrd[12][o] = o12;
1794 TetDofOrd[13][o] = o13;
1795 TetDofOrd[14][o] = o14;
1796 TetDofOrd[15][o] = o15;
1797 TetDofOrd[16][o] = o16;
1798 TetDofOrd[17][o] = o17;
1799 TetDofOrd[18][o] = o18;
1800 TetDofOrd[19][o] = o19;
1801 TetDofOrd[20][o] = o20;
1802 TetDofOrd[21][o] = o21;
1803 TetDofOrd[22][o] = o22;
1804 TetDofOrd[23][o] = o23;
1817 return (Or > 0) ? SegDofOrd[0] : SegDofOrd[1];
1821 return TriDofOrd[Or%6];
1825 return QuadDofOrd[Or%8];
1829 return TetDofOrd[Or%24];
1838 if (!strncmp(h1_name,
"H1_", 3))
1840 dim = atoi(h1_name + 3);
1842 else if (!strncmp(h1_name,
"H1Pos_", 6))
1844 dim = atoi(h1_name + 6);
1846 else if (!strncmp(h1_name,
"H1@", 3))
1848 dim = atoi(h1_name + 5);
1855 const int *dof_map = NULL;
1863 ->GetDofMap().GetData();
1866 MFEM_ABORT(
"Geometry type " <<
Geometry::Name[GeomType] <<
" is not "
1876 delete [] SegDofOrd[0];
1877 delete [] TriDofOrd[0];
1878 delete [] QuadDofOrd[0];
1879 delete [] TetDofOrd[0];
1882 delete H1_Elements[g];
1893 snprintf(
h1_name, 32,
"H1_Trace_%dD_P%d", dim, p);
1897 snprintf(
h1_name, 32,
"H1Pos_Trace_%dD_P%d", dim, p);
1901 snprintf(
h1_name, 32,
"H1_Trace@%c_%dD_P%d",
1910 MFEM_VERIFY(p >= 0,
"L2_FECollection requires order >= 0.");
1913 const char *prefix = NULL;
1919 MFEM_ABORT(
"invalid map_type: " << map_type);
1924 snprintf(d_name, 32,
"%s_%dD_P%d", prefix, dim, p);
1927 snprintf(d_name, 32,
"%s_T%d_%dD_P%d", prefix, btype, dim, p);
1932 L2_Elements[g] = NULL;
1933 Tr_Elements[g] = NULL;
1935 for (
int i = 0; i < 2; i++)
1937 SegDofOrd[i] = NULL;
1939 for (
int i = 0; i < 6; i++)
1941 TriDofOrd[i] = NULL;
1943 for (
int i = 0; i < 24; i++)
1945 TetDofOrd[i] = NULL;
1968 const int pp1 = p + 1;
1969 SegDofOrd[0] =
new int[2*pp1];
1970 SegDofOrd[1] = SegDofOrd[0] + pp1;
1971 for (
int i = 0; i <=
p; i++)
1973 SegDofOrd[0][i] = i;
1974 SegDofOrd[1][i] = p - i;
2002 TriDofOrd[0] =
new int[6*TriDof];
2003 for (
int i = 1; i < 6; i++)
2005 TriDofOrd[i] = TriDofOrd[i-1] + TriDof;
2007 const int pp1 = p + 1, pp2 = pp1 + 1;
2008 for (
int j = 0; j <=
p; j++)
2010 for (
int i = 0; i + j <=
p; i++)
2012 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
2014 TriDofOrd[0][o] = o;
2015 TriDofOrd[1][o] = TriDof - ((pp2-j)*(pp1-j))/2 + k;
2016 TriDofOrd[2][o] = TriDof - ((pp2-i)*(pp1-i))/2 + k;
2017 TriDofOrd[3][o] = TriDof - ((pp2-k)*(pp1-k))/2 + i;
2018 TriDofOrd[4][o] = TriDof - ((pp2-k)*(pp1-k))/2 + j;
2019 TriDofOrd[5][o] = TriDof - ((pp2-i)*(pp1-i))/2 + j;
2023 OtherDofOrd =
new int[QuadDof];
2024 for (
int j = 0; j < QuadDof; j++)
2062 const int MaxDof = std::max(TetDof, std::max(PriDof, HexDof));
2064 TetDofOrd[0] =
new int[24*TetDof];
2065 for (
int i = 1; i < 24; i++)
2067 TetDofOrd[i] = TetDofOrd[i-1] + TetDof;
2070 const int pp1 = p + 1, pp2 = pp1 + 1, pp3 = pp2 + 1;
2071 for (
int k = 0; k <=
p; k++)
2073 for (
int j = 0; j + k <=
p; j++)
2075 for (
int i = 0; i + j + k <=
p; i++)
2077 int l = p - k - j - i;
2078 int o = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2079 + (j * (2 * p + 3 - j - 2 * k)) / 2 + i;
2080 int o1 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2081 + (k * (2 * p + 3 - k - 2 * j)) / 2 + i;
2082 int o2 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2083 + (k * (2 * p + 3 - k - 2 * i)) / 2 + j;
2084 int o3 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2085 + (i * (2 * p + 3 - i - 2 * k)) / 2 + j;
2086 int o4 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2087 + (i * (2 * p + 3 - i - 2 * j)) / 2 + k;
2088 int o5 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2089 + (j * (2 * p + 3 - j - 2 * i)) / 2 + k;
2090 int o6 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2091 + (l * (2 * p + 3 - l - 2 * k)) / 2 + j;
2092 int o7 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2093 + (k * (2 * p + 3 - k - 2 * l)) / 2 + j;
2094 int o8 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2095 + (j * (2 * p + 3 - j - 2 * l)) / 2 + k;
2096 int o9 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2097 + (l * (2 * p + 3 - l - 2 * j)) / 2 + k;
2098 int o10 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2099 + (k * (2 * p + 3 - k - 2 * j)) / 2 + l;
2100 int o11 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2101 + (j * (2 * p + 3 - j - 2 * k)) / 2 + l;
2102 int o12 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2103 + (l * (2 * p + 3 - l - 2 * i)) / 2 + k;
2104 int o13 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2105 + (i * (2 * p + 3 - i - 2 * l)) / 2 + k;
2106 int o14 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2107 + (i * (2 * p + 3 - i - 2 * k)) / 2 + l;
2108 int o15 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2109 + (k * (2 * p + 3 - k - 2 * i)) / 2 + l;
2110 int o16 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2111 + (k * (2 * p + 3 - k - 2 * l)) / 2 + i;
2112 int o17 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2113 + (l * (2 * p + 3 - l - 2 * k)) / 2 + i;
2114 int o18 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2115 + (j * (2 * p + 3 - j - 2 * i)) / 2 + l;
2116 int o19 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2117 + (i * (2 * p + 3 - i - 2 * j)) / 2 + l;
2118 int o20 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2119 + (l * (2 * p + 3 - l - 2 * j)) / 2 + i;
2120 int o21 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2121 + (j * (2 * p + 3 - j - 2 * l)) / 2 + i;
2122 int o22 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2123 + (i * (2 * p + 3 - i - 2 * l)) / 2 + j;
2124 int o23 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2125 + (l * (2 * p + 3 - l - 2 * i)) / 2 + j;
2126 TetDofOrd[ 0][o] = o;
2127 TetDofOrd[ 1][o] = o1;
2128 TetDofOrd[ 2][o] = o2;
2129 TetDofOrd[ 3][o] = o3;
2130 TetDofOrd[ 4][o] = o4;
2131 TetDofOrd[ 5][o] = o5;
2132 TetDofOrd[ 6][o] = o6;
2133 TetDofOrd[ 7][o] = o7;
2134 TetDofOrd[ 8][o] = o8;
2135 TetDofOrd[ 9][o] = o9;
2136 TetDofOrd[10][o] = o10;
2137 TetDofOrd[11][o] = o11;
2138 TetDofOrd[12][o] = o12;
2139 TetDofOrd[13][o] = o13;
2140 TetDofOrd[14][o] = o14;
2141 TetDofOrd[15][o] = o15;
2142 TetDofOrd[16][o] = o16;
2143 TetDofOrd[17][o] = o17;
2144 TetDofOrd[18][o] = o18;
2145 TetDofOrd[19][o] = o19;
2146 TetDofOrd[20][o] = o20;
2147 TetDofOrd[21][o] = o21;
2148 TetDofOrd[22][o] = o22;
2149 TetDofOrd[23][o] = o23;
2153 OtherDofOrd =
new int[MaxDof];
2154 for (
int j = 0; j < MaxDof; j++)
2161 mfem::err <<
"L2_FECollection::L2_FECollection : dim = "
2173 return (Or > 0) ? SegDofOrd[0] : SegDofOrd[1];
2176 return TriDofOrd[Or%6];
2179 return TetDofOrd[Or%24];
2182 return (Or == 0) ? OtherDofOrd : NULL;
2188 delete [] OtherDofOrd;
2189 delete [] SegDofOrd[0];
2190 delete [] TriDofOrd[0];
2191 delete [] TetDofOrd[0];
2194 delete L2_Elements[i];
2195 delete Tr_Elements[i];
2201 const int cb_type,
const int ob_type)
2204 MFEM_VERIFY(p >= 0,
"RT_FECollection requires order >= 0.");
2212 MFEM_ABORT(
"unknown closed BasisType: " << cb_name);
2217 MFEM_ABORT(
"unknown open BasisType: " << ob_name);
2225 snprintf(
rt_name, 32,
"RT_%dD_P%d", dim, p);
2233 const int pp1 = p + 1;
2256 MFEM_ABORT(
"invalid dim = " << dim);
2263 const bool signs,
const int ob_type)
2270 MFEM_ABORT(
"Invalid open basis type: " << ob_name);
2281 "invalid open point type");
2283 const int pp1 = p + 1, pp2 = p + 2;
2291 for (
int i = 0; i < 2; i++)
2295 for (
int i = 0; i < 6; i++)
2299 for (
int i = 0; i < 8; i++)
2313 for (
int i = 0; i <=
p; i++)
2316 SegDofOrd[1][i] = signs ? (-1 - (p - i)) : (p - i);
2333 for (
int i = 1; i < 6; i++)
2339 for (
int j = 0; j <=
p; j++)
2341 for (
int i = 0; i + j <=
p; i++)
2343 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
2346 TriDofOrd[1][o] = -1-(TriDof-((pp2-j)*(pp1-j))/2+k);
2347 TriDofOrd[2][o] = TriDof-((pp2-i)*(pp1-i))/2+k;
2348 TriDofOrd[3][o] = -1-(TriDof-((pp2-k)*(pp1-k))/2+i);
2349 TriDofOrd[4][o] = TriDof-((pp2-k)*(pp1-k))/2+j;
2350 TriDofOrd[5][o] = -1-(TriDof-((pp2-i)*(pp1-i))/2+j);
2353 for (
int k = 1; k < 6; k += 2)
2355 TriDofOrd[k][o] = -1 - TriDofOrd[k][o];
2363 for (
int i = 1; i < 8; i++)
2368 for (
int j = 0; j <=
p; j++)
2370 for (
int i = 0; i <=
p; i++)
2377 QuadDofOrd[4][o] = (p - i) + (p - j)*pp1;
2378 QuadDofOrd[5][o] = -1 - ((p - j) + (p - i)*pp1);
2379 QuadDofOrd[6][o] = (p - j) + i*pp1;
2380 QuadDofOrd[7][o] = -1 - (i + (p - j)*pp1);
2383 for (
int k = 1; k < 8; k += 2)
2385 QuadDofOrd[k][o] = -1 - QuadDofOrd[k][o];
2414 if (!strncmp(
rt_name,
"RT_", 3))
2444 const char *prefix =
2446 char ob_str[3] = {
'\0',
'\0',
'\0' };
2453 snprintf(
rt_name, 32,
"%s%s_%dD_P%d", prefix, ob_str, dim, p);
2455 MFEM_VERIFY(dim == 2 || dim == 3,
"Wrong dimension, dim = " << dim);
2464 MFEM_VERIFY(dim == 2 || dim == 3,
"Wrong dimension, dim = " << dim);
2466 const char *prefix =
2470 snprintf(
rt_name, 32,
"%s_%dD_P%d", prefix, dim, p);
2474 snprintf(
rt_name, 32,
"%s@%c_%dD_P%d", prefix,
2480 const int cb_type,
const int ob_type)
2482 MFEM_VERIFY(p >= 1,
"ND_FECollection requires order >= 1.");
2483 MFEM_VERIFY(dim >= 1 && dim <= 3,
"ND_FECollection requires 1 <= dim <= 3.");
2485 const int pm1 = p - 1, pm2 = p - 2;
2490 snprintf(
nd_name, 32,
"ND_%dD_P%d", dim, p);
2503 for (
int i = 0; i < 2; i++)
2507 for (
int i = 0; i < 6; i++)
2511 for (
int i = 0; i < 8; i++)
2523 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
2528 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
2538 for (
int i = 0; i <
p; i++)
2557 for (
int i = 1; i < 8; i++)
2562 for (
int j = 0; j < pm1; j++)
2564 for (
int i = 0; i <
p; i++)
2567 int d2 = p*pm1 + j + i*pm1;
2577 QuadDofOrd[2][d1] = -1 - (p*pm1 + j + (pm1 - i)*pm1);
2581 QuadDofOrd[3][d2] = p*pm1 + (pm2 - j) + i*pm1;
2583 QuadDofOrd[4][d1] = -1 - ((pm1 - i) + (pm2 - j)*
p);
2584 QuadDofOrd[4][d2] = -1 - (p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2586 QuadDofOrd[5][d1] = -1 - (p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2587 QuadDofOrd[5][d2] = -1 - ((pm1 - i) + (pm2 - j)*
p);
2591 QuadDofOrd[6][d1] = p*pm1 + (pm2 - j) + i*pm1;
2592 QuadDofOrd[6][d2] = -1 - ((pm1 - i) + j*p);
2594 QuadDofOrd[7][d1] = i + (pm2 - j)*p;
2595 QuadDofOrd[7][d2] = -1 - (p*pm1 + j + (pm1 - i)*pm1);
2601 for (
int i = 1; i < 6; i++)
2607 for (
int j = 0; j <= pm2; j++)
2609 for (
int i = 0; i + j <= pm2; i++)
2611 int k1 = p*pm1 - (p - j)*(pm1 - j) + 2*i;
2612 int k2 = p*pm1 - (p - i)*(pm1 - i) + 2*j;
2647 if (Or != 0 && Or != 5)
2649 MFEM_ABORT(
"triangle face orientation " << Or <<
" is not supported! "
2650 "Use Mesh::ReorientTetMesh to fix it.");
2663 int p,
dim, cb_type, ob_type;
2701 snprintf(
nd_name, 32,
"ND_Trace_%dD_P%d", dim, p);
2705 snprintf(
nd_name, 32,
"ND_Trace@%c%c_%dD_P%d",
2714 snprintf(d_name, 32,
"Local_%s", fe_name);
2716 Local_Element = NULL;
2718 if (!strcmp(fe_name,
"BiCubic2DFiniteElement") ||
2719 !strcmp(fe_name,
"Quad_Q3"))
2724 else if (!strcmp(fe_name,
"Nedelec1HexFiniteElement") ||
2725 !strcmp(fe_name,
"Hex_ND1"))
2730 else if (!strncmp(fe_name,
"H1_", 3))
2735 else if (!strncmp(fe_name,
"H1Pos_", 6))
2740 else if (!strncmp(fe_name,
"L2_", 3))
2747 mfem::err <<
"Local_FECollection::Local_FECollection : fe_name = "
2769 snprintf(name, 16,
"NURBS%i", Order);
2773 snprintf(name, 16,
"NURBS");
2779 delete ParallelepipedFE;
2780 delete QuadrilateralFE;
2793 mfem_error (
"NURBSFECollection: unknown geometry type.");
2800 mfem_error(
"NURBSFECollection::DofForGeometry");
2807 mfem_error(
"NURBSFECollection::DofOrderForOrientation");
2813 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.
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 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...
Arbitrary order L2 elements in 2D utilizing the Bernstein basis on a triangle.
virtual FiniteElementCollection * GetTraceCollection() 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]...
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
Arbitrary order L2 elements in 3D on a cube.
virtual ~L2_FECollection()
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]...
Arbitrary 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.
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.
FiniteElementCollection * GetTraceCollection() 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
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
DG_Interface_FECollection(const int p, const int dim, const int map_type=FiniteElement::VALUE, const int ob_type=BasisType::GaussLegendre)
int HasFaceDofs(Geometry::Type GeomType) const
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]...
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
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]...
void SetMapType(int M)
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 ~RT_FECollection()
L2_FECollection(const int p, const int dim, const int btype=BasisType::GaussLegendre, const int map_type=FiniteElement::VALUE)
Piecewise-(bi)cubic continuous finite elements.
PointFiniteElement PointFE
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
Arbitrary 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)
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...
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_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...
Version of QuadraticDiscont2DFECollection with positive basis functions.
virtual ~ND_FECollection()
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
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]...
FiniteElementCollection * GetTraceCollection() const
Piecewise-constant discontinuous finite elements in 2D. This class is kept only for backward compatib...
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.
class H1_WedgeElement WedgeFE
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
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.
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 H1 elements in 3D on a cube.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
class Linear3DFiniteElement TetrahedronFE
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
Version of LinearDiscont2DFECollection with dofs in the Gaussian points.
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
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
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]...
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
Arbitrary order H1 elements in 2D on a triangle.
Piecewise-linear discontinuous finite elements in 3D. This class is kept only for backward compatibil...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
Arbitrary order L2 elements in 2D on a square.
Arbitrary 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]...
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)
Arbitrary order H1 elements in 1D utilizing the Bernstein basis.
virtual int DofForGeometry(Geometry::Type GeomType) const
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.
Arbitrary order L2 elements in 3D utilizing the Bernstein basis on a cube.
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 H1-conforming (continuous) finite elements.
Second order Raviart-Thomas finite elements in 3D. This class is kept only for backward compatibility...
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...
Serendipity basis (squares / cubes)
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]
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 const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Arbitrary order "L2-conforming" discontinuous finite elements.
double f(const Vector &p)