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,
"H1@", 3))
170 else if (!strncmp(name,
"L2_T", 4))
173 else if (!strncmp(name,
"L2_", 3))
177 else if (!strncmp(name,
"L2Int_T", 7))
182 else if (!strncmp(name,
"L2Int_", 6))
188 else if (!strncmp(name,
"RT_Trace_", 9))
192 else if (!strncmp(name,
"RT_ValTrace_", 12))
197 else if (!strncmp(name,
"RT_Trace@", 9))
203 else if (!strncmp(name,
"RT_ValTrace@", 12))
209 else if (!strncmp(name,
"DG_Iface_", 9))
213 else if (!strncmp(name,
"DG_Iface@", 9))
219 else if (!strncmp(name,
"DG_IntIface_", 12))
224 else if (!strncmp(name,
"DG_IntIface@", 12))
230 else if (!strncmp(name,
"RT_", 3))
234 else if (!strncmp(name,
"RT@", 3))
240 else if (!strncmp(name,
"ND_Trace_", 9))
244 else if (!strncmp(name,
"ND_Trace@", 9))
250 else if (!strncmp(name,
"ND_", 3))
254 else if (!strncmp(name,
"ND@", 3))
260 else if (!strncmp(name,
"Local_", 6))
264 else if (!strncmp(name,
"NURBS", 5))
279 MFEM_ABORT(
"unknown FiniteElementCollection: " << name);
281 MFEM_VERIFY(!strcmp(fec->
Name(), name),
"input name: \"" << name
282 <<
"\" does not match the created collection name: \""
283 << fec->
Name() <<
'"');
288 template <Geometry::Type geom>
293 nv = g_consts::NumVert;
294 ne = g_consts::NumEdges;
297 template <Geometry::Type geom,
typename v_t>
299 GetEdge(
int &nv, v_t &v,
int &ne,
int &e,
int &eo,
const int edge_info)
304 nv = e_consts::NumVert;
308 MFEM_ASSERT(0 <= e && e < g_consts::NumEdges,
"");
309 MFEM_ASSERT(0 <= eo && eo < e_consts::NumOrient,
"");
310 v[0] = g_consts::Edges[e][0];
311 v[1] = g_consts::Edges[e][1];
312 v[0] = e_consts::Orient[eo][v[0]];
313 v[1] = e_consts::Orient[eo][v[1]];
317 typename v_t,
typename e_t,
typename eo_t>
319 GetFace(
int &nv, v_t &v,
int &ne, e_t &e, eo_t &eo,
320 int &nf,
int &f,
Geometry::Type &fg,
int &fo,
const int face_info)
325 nv = f_consts::NumVert;
330 MFEM_ASSERT(0 <= f && f < g_consts::NumFaces,
"");
331 MFEM_ASSERT(0 <= fo && fo < f_consts::NumOrient,
"");
332 for (
int i = 0; i < f_consts::NumVert; i++)
334 v[i] = f_consts::Orient[fo][i];
335 v[i] = g_consts::FaceVert[f][v[i]];
337 ne = f_consts::NumEdges;
338 for (
int i = 0; i < f_consts::NumEdges; i++)
340 int v0 = v[f_consts::Edges[i][0]];
341 int v1 = v[f_consts::Edges[i][1]];
343 if (v0 > v1) { swap(v0, v1); eor = 1; }
344 for (
int j = g_consts::VertToVert::I[v0];
true; j++)
346 MFEM_ASSERT(j < g_consts::VertToVert::I[v0+1],
347 "internal error, edge not found");
348 if (v1 == g_consts::VertToVert::J[j][0])
350 int en = g_consts::VertToVert::J[j][1];
370 "invalid Geom = " << Geom);
372 "invalid SDim = " << SDim <<
378 const int off = nvd*(Info/64);
380 for (
int i = 0; i < nvd; i++)
387 int v[4], e[4], eo[4], f[1], fo[1];
388 int av = 0, nv = 0, ae = 0, ne = 0, nf = 0;
395 GetNVE<Geometry::SEGMENT>(av, ae);
396 GetEdge<Geometry::SEGMENT>(nv, v, ne, e[0], eo[0], Info);
402 GetNVE<Geometry::TRIANGLE>(av, ae);
406 GetEdge<Geometry::TRIANGLE>(nv, v, ne, e[0], eo[0], Info);
409 GetFace<Geometry::TRIANGLE,Geometry::TRIANGLE>(
410 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
420 GetNVE<Geometry::SQUARE>(av, ae);
424 GetEdge<Geometry::SQUARE>(nv, v, ne, e[0], eo[0], Info);
427 GetFace<Geometry::SQUARE,Geometry::SQUARE>(
428 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
438 GetNVE<Geometry::TETRAHEDRON>(av, ae);
442 GetEdge<Geometry::TETRAHEDRON>(nv, v, ne, e[0], eo[0], Info);
445 GetFace<Geometry::TETRAHEDRON,Geometry::TRIANGLE>(
446 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
456 GetNVE<Geometry::CUBE>(av, ae);
460 GetEdge<Geometry::CUBE>(nv, v, ne, e[0], eo[0], Info);
463 GetFace<Geometry::CUBE,Geometry::SQUARE>(
464 nv, v, ne, e, eo, nf, f[0], fg[0], fo[0], Info);
473 MFEM_ABORT(
"invalid Geom = " << Geom);
480 for (
int i = 0; i < nv; i++)
482 for (
int j = 0; j < nvd; j++)
484 dofs[i*nvd+j] = v[i]*nvd+j;
487 int l_off = nv*nvd, g_off = av*nvd;
492 for (
int i = 0; i < ne; i++)
496 for (
int j = 0; j < ned; j++)
498 dofs[l_off+i*ned+j] =
500 g_off+e[i]*ned+ed[j] :
501 -1-(g_off+e[i]*ned+(-1-ed[j]));
511 const int nfd = DofForGeometry(fg[0]);
513 for (
int i = 0; i < nf; i++)
515 const int *fd = DofOrderForOrientation(fg[i], fo[i]);
516 for (
int j = 0; j < nfd; j++)
518 dofs[l_off+i*nfd+j] =
520 g_off+f[i]*nfd+fd[j] :
521 -1-(g_off+f[i]*nfd+(-1-fd[j]));
532 ", SDim = " << SDim <<
" is not supported");
548 mfem_error (
"LinearFECollection: unknown geometry type.");
565 mfem_error (
"LinearFECollection: unknown geometry type.");
590 mfem_error (
"QuadraticFECollection: unknown geometry type.");
607 mfem_error (
"QuadraticFECollection: unknown geometry type.");
615 static int indexes[] = { 0 };
630 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
643 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
651 static int indexes[] = { 0 };
670 mfem_error (
"CubicFECollection: unknown geometry type.");
687 mfem_error (
"CubicFECollection: unknown geometry type.");
697 static int ind_pos[] = { 0, 1 };
698 static int ind_neg[] = { 1, 0 };
708 static int indexes[] = { 0 };
714 static int sq_ind[8][4] = {{0, 1, 2, 3}, {0, 2, 1, 3},
715 {2, 0, 3, 1}, {1, 0, 3, 2},
716 {3, 2, 1, 0}, {3, 1, 2, 0},
717 {1, 3, 0, 2}, {2, 3, 0, 1}
736 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
750 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
758 static int indexes[] = { 0 };
773 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
787 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
795 static int ind_pos[] = { 0 };
796 static int ind_neg[] = { -1 };
815 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
829 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
837 static int ind_pos[] = { 0, 1 };
838 static int ind_neg[] = { -2, -1 };
856 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
870 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
878 static int ind_pos[] = { 0, 1, 2 };
879 static int ind_neg[] = { -3, -2, -1 };
897 mfem_error (
"Const2DFECollection: unknown geometry type.");
911 mfem_error (
"Const2DFECollection: unknown geometry type.");
932 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
946 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
967 mfem_error (
"GaussLinearDiscont2DFECollection:"
968 " unknown geometry type.");
983 mfem_error (
"GaussLinearDiscont2DFECollection:"
984 " unknown geometry type.");
1001 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
1014 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
1035 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1050 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1070 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1084 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1100 mfem_error (
"GaussQuadraticDiscont2DFECollection:"
1101 " unknown geometry type.");
1116 mfem_error (
"GaussQuadraticDiscont2DFECollection:"
1117 " unknown geometry type.");
1138 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1152 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1175 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1191 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1199 static int indexes[] = { 0 };
1214 mfem_error (
"Const3DFECollection: unknown geometry type.");
1231 mfem_error (
"Const3DFECollection: unknown geometry type.");
1252 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1268 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1289 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1306 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1330 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1346 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1354 static int indexes[] = { 0 };
1368 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1384 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1392 static int ind_pos[] = { 0 };
1393 static int ind_neg[] = { -1 };
1413 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1429 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1437 static int ind_pos[] = { 0 };
1438 static int ind_neg[] = { -1 };
1460 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1475 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1485 static int sq_ind[8][4] =
1487 {0, 1, 2, 3}, {-1, -3, -2, -4},
1488 {2, 0, 3, 1}, {-2, -1, -4, -3},
1489 {3, 2, 1, 0}, {-4, -2, -3, -1},
1490 {1, 3, 0, 2}, {-3, -4, -1, -2}
1504 MFEM_VERIFY(p >= 1,
"H1_FECollection requires order >= 1.");
1505 MFEM_VERIFY(dim >= 0 && dim <= 3,
"H1_FECollection requires 0 <= dim <= 3.");
1507 const int pm1 = p - 1, pm2 = pm1 - 1, pm3 = pm2 - 1;
1515 snprintf(h1_name, 32,
"H1_%dD_P%d", dim, p);
1520 snprintf(h1_name, 32,
"H1Pos_%dD_P%d", dim, p);
1529 snprintf(h1_name, 32,
"H1@%c_%dD_P%d",
1537 H1_Elements[g] = NULL;
1539 for (
int i = 0; i < 2; i++)
1541 SegDofOrd[i] = NULL;
1543 for (
int i = 0; i < 6; i++)
1545 TriDofOrd[i] = NULL;
1547 for (
int i = 0; i < 8; i++)
1549 QuadDofOrd[i] = NULL;
1567 SegDofOrd[0] =
new int[2*pm1];
1568 SegDofOrd[1] = SegDofOrd[0] + pm1;
1569 for (
int i = 0; i < pm1; i++)
1571 SegDofOrd[0][i] = i;
1572 SegDofOrd[1][i] = pm2 - i;
1593 TriDofOrd[0] =
new int[6*TriDof];
1594 for (
int i = 1; i < 6; i++)
1596 TriDofOrd[i] = TriDofOrd[i-1] + TriDof;
1599 for (
int j = 0; j < pm2; j++)
1601 for (
int i = 0; i + j < pm2; i++)
1603 int o = TriDof - ((pm1 - j)*(pm2 - j))/2 + i;
1604 int k = pm3 - j - i;
1605 TriDofOrd[0][o] = o;
1606 TriDofOrd[1][o] = TriDof - ((pm1-j)*(pm2-j))/2 + k;
1607 TriDofOrd[2][o] = TriDof - ((pm1-i)*(pm2-i))/2 + k;
1608 TriDofOrd[3][o] = TriDof - ((pm1-k)*(pm2-k))/2 + i;
1609 TriDofOrd[4][o] = TriDof - ((pm1-k)*(pm2-k))/2 + j;
1610 TriDofOrd[5][o] = TriDof - ((pm1-i)*(pm2-i))/2 + j;
1614 QuadDofOrd[0] =
new int[8*QuadDof];
1615 for (
int i = 1; i < 8; i++)
1617 QuadDofOrd[i] = QuadDofOrd[i-1] + QuadDof;
1620 for (
int j = 0; j < pm1; j++)
1622 for (
int i = 0; i < pm1; i++)
1625 QuadDofOrd[0][o] = i + j*pm1;
1626 QuadDofOrd[1][o] = j + i*pm1;
1627 QuadDofOrd[2][o] = j + (pm2 - i)*pm1;
1628 QuadDofOrd[3][o] = (pm2 - i) + j*pm1;
1629 QuadDofOrd[4][o] = (pm2 - i) + (pm2 - j)*pm1;
1630 QuadDofOrd[5][o] = (pm2 - j) + (pm2 - i)*pm1;
1631 QuadDofOrd[6][o] = (pm2 - j) + i*pm1;
1632 QuadDofOrd[7][o] = i + (pm2 - j)*pm1;
1663 return (Or > 0) ? SegDofOrd[0] : SegDofOrd[1];
1667 return TriDofOrd[Or%6];
1671 return QuadDofOrd[Or%8];
1680 if (!strncmp(h1_name,
"H1_", 3))
1682 dim = atoi(h1_name + 3);
1684 else if (!strncmp(h1_name,
"H1Pos_", 6))
1686 dim = atoi(h1_name + 6);
1688 else if (!strncmp(h1_name,
"H1@", 3))
1690 dim = atoi(h1_name + 5);
1697 const int *dof_map = NULL;
1705 ->GetDofMap().GetData();
1708 MFEM_ABORT(
"Geometry type " <<
Geometry::Name[GeomType] <<
" is not "
1718 delete [] SegDofOrd[0];
1719 delete [] TriDofOrd[0];
1720 delete [] QuadDofOrd[0];
1723 delete H1_Elements[g];
1734 snprintf(
h1_name, 32,
"H1_Trace_%dD_P%d", dim, p);
1738 snprintf(
h1_name, 32,
"H1Pos_Trace_%dD_P%d", dim, p);
1742 snprintf(
h1_name, 32,
"H1_Trace@%c_%dD_P%d",
1751 MFEM_VERIFY(p >= 0,
"L2_FECollection requires order >= 0.");
1754 const char *prefix = NULL;
1760 MFEM_ABORT(
"invalid map_type: " << map_type);
1765 snprintf(d_name, 32,
"%s_%dD_P%d", prefix, dim, p);
1768 snprintf(d_name, 32,
"%s_T%d_%dD_P%d", prefix, btype, dim, p);
1773 L2_Elements[g] = NULL;
1774 Tr_Elements[g] = NULL;
1776 for (
int i = 0; i < 2; i++)
1778 SegDofOrd[i] = NULL;
1780 for (
int i = 0; i < 6; i++)
1782 TriDofOrd[i] = NULL;
1805 const int pp1 = p + 1;
1806 SegDofOrd[0] =
new int[2*pp1];
1807 SegDofOrd[1] = SegDofOrd[0] + pp1;
1808 for (
int i = 0; i <= p; i++)
1810 SegDofOrd[0][i] = i;
1811 SegDofOrd[1][i] = p - i;
1832 TriDofOrd[0] =
new int[6*TriDof];
1833 for (
int i = 1; i < 6; i++)
1835 TriDofOrd[i] = TriDofOrd[i-1] + TriDof;
1837 const int pp1 = p + 1, pp2 = pp1 + 1;
1838 for (
int j = 0; j <= p; j++)
1840 for (
int i = 0; i + j <= p; i++)
1842 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
1844 TriDofOrd[0][o] = o;
1845 TriDofOrd[1][o] = TriDof - ((pp2-j)*(pp1-j))/2 + k;
1846 TriDofOrd[2][o] = TriDof - ((pp2-i)*(pp1-i))/2 + k;
1847 TriDofOrd[3][o] = TriDof - ((pp2-k)*(pp1-k))/2 + i;
1848 TriDofOrd[4][o] = TriDof - ((pp2-k)*(pp1-k))/2 + j;
1849 TriDofOrd[5][o] = TriDof - ((pp2-i)*(pp1-i))/2 + j;
1853 OtherDofOrd =
new int[QuadDof];
1854 for (
int j = 0; j < QuadDof; j++)
1884 const int MaxDof = std::max(TetDof, std::max(PriDof, HexDof));
1885 OtherDofOrd =
new int[MaxDof];
1886 for (
int j = 0; j < MaxDof; j++)
1893 mfem::err <<
"L2_FECollection::L2_FECollection : dim = "
1905 return (Or > 0) ? SegDofOrd[0] : SegDofOrd[1];
1908 return TriDofOrd[Or%6];
1911 return (Or == 0) ? OtherDofOrd : NULL;
1917 delete [] OtherDofOrd;
1918 delete [] SegDofOrd[0];
1919 delete [] TriDofOrd[0];
1922 delete L2_Elements[i];
1923 delete Tr_Elements[i];
1929 const int cb_type,
const int ob_type)
1932 MFEM_VERIFY(p >= 0,
"RT_FECollection requires order >= 0.");
1940 MFEM_ABORT(
"unknown closed BasisType: " << cb_name);
1945 MFEM_ABORT(
"unknown open BasisType: " << ob_name);
1953 snprintf(
rt_name, 32,
"RT_%dD_P%d", dim, p);
1961 const int pp1 = p + 1;
1984 MFEM_ABORT(
"invalid dim = " << dim);
1991 const bool signs,
const int ob_type)
1998 MFEM_ABORT(
"Invalid open basis type: " << ob_name);
2009 "invalid open point type");
2011 const int pp1 = p + 1, pp2 = p + 2;
2019 for (
int i = 0; i < 2; i++)
2023 for (
int i = 0; i < 6; i++)
2027 for (
int i = 0; i < 8; i++)
2041 for (
int i = 0; i <= p; i++)
2044 SegDofOrd[1][i] = signs ? (-1 - (p - i)) : (p - i);
2061 for (
int i = 1; i < 6; i++)
2067 for (
int j = 0; j <= p; j++)
2069 for (
int i = 0; i + j <= p; i++)
2071 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
2074 TriDofOrd[1][o] = -1-(TriDof-((pp2-j)*(pp1-j))/2+k);
2075 TriDofOrd[2][o] = TriDof-((pp2-i)*(pp1-i))/2+k;
2076 TriDofOrd[3][o] = -1-(TriDof-((pp2-k)*(pp1-k))/2+i);
2077 TriDofOrd[4][o] = TriDof-((pp2-k)*(pp1-k))/2+j;
2078 TriDofOrd[5][o] = -1-(TriDof-((pp2-i)*(pp1-i))/2+j);
2081 for (
int k = 1; k < 6; k += 2)
2083 TriDofOrd[k][o] = -1 - TriDofOrd[k][o];
2091 for (
int i = 1; i < 8; i++)
2096 for (
int j = 0; j <= p; j++)
2098 for (
int i = 0; i <= p; i++)
2105 QuadDofOrd[4][o] = (p - i) + (p - j)*pp1;
2106 QuadDofOrd[5][o] = -1 - ((p - j) + (p - i)*pp1);
2107 QuadDofOrd[6][o] = (p - j) + i*pp1;
2108 QuadDofOrd[7][o] = -1 - (i + (p - j)*pp1);
2111 for (
int k = 1; k < 8; k += 2)
2113 QuadDofOrd[k][o] = -1 - QuadDofOrd[k][o];
2142 if (!strncmp(
rt_name,
"RT_", 3))
2172 const char *prefix =
2174 char ob_str[3] = {
'\0',
'\0',
'\0' };
2181 snprintf(
rt_name, 32,
"%s%s_%dD_P%d", prefix, ob_str, dim, p);
2183 MFEM_VERIFY(dim == 2 || dim == 3,
"Wrong dimension, dim = " << dim);
2192 MFEM_VERIFY(dim == 2 || dim == 3,
"Wrong dimension, dim = " << dim);
2194 const char *prefix =
2198 snprintf(
rt_name, 32,
"%s_%dD_P%d", prefix, dim, p);
2202 snprintf(
rt_name, 32,
"%s@%c_%dD_P%d", prefix,
2208 const int cb_type,
const int ob_type)
2210 MFEM_VERIFY(p >= 1,
"ND_FECollection requires order >= 1.");
2211 MFEM_VERIFY(dim >= 1 && dim <= 3,
"ND_FECollection requires 1 <= dim <= 3.");
2213 const int pm1 = p - 1, pm2 = p - 2;
2218 snprintf(
nd_name, 32,
"ND_%dD_P%d", dim, p);
2231 for (
int i = 0; i < 2; i++)
2235 for (
int i = 0; i < 6; i++)
2239 for (
int i = 0; i < 8; i++)
2251 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
2256 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
2266 for (
int i = 0; i < p; i++)
2285 for (
int i = 1; i < 8; i++)
2290 for (
int j = 0; j < pm1; j++)
2292 for (
int i = 0; i < p; i++)
2295 int d2 = p*pm1 + j + i*pm1;
2305 QuadDofOrd[2][d1] = -1 - (p*pm1 + j + (pm1 - i)*pm1);
2309 QuadDofOrd[3][d2] = p*pm1 + (pm2 - j) + i*pm1;
2311 QuadDofOrd[4][d1] = -1 - ((pm1 - i) + (pm2 - j)*p);
2312 QuadDofOrd[4][d2] = -1 - (p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2314 QuadDofOrd[5][d1] = -1 - (p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2315 QuadDofOrd[5][d2] = -1 - ((pm1 - i) + (pm2 - j)*p);
2319 QuadDofOrd[6][d1] = p*pm1 + (pm2 - j) + i*pm1;
2320 QuadDofOrd[6][d2] = -1 - ((pm1 - i) + j*p);
2322 QuadDofOrd[7][d1] = i + (pm2 - j)*p;
2323 QuadDofOrd[7][d2] = -1 - (p*pm1 + j + (pm1 - i)*pm1);
2329 for (
int i = 1; i < 6; i++)
2335 for (
int j = 0; j <= pm2; j++)
2337 for (
int i = 0; i + j <= pm2; i++)
2339 int k1 = p*pm1 - (p - j)*(pm1 - j) + 2*i;
2340 int k2 = p*pm1 - (p - i)*(pm1 - i) + 2*j;
2375 if (Or != 0 && Or != 5)
2377 MFEM_ABORT(
"triangle face orientation " << Or <<
" is not supported! "
2378 "Use Mesh::ReorientTetMesh to fix it.");
2391 int p,
dim, cb_type, ob_type;
2429 snprintf(
nd_name, 32,
"ND_Trace_%dD_P%d", dim, p);
2433 snprintf(
nd_name, 32,
"ND_Trace@%c%c_%dD_P%d",
2442 snprintf(d_name, 32,
"Local_%s", fe_name);
2444 Local_Element = NULL;
2446 if (!strcmp(fe_name,
"BiCubic2DFiniteElement") ||
2447 !strcmp(fe_name,
"Quad_Q3"))
2452 else if (!strcmp(fe_name,
"Nedelec1HexFiniteElement") ||
2453 !strcmp(fe_name,
"Hex_ND1"))
2458 else if (!strncmp(fe_name,
"H1_", 3))
2463 else if (!strncmp(fe_name,
"H1Pos_", 6))
2468 else if (!strncmp(fe_name,
"L2_", 3))
2475 mfem::err <<
"Local_FECollection::Local_FECollection : fe_name = "
2497 snprintf(name, 16,
"NURBS%i", Order);
2501 snprintf(name, 16,
"NURBS");
2507 delete ParallelepipedFE;
2508 delete QuadrilateralFE;
2521 mfem_error (
"NURBSFECollection: unknown geometry type.");
2528 mfem_error(
"NURBSFECollection::DofForGeometry");
2535 mfem_error(
"NURBSFECollection::DofOrderForOrientation");
2541 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 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
int Size() const
Logical size of the array.
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...
For scalar fields; preserves volume integrals.
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)
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
virtual ~L2_FECollection()
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]...
Piecewise-(bi)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
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...
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
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.
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]...
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]...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
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]...
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.
Version of QuadraticDiscont2DFECollection with positive basis functions.
virtual ~ND_FECollection()
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
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]...
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
static const char * Name[NumGeom]
Piecewise-linear nonconforming finite elements in 3D.
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
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]...
static int CheckClosed(int type)
If the Quadrature1D type is not closed return Invalid; otherwise return type.
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]...
virtual int DofForGeometry(Geometry::Type GeomType) const
void SetSize(int nsize)
Change logical size of the array, keep existing entries.
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
class Linear3DFiniteElement TetrahedronFE
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
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
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
RT_Trace_FECollection(const int p, const int dim, const int map_type=FiniteElement::INTEGRAL, const int ob_type=BasisType::GaussLegendre)
virtual int DofForGeometry(Geometry::Type GeomType) const
Piecewise-(bi)quadratic 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
Arbitrary order H(curl)-conforming Nedelec finite elements.
virtual int DofForGeometry(Geometry::Type GeomType) const
For scalar fields; preserves point values.
Arbitrary order H1-conforming (continuous) finite elements.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Local_FECollection(const char *fe_name)
virtual int DofForGeometry(Geometry::Type GeomType) const
BiLinear2DFiniteElement QuadrilateralFE
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]...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
int ND_dof[Geometry::NumGeom]
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Arbitrary order "L2-conforming" discontinuous finite elements.