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_Trace@", 9))
149 else if (!strncmp(name,
"H1_", 3))
153 else if (!strncmp(name,
"H1Pos_Trace_", 12))
158 else if (!strncmp(name,
"H1Pos_", 6))
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_Trace@", 9))
247 else if (!strncmp(name,
"ND_", 3))
251 else if (!strncmp(name,
"ND@", 3))
257 else if (!strncmp(name,
"Local_", 6))
261 else if (!strncmp(name,
"NURBS", 5))
276 MFEM_ABORT(
"unknown FiniteElementCollection: " << name);
278 MFEM_VERIFY(!strcmp(fec->
Name(), name),
"input name: \"" << name
279 <<
"\" does not match the created collection name: \""
280 << fec->
Name() <<
'"');
285 template <Geometry::Type geom>
290 nv = g_consts::NumVert;
291 ne = g_consts::NumEdges;
294 template <Geometry::Type geom,
typename v_t>
296 GetEdge(
int &nv, v_t &v,
int &ne,
int &e,
int &eo,
const int edge_info)
301 nv = e_consts::NumVert;
305 MFEM_ASSERT(0 <= e && e < g_consts::NumEdges,
"");
306 MFEM_ASSERT(0 <= eo && eo < e_consts::NumOrient,
"");
307 v[0] = g_consts::Edges[e][0];
308 v[1] = g_consts::Edges[e][1];
309 v[0] = e_consts::Orient[eo][v[0]];
310 v[1] = e_consts::Orient[eo][v[1]];
314 typename v_t,
typename e_t,
typename eo_t>
316 GetFace(
int &nv, v_t &v,
int &ne, e_t &e, eo_t &eo,
317 int &nf,
int &f,
int &fg,
int &fo,
const int face_info)
322 nv = f_consts::NumVert;
327 MFEM_ASSERT(0 <= f && f < g_consts::NumFaces,
"");
328 MFEM_ASSERT(0 <= fo && fo < f_consts::NumOrient,
"");
329 for (
int i = 0; i < f_consts::NumVert; i++)
331 v[i] = f_consts::Orient[fo][i];
332 v[i] = g_consts::FaceVert[f][v[i]];
334 ne = f_consts::NumEdges;
335 for (
int i = 0; i < f_consts::NumEdges; i++)
337 int v0 = v[f_consts::Edges[i][0]];
338 int v1 = v[f_consts::Edges[i][1]];
340 if (v0 > v1) { swap(v0, v1); eor = 1; }
341 for (
int j = g_consts::VertToVert::I[v0];
true; j++)
343 MFEM_ASSERT(j < g_consts::VertToVert::I[v0+1],
344 "internal error, edge not found");
345 if (v1 == g_consts::VertToVert::J[j][0])
347 int en = g_consts::VertToVert::J[j][1];
366 "invalid Geom = " << Geom);
368 "invalid SDim = " << SDim <<
374 const int off = nvd*(Info/64);
376 for (
int i = 0; i < nvd; i++)
383 int v[4], e[4], eo[4], f[1], fg[1], fo[1];
384 int av = 0, nv = 0, ae = 0, ne = 0, nf = 0;
390 GetNVE<Geometry::SEGMENT>(av, ae);
391 GetEdge<Geometry::SEGMENT>(nv, v, ne, e[0], eo[0], Info);
397 GetNVE<Geometry::TRIANGLE>(av, ae);
401 GetEdge<Geometry::TRIANGLE>(nv, v, ne, e[0], eo[0], Info);
404 GetFace<Geometry::TRIANGLE,Geometry::TRIANGLE>(
405 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
415 GetNVE<Geometry::SQUARE>(av, ae);
419 GetEdge<Geometry::SQUARE>(nv, v, ne, e[0], eo[0], Info);
422 GetFace<Geometry::SQUARE,Geometry::SQUARE>(
423 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
433 GetNVE<Geometry::TETRAHEDRON>(av, ae);
437 GetEdge<Geometry::TETRAHEDRON>(nv, v, ne, e[0], eo[0], Info);
440 GetFace<Geometry::TETRAHEDRON,Geometry::TRIANGLE>(
441 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
451 GetNVE<Geometry::CUBE>(av, ae);
455 GetEdge<Geometry::CUBE>(nv, v, ne, e[0], eo[0], Info);
458 GetFace<Geometry::CUBE,Geometry::SQUARE>(
459 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
468 MFEM_ABORT(
"invalid Geom = " << Geom);
475 for (
int i = 0; i < nv; i++)
477 for (
int j = 0; j < nvd; j++)
479 dofs[i*nvd+j] = v[i]*nvd+j;
482 int l_off = nv*nvd, g_off = av*nvd;
487 for (
int i = 0; i < ne; i++)
491 for (
int j = 0; j < ned; j++)
493 dofs[l_off+i*ned+j] =
495 g_off+e[i]*ned+ed[j] :
496 -1-(g_off+e[i]*ned+(-1-ed[j]));
506 const int nfd = DofForGeometry(fg[0]);
508 for (
int i = 0; i < nf; i++)
510 const int *fd = DofOrderForOrientation(fg[i], fo[i]);
511 for (
int j = 0; j < nfd; j++)
513 dofs[l_off+i*nfd+j] =
515 g_off+f[i]*nfd+fd[j] :
516 -1-(g_off+f[i]*nfd+(-1-fd[j]));
527 ", SDim = " << SDim <<
" is not supported");
542 mfem_error (
"LinearFECollection: unknown geometry type.");
558 mfem_error (
"LinearFECollection: unknown geometry type.");
581 mfem_error (
"QuadraticFECollection: unknown geometry type.");
597 mfem_error (
"QuadraticFECollection: unknown geometry type.");
604 static int indexes[] = { 0 };
618 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
631 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
639 static int indexes[] = { 0 };
657 mfem_error (
"CubicFECollection: unknown geometry type.");
673 mfem_error (
"CubicFECollection: unknown geometry type.");
682 static int ind_pos[] = { 0, 1 };
683 static int ind_neg[] = { 1, 0 };
693 static int indexes[] = { 0 };
699 static int sq_ind[8][4] = {{0, 1, 2, 3}, {0, 2, 1, 3},
700 {2, 0, 3, 1}, {1, 0, 3, 2},
701 {3, 2, 1, 0}, {3, 1, 2, 0},
702 {1, 3, 0, 2}, {2, 3, 0, 1}
720 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
734 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
742 static int indexes[] = { 0 };
757 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
771 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
779 static int ind_pos[] = { 0 };
780 static int ind_neg[] = { -1 };
799 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
813 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
821 static int ind_pos[] = { 0, 1 };
822 static int ind_neg[] = { -2, -1 };
840 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
854 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
862 static int ind_pos[] = { 0, 1, 2 };
863 static int ind_neg[] = { -3, -2, -1 };
881 mfem_error (
"Const2DFECollection: unknown geometry type.");
895 mfem_error (
"Const2DFECollection: unknown geometry type.");
915 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
929 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
949 mfem_error (
"GaussLinearDiscont2DFECollection:"
950 " unknown geometry type.");
964 mfem_error (
"GaussLinearDiscont2DFECollection:"
965 " unknown geometry type.");
971 int GeomType,
int Or)
const
982 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
995 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
1001 int GeomType,
int Or)
const
1015 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1029 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1035 int GeomType,
int Or)
const
1048 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1061 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1076 mfem_error (
"GaussQuadraticDiscont2DFECollection:"
1077 " unknown geometry type.");
1091 mfem_error (
"GaussQuadraticDiscont2DFECollection:"
1092 " unknown geometry type.");
1098 int GeomType,
int Or)
const
1112 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1126 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1148 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1164 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1172 static int indexes[] = { 0 };
1186 mfem_error (
"Const3DFECollection: unknown geometry type.");
1202 mfem_error (
"Const3DFECollection: unknown geometry type.");
1222 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1238 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1258 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1274 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1280 int GeomType,
int Or)
const
1297 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1313 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1321 static int indexes[] = { 0 };
1335 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1351 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1359 static int ind_pos[] = { 0 };
1360 static int ind_neg[] = { -1 };
1380 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1396 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1404 static int ind_pos[] = { 0 };
1405 static int ind_neg[] = { -1 };
1427 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1442 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1452 static int sq_ind[8][4] =
1454 {0, 1, 2, 3}, {-1, -3, -2, -4},
1455 {2, 0, 3, 1}, {-2, -1, -4, -3},
1456 {3, 2, 1, 0}, {-4, -2, -3, -1},
1457 {1, 3, 0, 2}, {-3, -4, -1, -2}
1471 const int pm1 = p - 1, pm2 = pm1 - 1, pm3 = pm2 - 1;
1479 snprintf(h1_name, 32,
"H1_%dD_P%d", dim, p);
1484 snprintf(h1_name, 32,
"H1Pos_%dD_P%d", dim, p);
1493 snprintf(h1_name, 32,
"H1@%c_%dD_P%d",
1501 H1_Elements[g] = NULL;
1503 for (
int i = 0; i < 2; i++)
1505 SegDofOrd[i] = NULL;
1507 for (
int i = 0; i < 6; i++)
1509 TriDofOrd[i] = NULL;
1511 for (
int i = 0; i < 8; i++)
1513 QuadDofOrd[i] = NULL;
1531 SegDofOrd[0] =
new int[2*pm1];
1532 SegDofOrd[1] = SegDofOrd[0] + pm1;
1533 for (
int i = 0; i < pm1; i++)
1535 SegDofOrd[0][i] = i;
1536 SegDofOrd[1][i] = pm2 - i;
1557 TriDofOrd[0] =
new int[6*TriDof];
1558 for (
int i = 1; i < 6; i++)
1560 TriDofOrd[i] = TriDofOrd[i-1] + TriDof;
1563 for (
int j = 0; j < pm2; j++)
1565 for (
int i = 0; i + j < pm2; i++)
1567 int o = TriDof - ((pm1 - j)*(pm2 - j))/2 + i;
1568 int k = pm3 - j - i;
1569 TriDofOrd[0][o] = o;
1570 TriDofOrd[1][o] = TriDof - ((pm1-j)*(pm2-j))/2 + k;
1571 TriDofOrd[2][o] = TriDof - ((pm1-i)*(pm2-i))/2 + k;
1572 TriDofOrd[3][o] = TriDof - ((pm1-k)*(pm2-k))/2 + i;
1573 TriDofOrd[4][o] = TriDof - ((pm1-k)*(pm2-k))/2 + j;
1574 TriDofOrd[5][o] = TriDof - ((pm1-i)*(pm2-i))/2 + j;
1578 QuadDofOrd[0] =
new int[8*QuadDof];
1579 for (
int i = 1; i < 8; i++)
1581 QuadDofOrd[i] = QuadDofOrd[i-1] + QuadDof;
1584 for (
int j = 0; j < pm1; j++)
1586 for (
int i = 0; i < pm1; i++)
1589 QuadDofOrd[0][o] = i + j*pm1;
1590 QuadDofOrd[1][o] = j + i*pm1;
1591 QuadDofOrd[2][o] = j + (pm2 - i)*pm1;
1592 QuadDofOrd[3][o] = (pm2 - i) + j*pm1;
1593 QuadDofOrd[4][o] = (pm2 - i) + (pm2 - j)*pm1;
1594 QuadDofOrd[5][o] = (pm2 - j) + (pm2 - i)*pm1;
1595 QuadDofOrd[6][o] = (pm2 - j) + i*pm1;
1596 QuadDofOrd[7][o] = i + (pm2 - j)*pm1;
1623 return (Or > 0) ? SegDofOrd[0] : SegDofOrd[1];
1627 return TriDofOrd[Or%6];
1631 return QuadDofOrd[Or%8];
1640 if (!strncmp(h1_name,
"H1_", 3))
1642 dim = atoi(h1_name + 3);
1644 else if (!strncmp(h1_name,
"H1Pos_", 6))
1646 dim = atoi(h1_name + 6);
1648 else if (!strncmp(h1_name,
"H1@", 3))
1650 dim = atoi(h1_name + 5);
1657 const int *dof_map = NULL;
1665 ->GetDofMap().GetData();
1668 MFEM_ABORT(
"Geometry type " <<
Geometry::Name[GeomType] <<
" is not "
1678 delete [] SegDofOrd[0];
1679 delete [] TriDofOrd[0];
1680 delete [] QuadDofOrd[0];
1683 delete H1_Elements[g];
1694 snprintf(
h1_name, 32,
"H1_Trace_%dD_P%d", dim, p);
1698 snprintf(
h1_name, 32,
"H1Pos_Trace_%dD_P%d", dim, p);
1702 snprintf(
h1_name, 32,
"H1_Trace@%c_%dD_P%d",
1712 const char *prefix = NULL;
1718 MFEM_ABORT(
"invalid map_type: " << map_type);
1723 snprintf(d_name, 32,
"%s_%dD_P%d", prefix, dim, p);
1726 snprintf(d_name, 32,
"%s_T%d_%dD_P%d", prefix, btype, dim, p);
1731 L2_Elements[g] = NULL;
1732 Tr_Elements[g] = NULL;
1734 for (
int i = 0; i < 2; i++)
1736 SegDofOrd[i] = NULL;
1738 for (
int i = 0; i < 6; i++)
1740 TriDofOrd[i] = NULL;
1763 const int pp1 = p + 1;
1764 SegDofOrd[0] =
new int[2*pp1];
1765 SegDofOrd[1] = SegDofOrd[0] + pp1;
1766 for (
int i = 0; i <= p; i++)
1768 SegDofOrd[0][i] = i;
1769 SegDofOrd[1][i] = p - i;
1790 TriDofOrd[0] =
new int[6*TriDof];
1791 for (
int i = 1; i < 6; i++)
1793 TriDofOrd[i] = TriDofOrd[i-1] + TriDof;
1795 const int pp1 = p + 1, pp2 = pp1 + 1;
1796 for (
int j = 0; j <= p; j++)
1798 for (
int i = 0; i + j <= p; i++)
1800 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
1802 TriDofOrd[0][o] = o;
1803 TriDofOrd[1][o] = TriDof - ((pp2-j)*(pp1-j))/2 + k;
1804 TriDofOrd[2][o] = TriDof - ((pp2-i)*(pp1-i))/2 + k;
1805 TriDofOrd[3][o] = TriDof - ((pp2-k)*(pp1-k))/2 + i;
1806 TriDofOrd[4][o] = TriDof - ((pp2-k)*(pp1-k))/2 + j;
1807 TriDofOrd[5][o] = TriDof - ((pp2-i)*(pp1-i))/2 + j;
1811 OtherDofOrd =
new int[QuadDof];
1812 for (
int j = 0; j < QuadDof; j++)
1838 const int MaxDof = std::max(TetDof, HexDof);
1839 OtherDofOrd =
new int[MaxDof];
1840 for (
int j = 0; j < MaxDof; j++)
1847 mfem::err <<
"L2_FECollection::L2_FECollection : dim = "
1858 return (Or > 0) ? SegDofOrd[0] : SegDofOrd[1];
1861 return TriDofOrd[Or%6];
1864 return (Or == 0) ? OtherDofOrd : NULL;
1870 delete [] OtherDofOrd;
1871 delete [] SegDofOrd[0];
1872 delete [] TriDofOrd[0];
1875 delete L2_Elements[i];
1876 delete Tr_Elements[i];
1882 const int cb_type,
const int ob_type)
1891 MFEM_ABORT(
"unknown closed BasisType: " << cb_name);
1896 MFEM_ABORT(
"unknown open BasisType: " << ob_name);
1904 snprintf(
rt_name, 32,
"RT_%dD_P%d", dim, p);
1912 const int pp1 = p + 1;
1935 MFEM_ABORT(
"invalid dim = " << dim);
1942 const bool signs,
const int ob_type)
1949 MFEM_ABORT(
"Invalid open basis type: " << ob_name);
1960 "invalid open point type");
1962 const int pp1 = p + 1, pp2 = p + 2;
1970 for (
int i = 0; i < 2; i++)
1974 for (
int i = 0; i < 6; i++)
1978 for (
int i = 0; i < 8; i++)
1992 for (
int i = 0; i <= p; i++)
1995 SegDofOrd[1][i] = signs ? (-1 - (p - i)) : (p - i);
2012 for (
int i = 1; i < 6; i++)
2018 for (
int j = 0; j <= p; j++)
2020 for (
int i = 0; i + j <= p; i++)
2022 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
2025 TriDofOrd[1][o] = -1-(TriDof-((pp2-j)*(pp1-j))/2+k);
2026 TriDofOrd[2][o] = TriDof-((pp2-i)*(pp1-i))/2+k;
2027 TriDofOrd[3][o] = -1-(TriDof-((pp2-k)*(pp1-k))/2+i);
2028 TriDofOrd[4][o] = TriDof-((pp2-k)*(pp1-k))/2+j;
2029 TriDofOrd[5][o] = -1-(TriDof-((pp2-i)*(pp1-i))/2+j);
2032 for (
int k = 1; k < 6; k += 2)
2034 TriDofOrd[k][o] = -1 - TriDofOrd[k][o];
2042 for (
int i = 1; i < 8; i++)
2047 for (
int j = 0; j <= p; j++)
2049 for (
int i = 0; i <= p; i++)
2056 QuadDofOrd[4][o] = (p - i) + (p - j)*pp1;
2057 QuadDofOrd[5][o] = -1 - ((p - j) + (p - i)*pp1);
2058 QuadDofOrd[6][o] = (p - j) + i*pp1;
2059 QuadDofOrd[7][o] = -1 - (i + (p - j)*pp1);
2062 for (
int k = 1; k < 8; k += 2)
2064 QuadDofOrd[k][o] = -1 - QuadDofOrd[k][o];
2092 if (!strncmp(
rt_name,
"RT_", 3))
2122 const char *prefix =
2124 char ob_str[3] = {
'\0',
'\0',
'\0' };
2131 snprintf(
rt_name, 32,
"%s%s_%dD_P%d", prefix, ob_str, dim, p);
2133 MFEM_VERIFY(dim == 2 || dim == 3,
"Wrong dimension, dim = " << dim);
2142 MFEM_VERIFY(dim == 2 || dim == 3,
"Wrong dimension, dim = " << dim);
2144 const char *prefix =
2148 snprintf(
rt_name, 32,
"%s_%dD_P%d", prefix, dim, p);
2152 snprintf(
rt_name, 32,
"%s@%c_%dD_P%d", prefix,
2158 const int cb_type,
const int ob_type)
2160 const int pm1 = p - 1, pm2 = p - 2;
2165 snprintf(
nd_name, 32,
"ND_%dD_P%d", dim, p);
2178 for (
int i = 0; i < 2; i++)
2182 for (
int i = 0; i < 6; i++)
2186 for (
int i = 0; i < 8; i++)
2198 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
2203 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
2213 for (
int i = 0; i < p; i++)
2232 for (
int i = 1; i < 8; i++)
2237 for (
int j = 0; j < pm1; j++)
2239 for (
int i = 0; i < p; i++)
2242 int d2 = p*pm1 + j + i*pm1;
2252 QuadDofOrd[2][d1] = -1 - (p*pm1 + j + (pm1 - i)*pm1);
2256 QuadDofOrd[3][d2] = p*pm1 + (pm2 - j) + i*pm1;
2258 QuadDofOrd[4][d1] = -1 - ((pm1 - i) + (pm2 - j)*p);
2259 QuadDofOrd[4][d2] = -1 - (p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2261 QuadDofOrd[5][d1] = -1 - (p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2262 QuadDofOrd[5][d2] = -1 - ((pm1 - i) + (pm2 - j)*p);
2266 QuadDofOrd[6][d1] = p*pm1 + (pm2 - j) + i*pm1;
2267 QuadDofOrd[6][d2] = -1 - ((pm1 - i) + j*p);
2269 QuadDofOrd[7][d1] = i + (pm2 - j)*p;
2270 QuadDofOrd[7][d2] = -1 - (p*pm1 + j + (pm1 - i)*pm1);
2276 for (
int i = 1; i < 6; i++)
2282 for (
int j = 0; j <= pm2; j++)
2284 for (
int i = 0; i + j <= pm2; i++)
2286 int k1 = p*pm1 - (p - j)*(pm1 - j) + 2*i;
2287 int k2 = p*pm1 - (p - i)*(pm1 - i) + 2*j;
2321 if (Or != 0 && Or != 5)
2323 MFEM_ABORT(
"ND_FECollection::DofOrderForOrientation: "
2324 "triangle face orientation " << Or <<
" is not supported! "
2325 "Use Mesh::ReorientTetMesh to fix it.");
2338 int p,
dim, cb_type, ob_type;
2376 snprintf(
nd_name, 32,
"ND_Trace_%dD_P%d", dim, p);
2380 snprintf(
nd_name, 32,
"ND_Trace@%c%c_%dD_P%d",
2389 snprintf(d_name, 32,
"Local_%s", fe_name);
2391 Local_Element = NULL;
2393 if (!strcmp(fe_name,
"BiCubic2DFiniteElement") ||
2394 !strcmp(fe_name,
"Quad_Q3"))
2399 else if (!strcmp(fe_name,
"Nedelec1HexFiniteElement") ||
2400 !strcmp(fe_name,
"Hex_ND1"))
2405 else if (!strncmp(fe_name,
"H1_", 3))
2410 else if (!strncmp(fe_name,
"H1Pos_", 6))
2415 else if (!strncmp(fe_name,
"L2_", 3))
2422 mfem::err <<
"Local_FECollection::Local_FECollection : fe_name = "
2444 snprintf(name, 16,
"NURBS%i", Order);
2448 snprintf(name, 16,
"NURBS");
2454 delete ParallelepipedFE;
2455 delete QuadrilateralFE;
2468 mfem_error (
"NURBSFECollection: unknown geometry type.");
2475 mfem_error(
"NURBSFECollection::DofForGeometry");
2481 mfem_error(
"NURBSFECollection::DofOrderForOrientation");
2487 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.
H1_Trace_FECollection(const int p, const int dim, const int btype=BasisType::GaussLobatto)
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
int Size() const
Logical size of the array.
For scalar fields; preserves point values.
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
virtual ~NURBSFECollection()
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
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)
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
NURBSFECollection(int Order=VariableOrder)
The parameter Order must be either a positive number, for fixed order, or VariableOrder (default)...
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual ~RT_FECollection()
L2_FECollection(const int p, const int dim, const int btype=BasisType::GaussLegendre, const int map_type=FiniteElement::VALUE)
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
For scalar fields; preserves volume integrals.
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int DofForGeometry(int GeomType) const
virtual int DofForGeometry(int GeomType) const
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)
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
const int * GetDofMap(int GeomType) const
Get the Cartesian to local H1 dof map.
virtual int DofForGeometry(int GeomType) const
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
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 * DofOrderForOrientation(int GeomType, int Or) 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...
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
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