17 #define snprintf _snprintf_s
32 mfem_error (
"FiniteElementCollection::HasFaceDofs:"
33 " unknown geometry type.");
40 MFEM_ABORT(
"this method is not implemented in this derived class!");
48 if (!strcmp(name,
"Linear"))
52 else if (!strcmp(name,
"Quadratic"))
56 else if (!strcmp(name,
"QuadraticPos"))
60 else if (!strcmp(name,
"Cubic"))
64 else if (!strcmp(name,
"Const3D"))
68 else if (!strcmp(name,
"Const2D"))
72 else if (!strcmp(name,
"LinearDiscont2D"))
76 else if (!strcmp(name,
"GaussLinearDiscont2D"))
80 else if (!strcmp(name,
"P1OnQuad"))
84 else if (!strcmp(name,
"QuadraticDiscont2D"))
88 else if (!strcmp(name,
"QuadraticPosDiscont2D"))
92 else if (!strcmp(name,
"GaussQuadraticDiscont2D"))
96 else if (!strcmp(name,
"CubicDiscont2D"))
100 else if (!strcmp(name,
"LinearDiscont3D"))
104 else if (!strcmp(name,
"QuadraticDiscont3D"))
108 else if (!strcmp(name,
"LinearNonConf3D"))
112 else if (!strcmp(name,
"CrouzeixRaviart"))
116 else if (!strcmp(name,
"ND1_3D"))
120 else if (!strcmp(name,
"RT0_2D"))
124 else if (!strcmp(name,
"RT1_2D"))
128 else if (!strcmp(name,
"RT2_2D"))
132 else if (!strcmp(name,
"RT0_3D"))
136 else if (!strcmp(name,
"RT1_3D"))
140 else if (!strncmp(name,
"H1_Trace_", 9))
144 else if (!strncmp(name,
"H1_", 3))
148 else if (!strncmp(name,
"H1Pos_Trace_", 12))
153 else if (!strncmp(name,
"H1Pos_", 6))
157 else if (!strncmp(name,
"H1_Trace@", 9))
162 else if (!strncmp(name,
"H1@", 3))
167 else if (!strncmp(name,
"L2_T", 4))
170 else if (!strncmp(name,
"L2_", 3))
174 else if (!strncmp(name,
"L2Int_T", 7))
179 else if (!strncmp(name,
"L2Int_", 6))
185 else if (!strncmp(name,
"RT_Trace_", 9))
189 else if (!strncmp(name,
"RT_ValTrace_", 12))
194 else if (!strncmp(name,
"RT_Trace@", 9))
200 else if (!strncmp(name,
"RT_ValTrace@", 12))
206 else if (!strncmp(name,
"DG_Iface_", 9))
210 else if (!strncmp(name,
"DG_Iface@", 9))
216 else if (!strncmp(name,
"DG_IntIface_", 12))
221 else if (!strncmp(name,
"DG_IntIface@", 12))
227 else if (!strncmp(name,
"RT_", 3))
231 else if (!strncmp(name,
"RT@", 3))
237 else if (!strncmp(name,
"ND_Trace_", 9))
241 else if (!strncmp(name,
"ND_", 3))
245 else if (!strncmp(name,
"ND_Trace@", 9))
251 else if (!strncmp(name,
"ND@", 3))
257 else if (!strncmp(name,
"Local_", 6))
261 else if (!strncmp(name,
"NURBS", 5))
268 "Unknown FiniteElementCollection!");
270 MFEM_VERIFY(!strcmp(fec->
Name(), name),
"input name: \"" << name
271 <<
"\" does not match the created collection name: \""
272 << fec->
Name() <<
'"');
277 template <Geometry::Type geom>
282 nv = g_consts::NumVert;
283 ne = g_consts::NumEdges;
286 template <Geometry::Type geom,
typename v_t>
288 GetEdge(
int &nv, v_t &v,
int &ne,
int &e,
int &eo,
const int edge_info)
293 nv = e_consts::NumVert;
297 MFEM_ASSERT(0 <= e && e < g_consts::NumEdges,
"");
298 MFEM_ASSERT(0 <= eo && eo < e_consts::NumOrient,
"");
299 v[0] = g_consts::Edges[e][0];
300 v[1] = g_consts::Edges[e][1];
301 v[0] = e_consts::Orient[eo][v[0]];
302 v[1] = e_consts::Orient[eo][v[1]];
306 typename v_t,
typename e_t,
typename eo_t>
308 GetFace(
int &nv, v_t &v,
int &ne, e_t &e, eo_t &eo,
309 int &nf,
int &f,
int &fg,
int &fo,
const int face_info)
314 nv = f_consts::NumVert;
319 MFEM_ASSERT(0 <= f && f < g_consts::NumFaces,
"");
320 MFEM_ASSERT(0 <= fo && fo < f_consts::NumOrient,
"");
321 for (
int i = 0; i < f_consts::NumVert; i++)
323 v[i] = f_consts::Orient[fo][i];
324 v[i] = g_consts::FaceVert[f][v[i]];
326 ne = f_consts::NumEdges;
327 for (
int i = 0; i < f_consts::NumEdges; i++)
329 int v0 = v[f_consts::Edges[i][0]];
330 int v1 = v[f_consts::Edges[i][1]];
332 if (v0 > v1) { swap(v0, v1); eor = 1; }
333 for (
int j = g_consts::VertToVert::I[v0];
true; j++)
335 MFEM_ASSERT(j < g_consts::VertToVert::I[v0+1],
336 "internal error, edge not found");
337 if (v1 == g_consts::VertToVert::J[j][0])
339 int en = g_consts::VertToVert::J[j][1];
358 "invalid Geom = " << Geom);
360 "invalid SDim = " << SDim <<
366 const int off = nvd*(Info/64);
368 for (
int i = 0; i < nvd; i++)
375 int v[4], e[4], eo[4], f[1], fg[1], fo[1];
376 int av = 0, nv = 0, ae = 0, ne = 0, nf = 0;
382 GetNVE<Geometry::SEGMENT>(av, ae);
383 GetEdge<Geometry::SEGMENT>(nv, v, ne, e[0], eo[0], Info);
389 GetNVE<Geometry::TRIANGLE>(av, ae);
393 GetEdge<Geometry::TRIANGLE>(nv, v, ne, e[0], eo[0], Info);
396 GetFace<Geometry::TRIANGLE,Geometry::TRIANGLE>(
397 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
407 GetNVE<Geometry::SQUARE>(av, ae);
411 GetEdge<Geometry::SQUARE>(nv, v, ne, e[0], eo[0], Info);
414 GetFace<Geometry::SQUARE,Geometry::SQUARE>(
415 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
425 GetNVE<Geometry::TETRAHEDRON>(av, ae);
429 GetEdge<Geometry::TETRAHEDRON>(nv, v, ne, e[0], eo[0], Info);
432 GetFace<Geometry::TETRAHEDRON,Geometry::TRIANGLE>(
433 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
443 GetNVE<Geometry::CUBE>(av, ae);
447 GetEdge<Geometry::CUBE>(nv, v, ne, e[0], eo[0], Info);
450 GetFace<Geometry::CUBE,Geometry::SQUARE>(
451 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
460 MFEM_ABORT(
"invalid Geom = " << Geom);
467 for (
int i = 0; i < nv; i++)
469 for (
int j = 0; j < nvd; j++)
471 dofs[i*nvd+j] = v[i]*nvd+j;
474 int l_off = nv*nvd, g_off = av*nvd;
479 for (
int i = 0; i < ne; i++)
483 for (
int j = 0; j < ned; j++)
485 dofs[l_off+i*ned+j] =
487 g_off+e[i]*ned+ed[j] :
488 -1-(g_off+e[i]*ned+(-1-ed[j]));
498 const int nfd = DofForGeometry(fg[0]);
500 for (
int i = 0; i < nf; i++)
502 const int *fd = DofOrderForOrientation(fg[i], fo[i]);
503 for (
int j = 0; j < nfd; j++)
505 dofs[l_off+i*nfd+j] =
507 g_off+f[i]*nfd+fd[j] :
508 -1-(g_off+f[i]*nfd+(-1-fd[j]));
519 ", SDim = " << SDim <<
" is not supported");
534 mfem_error (
"LinearFECollection: unknown geometry type.");
550 mfem_error (
"LinearFECollection: unknown geometry type.");
573 mfem_error (
"QuadraticFECollection: unknown geometry type.");
589 mfem_error (
"QuadraticFECollection: unknown geometry type.");
596 static int indexes[] = { 0 };
610 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
623 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
631 static int indexes[] = { 0 };
649 mfem_error (
"CubicFECollection: unknown geometry type.");
665 mfem_error (
"CubicFECollection: unknown geometry type.");
674 static int ind_pos[] = { 0, 1 };
675 static int ind_neg[] = { 1, 0 };
685 static int indexes[] = { 0 };
691 static int sq_ind[8][4] = {{0, 1, 2, 3}, {0, 2, 1, 3},
692 {2, 0, 3, 1}, {1, 0, 3, 2},
693 {3, 2, 1, 0}, {3, 1, 2, 0},
694 {1, 3, 0, 2}, {2, 3, 0, 1}
712 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
726 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
734 static int indexes[] = { 0 };
749 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
763 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
771 static int ind_pos[] = { 0 };
772 static int ind_neg[] = { -1 };
791 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
805 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
813 static int ind_pos[] = { 0, 1 };
814 static int ind_neg[] = { -2, -1 };
832 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
846 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
854 static int ind_pos[] = { 0, 1, 2 };
855 static int ind_neg[] = { -3, -2, -1 };
873 mfem_error (
"Const2DFECollection: unknown geometry type.");
887 mfem_error (
"Const2DFECollection: unknown geometry type.");
907 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
921 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
941 mfem_error (
"GaussLinearDiscont2DFECollection:"
942 " unknown geometry type.");
956 mfem_error (
"GaussLinearDiscont2DFECollection:"
957 " unknown geometry type.");
963 int GeomType,
int Or)
const
974 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
987 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
993 int GeomType,
int Or)
const
1007 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1021 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1027 int GeomType,
int Or)
const
1040 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1053 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1068 mfem_error (
"GaussQuadraticDiscont2DFECollection:"
1069 " unknown geometry type.");
1083 mfem_error (
"GaussQuadraticDiscont2DFECollection:"
1084 " unknown geometry type.");
1090 int GeomType,
int Or)
const
1104 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1118 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1140 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1156 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1164 static int indexes[] = { 0 };
1178 mfem_error (
"Const3DFECollection: unknown geometry type.");
1194 mfem_error (
"Const3DFECollection: unknown geometry type.");
1214 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1230 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1250 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1266 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1272 int GeomType,
int Or)
const
1289 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1305 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1313 static int indexes[] = { 0 };
1327 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1343 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1351 static int ind_pos[] = { 0 };
1352 static int ind_neg[] = { -1 };
1372 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1388 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1396 static int ind_pos[] = { 0 };
1397 static int ind_neg[] = { -1 };
1419 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1434 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1444 static int sq_ind[8][4] =
1446 {0, 1, 2, 3}, {-1, -3, -2, -4},
1447 {2, 0, 3, 1}, {-2, -1, -4, -3},
1448 {3, 2, 1, 0}, {-4, -2, -3, -1},
1449 {1, 3, 0, 2}, {-3, -4, -1, -2}
1463 const int pm1 = p - 1, pm2 = pm1 - 1, pm3 = pm2 - 1;
1471 snprintf(h1_name, 32,
"H1_%dD_P%d", dim, p);
1476 snprintf(h1_name, 32,
"H1Pos_%dD_P%d", dim, p);
1485 snprintf(h1_name, 32,
"H1@%c_%dD_P%d",
1493 H1_Elements[g] = NULL;
1495 for (
int i = 0; i < 2; i++)
1497 SegDofOrd[i] = NULL;
1499 for (
int i = 0; i < 6; i++)
1501 TriDofOrd[i] = NULL;
1503 for (
int i = 0; i < 8; i++)
1505 QuadDofOrd[i] = NULL;
1523 SegDofOrd[0] =
new int[2*pm1];
1524 SegDofOrd[1] = SegDofOrd[0] + pm1;
1525 for (
int i = 0; i < pm1; i++)
1527 SegDofOrd[0][i] = i;
1528 SegDofOrd[1][i] = pm2 - i;
1549 TriDofOrd[0] =
new int[6*TriDof];
1550 for (
int i = 1; i < 6; i++)
1552 TriDofOrd[i] = TriDofOrd[i-1] + TriDof;
1555 for (
int j = 0; j < pm2; j++)
1557 for (
int i = 0; i + j < pm2; i++)
1559 int o = TriDof - ((pm1 - j)*(pm2 - j))/2 + i;
1560 int k = pm3 - j - i;
1561 TriDofOrd[0][o] = o;
1562 TriDofOrd[1][o] = TriDof - ((pm1-j)*(pm2-j))/2 + k;
1563 TriDofOrd[2][o] = TriDof - ((pm1-i)*(pm2-i))/2 + k;
1564 TriDofOrd[3][o] = TriDof - ((pm1-k)*(pm2-k))/2 + i;
1565 TriDofOrd[4][o] = TriDof - ((pm1-k)*(pm2-k))/2 + j;
1566 TriDofOrd[5][o] = TriDof - ((pm1-i)*(pm2-i))/2 + j;
1570 QuadDofOrd[0] =
new int[8*QuadDof];
1571 for (
int i = 1; i < 8; i++)
1573 QuadDofOrd[i] = QuadDofOrd[i-1] + QuadDof;
1576 for (
int j = 0; j < pm1; j++)
1578 for (
int i = 0; i < pm1; i++)
1581 QuadDofOrd[0][o] = i + j*pm1;
1582 QuadDofOrd[1][o] = j + i*pm1;
1583 QuadDofOrd[2][o] = j + (pm2 - i)*pm1;
1584 QuadDofOrd[3][o] = (pm2 - i) + j*pm1;
1585 QuadDofOrd[4][o] = (pm2 - i) + (pm2 - j)*pm1;
1586 QuadDofOrd[5][o] = (pm2 - j) + (pm2 - i)*pm1;
1587 QuadDofOrd[6][o] = (pm2 - j) + i*pm1;
1588 QuadDofOrd[7][o] = i + (pm2 - j)*pm1;
1615 return (Or > 0) ? SegDofOrd[0] : SegDofOrd[1];
1619 return TriDofOrd[Or%6];
1623 return QuadDofOrd[Or%8];
1632 if (!strncmp(h1_name,
"H1_", 3))
1634 dim = atoi(h1_name + 3);
1636 else if (!strncmp(h1_name,
"H1Pos_", 6))
1638 dim = atoi(h1_name + 6);
1640 else if (!strncmp(h1_name,
"H1@", 3))
1642 dim = atoi(h1_name + 5);
1650 const int *dof_map = NULL;
1656 ->GetDofMap().GetData();
1660 ->GetDofMap().GetData();
1664 ->GetDofMap().GetData();
1667 MFEM_ABORT(
"Geometry type " <<
Geometry::Name[GeomType] <<
" is not "
1675 delete [] SegDofOrd[0];
1676 delete [] TriDofOrd[0];
1677 delete [] QuadDofOrd[0];
1680 delete H1_Elements[g];
1691 snprintf(
h1_name, 32,
"H1_Trace_%dD_P%d", dim, p);
1695 snprintf(
h1_name, 32,
"H1Pos_Trace_%dD_P%d", dim, p);
1699 snprintf(
h1_name, 32,
"H1_Trace@%c_%dD_P%d",
1713 const char *prefix = NULL;
1719 MFEM_ABORT(
"invalid map_type: " << map_type);
1724 snprintf(d_name, 32,
"%s_%dD_P%d", prefix, dim, p);
1727 snprintf(d_name, 32,
"%s_T%d_%dD_P%d", prefix, type, dim, p);
1732 L2_Elements[g] = NULL;
1733 Tr_Elements[g] = NULL;
1735 for (
int i = 0; i < 2; i++)
1737 SegDofOrd[i] = NULL;
1739 for (
int i = 0; i < 6; i++)
1741 TriDofOrd[i] = NULL;
1760 const int pp1 = p + 1;
1761 SegDofOrd[0] =
new int[2*pp1];
1762 SegDofOrd[1] = SegDofOrd[0] + pp1;
1763 for (
int i = 0; i <= p; i++)
1765 SegDofOrd[0][i] = i;
1766 SegDofOrd[1][i] = p - i;
1787 TriDofOrd[0] =
new int[6*TriDof];
1788 for (
int i = 1; i < 6; i++)
1790 TriDofOrd[i] = TriDofOrd[i-1] + TriDof;
1792 const int pp1 = p + 1, pp2 = pp1 + 1;
1793 for (
int j = 0; j <= p; j++)
1795 for (
int i = 0; i + j <= p; i++)
1797 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
1799 TriDofOrd[0][o] = o;
1800 TriDofOrd[1][o] = TriDof - ((pp2-j)*(pp1-j))/2 + k;
1801 TriDofOrd[2][o] = TriDof - ((pp2-i)*(pp1-i))/2 + k;
1802 TriDofOrd[3][o] = TriDof - ((pp2-k)*(pp1-k))/2 + i;
1803 TriDofOrd[4][o] = TriDof - ((pp2-k)*(pp1-k))/2 + j;
1804 TriDofOrd[5][o] = TriDof - ((pp2-i)*(pp1-i))/2 + j;
1808 OtherDofOrd =
new int[QuadDof];
1809 for (
int j = 0; j < QuadDof; j++)
1835 const int MaxDof = std::max(TetDof, HexDof);
1836 OtherDofOrd =
new int[MaxDof];
1837 for (
int j = 0; j < MaxDof; j++)
1844 cerr <<
"L2_FECollection::L2_FECollection : dim = "
1855 return (Or > 0) ? SegDofOrd[0] : SegDofOrd[1];
1858 return TriDofOrd[Or%6];
1861 return (Or == 0) ? OtherDofOrd : NULL;
1867 delete [] OtherDofOrd;
1868 delete [] SegDofOrd[0];
1869 delete [] TriDofOrd[0];
1872 delete L2_Elements[i];
1873 delete Tr_Elements[i];
1879 const int cb_type,
const int ob_type)
1888 MFEM_ABORT(
"unknown closed BasisType: " << cb_name);
1893 MFEM_ABORT(
"unknown open BasisType: " << ob_name);
1901 snprintf(
rt_name, 32,
"RT_%dD_P%d", dim, p);
1909 const int pp1 = p + 1;
1932 MFEM_ABORT(
"invalid dim = " << dim);
1939 const bool signs,
const int ob_type)
1946 MFEM_ABORT(
"Invalid open basis type: " << ob_name);
1957 "invalid open point type");
1959 const int pp1 = p + 1, pp2 = p + 2;
1967 for (
int i = 0; i < 2; i++)
1971 for (
int i = 0; i < 6; i++)
1975 for (
int i = 0; i < 8; i++)
1989 for (
int i = 0; i <= p; i++)
1992 SegDofOrd[1][i] = signs ? (-1 - (p - i)) : (p - i);
2009 for (
int i = 1; i < 6; i++)
2015 for (
int j = 0; j <= p; j++)
2017 for (
int i = 0; i + j <= p; i++)
2019 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
2022 TriDofOrd[1][o] = -1-(TriDof-((pp2-j)*(pp1-j))/2+k);
2023 TriDofOrd[2][o] = TriDof-((pp2-i)*(pp1-i))/2+k;
2024 TriDofOrd[3][o] = -1-(TriDof-((pp2-k)*(pp1-k))/2+i);
2025 TriDofOrd[4][o] = TriDof-((pp2-k)*(pp1-k))/2+j;
2026 TriDofOrd[5][o] = -1-(TriDof-((pp2-i)*(pp1-i))/2+j);
2029 for (
int k = 1; k < 6; k += 2)
2031 TriDofOrd[k][o] = -1 - TriDofOrd[k][o];
2039 for (
int i = 1; i < 8; i++)
2044 for (
int j = 0; j <= p; j++)
2046 for (
int i = 0; i <= p; i++)
2053 QuadDofOrd[4][o] = (p - i) + (p - j)*pp1;
2054 QuadDofOrd[5][o] = -1 - ((p - j) + (p - i)*pp1);
2055 QuadDofOrd[6][o] = (p - j) + i*pp1;
2056 QuadDofOrd[7][o] = -1 - (i + (p - j)*pp1);
2059 for (
int k = 1; k < 8; k += 2)
2061 QuadDofOrd[k][o] = -1 - QuadDofOrd[k][o];
2089 if (!strncmp(
rt_name,
"RT_", 3))
2119 const char *prefix =
2121 char ob_str[3] = {
'\0',
'\0',
'\0' };
2128 snprintf(
rt_name, 32,
"%s%s_%dD_P%d", prefix, ob_str, dim, p);
2130 MFEM_VERIFY(dim == 2 || dim == 3,
"Wrong dimension, dim = " << dim);
2139 MFEM_VERIFY(dim == 2 || dim == 3,
"Wrong dimension, dim = " << dim);
2141 const char *prefix =
2145 snprintf(
rt_name, 32,
"%s_%dD_P%d", prefix, dim, p);
2149 snprintf(
rt_name, 32,
"%s@%c_%dD_P%d", prefix,
2155 const int cb_type,
const int ob_type)
2157 const int pm1 = p - 1, pm2 = p - 2;
2162 snprintf(
nd_name, 32,
"ND_%dD_P%d", dim, p);
2175 for (
int i = 0; i < 2; i++)
2179 for (
int i = 0; i < 6; i++)
2183 for (
int i = 0; i < 8; i++)
2195 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
2200 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
2210 for (
int i = 0; i < p; i++)
2229 for (
int i = 1; i < 8; i++)
2234 for (
int j = 0; j < pm1; j++)
2236 for (
int i = 0; i < p; i++)
2239 int d2 = p*pm1 + j + i*pm1;
2249 QuadDofOrd[2][d1] = -1 - (p*pm1 + j + (pm1 - i)*pm1);
2253 QuadDofOrd[3][d2] = p*pm1 + (pm2 - j) + i*pm1;
2255 QuadDofOrd[4][d1] = -1 - ((pm1 - i) + (pm2 - j)*p);
2256 QuadDofOrd[4][d2] = -1 - (p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2258 QuadDofOrd[5][d1] = -1 - (p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2259 QuadDofOrd[5][d2] = -1 - ((pm1 - i) + (pm2 - j)*p);
2263 QuadDofOrd[6][d1] = p*pm1 + (pm2 - j) + i*pm1;
2264 QuadDofOrd[6][d2] = -1 - ((pm1 - i) + j*p);
2266 QuadDofOrd[7][d1] = i + (pm2 - j)*p;
2267 QuadDofOrd[7][d2] = -1 - (p*pm1 + j + (pm1 - i)*pm1);
2273 for (
int i = 1; i < 6; i++)
2279 for (
int j = 0; j <= pm2; j++)
2281 for (
int i = 0; i + j <= pm2; i++)
2283 int k1 = p*pm1 - (p - j)*(pm1 - j) + 2*i;
2284 int k2 = p*pm1 - (p - i)*(pm1 - i) + 2*j;
2318 if (Or != 0 && Or != 5)
2320 MFEM_ABORT(
"ND_FECollection::DofOrderForOrientation: "
2321 "triangle face orientation " << Or <<
" is not supported! "
2322 "Use Mesh::ReorientTetMesh to fix it.");
2335 int p,
dim, cb_type, ob_type;
2373 snprintf(
nd_name, 32,
"ND_Trace_%dD_P%d", dim, p);
2377 snprintf(
nd_name, 32,
"ND_Trace@%c%c_%dD_P%d",
2386 snprintf(d_name, 32,
"Local_%s", fe_name);
2388 Local_Element = NULL;
2390 if (!strcmp(fe_name,
"BiCubic2DFiniteElement") ||
2391 !strcmp(fe_name,
"Quad_Q3"))
2396 else if (!strcmp(fe_name,
"Nedelec1HexFiniteElement") ||
2397 !strcmp(fe_name,
"Hex_ND1"))
2402 else if (!strncmp(fe_name,
"H1_", 3))
2407 else if (!strncmp(fe_name,
"H1Pos_", 6))
2412 else if (!strncmp(fe_name,
"L2_", 3))
2419 cerr <<
"Local_FECollection::Local_FECollection : fe_name = "
2426 void NURBSFECollection::Allocate(
int Order)
2432 snprintf(name, 16,
"NURBS%i", Order);
2435 void NURBSFECollection::Deallocate()
2437 delete ParallelepipedFE;
2438 delete QuadrilateralFE;
2442 const FiniteElement *
2451 mfem_error (
"NURBSFECollection: unknown geometry type.");
2458 mfem_error(
"NURBSFECollection::DofForGeometry");
2464 mfem_error(
"NURBSFECollection::DofOrderForOrientation");
2470 MFEM_ABORT(
"NURBS finite elements can not be statically condensed!");
Abstract class for Finite Elements.
Arbitrary order non-uniform rational B-splines (NURBS) finite elements.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
int Size() const
Logical size of the array.
Version of QuadraticDiscont2DFECollection with dofs in the Gaussian points.
int RT_dof[Geometry::NumGeom]
FiniteElement * ND_Elements[Geometry::NumGeom]
virtual int * DofOrderForOrientation(int GeomType, int Or) const
static int Check(int b_type)
If the input does not represents a valid BasisType, abort with an error; otherwise return the input...
virtual FiniteElementCollection * GetTraceCollection() const
void SubDofOrder(int Geom, int SDim, int Info, Array< int > &dofs) const
Get the local dofs for a given sub-manifold.
RT_FECollection(const int p, const int dim, const int map_type, const bool signs, const int ob_type=BasisType::GaussLegendre)
virtual int DofForGeometry(int GeomType) const
FiniteElementCollection * GetTraceCollection() const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
H1_FECollection(const int p, const int dim=3, const int type=BasisType::GaussLobatto)
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual ~L2_FECollection()
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual int DofForGeometry(int GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
Piecewise-(bi)linear continuous finite elements.
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
static int GetQuadrature1D(int b_type)
Get the corresponding Quadrature1D constant, when that makes sense; otherwise return Quadrature1D::In...
virtual int DofForGeometry(int GeomType) const
FiniteElementCollection * GetTraceCollection() const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int DofForGeometry(int GeomType) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
void InitFaces(const int p, const int dim, const int map_type, const bool signs)
H1_Trace_FECollection(const int p, const int dim, const int type=BasisType::GaussLobatto)
FiniteElementCollection * GetTraceCollection() const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
DG_Interface_FECollection(const int p, const int dim, const int map_type=FiniteElement::VALUE, const int ob_type=BasisType::GaussLegendre)
static const char * Name(int b_type)
Check and convert a BasisType constant to a string identifier.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual int DofForGeometry(int GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
static int GetType(char b_ident)
Convert char basis identifier to a BasisType constant.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual int DofForGeometry(int GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual ~RT_FECollection()
virtual int DofForGeometry(int GeomType) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
Piecewise-(bi)cubic continuous finite elements.
virtual int * DofOrderForOrientation(int GeomType, int Or) const
PointFiniteElement PointFE
virtual int DofForGeometry(int GeomType) const
FiniteElement * RT_Elements[Geometry::NumGeom]
static const int Dimension[NumGeom]
static void GetNVE(int &nv, int &ne)
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int DofForGeometry(int GeomType) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int DofForGeometry(int GeomType) const
virtual int DofForGeometry(int GeomType) const
ND_Trace_FECollection(const int p, const int dim, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
TriLinear3DFiniteElement HexahedronFE
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.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
Version of QuadraticDiscont2DFECollection with positive basis functions.
virtual ~ND_FECollection()
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
For scalar fields; preserves point values.
const int * GetDofMap(int GeomType) const
Get the Cartesian to local H1 dof map.
virtual int DofForGeometry(int GeomType) const
For scalar fields; preserves volume integrals.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
Version of QuadraticFECollection with positive basis functions.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual int DofForGeometry(int GeomType) const
virtual ~H1_FECollection()
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
FiniteElementCollection * GetTraceCollection() const
static const char * Name[NumGeom]
Piecewise-linear nonconforming finite elements in 3D.
virtual int * DofOrderForOrientation(int GeomType, int Or) const
Crouzeix-Raviart nonconforming elements in 2D.
Arbitrary order H(div)-conforming Raviart-Thomas finite elements.
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int DofForGeometry(int GeomType) const
static void GetEdge(int &nv, v_t &v, int &ne, int &e, int &eo, const int edge_info)
virtual int DofForGeometry(int GeomType) const
static int CheckClosed(int type)
If the Quadrature1D type is not closed return Invalid; otherwise return type.
virtual int DofForGeometry(int GeomType) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
int GetDof() const
Returns the number of degrees of freedom in the finite element.
void mfem_error(const char *msg)
void SetSize(int nsize)
Change logical size of the array, keep existing entries.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
Linear3DFiniteElement TetrahedronFE
virtual int DofForGeometry(int GeomType) const
Linear2DFiniteElement TriangleFE
static int CheckOpen(int type)
If the Quadrature1D type is not open return Invalid; otherwise return type.
virtual int DofForGeometry(int GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual int DofForGeometry(int GeomType) const
Version of LinearDiscont2DFECollection with dofs in the Gaussian points.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
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 int * DofOrderForOrientation(int GeomType, int Or) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual const char * Name() const
virtual int DofForGeometry(int GeomType) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
RT_Trace_FECollection(const int p, const int dim, const int map_type=FiniteElement::INTEGRAL, const int ob_type=BasisType::GaussLegendre)
Piecewise-(bi)quadratic continuous finite elements.
int HasFaceDofs(int GeomType) const
Arbitrary order H(curl)-conforming Nedelec finite elements.
static void GetFace(int &nv, v_t &v, int &ne, e_t &e, eo_t &eo, int &nf, int &f, int &fg, int &fo, const int face_info)
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
L2_FECollection(const int p, const int dim, const int type=BasisType::GaussLegendre, const int map_type=FiniteElement::VALUE)
Arbitrary order H1-conforming (continuous) finite elements.
virtual int DofForGeometry(int GeomType) const
Local_FECollection(const char *fe_name)
BiLinear2DFiniteElement QuadrilateralFE
virtual int DofForGeometry(int GeomType) const
virtual int DofForGeometry(int GeomType) const
Linear (P1) finite elements on quadrilaterals.
virtual int DofForGeometry(int GeomType) const
Linear1DFiniteElement SegmentFE
int ND_dof[Geometry::NumGeom]
virtual int DofForGeometry(int GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
Arbitrary order "L2-conforming" discontinuous finite elements.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const