17#define snprintf _snprintf_s
34 if (fe !=
nullptr) {
break; }
113 MFEM_ABORT(
"unknown geometry type");
120 MFEM_ABORT(
"this method is not implemented in this derived class!");
128 if (!strcmp(name,
"Linear"))
132 else if (!strcmp(name,
"Quadratic"))
136 else if (!strcmp(name,
"QuadraticPos"))
140 else if (!strcmp(name,
"Cubic"))
144 else if (!strcmp(name,
"Const3D"))
148 else if (!strcmp(name,
"Const2D"))
152 else if (!strcmp(name,
"LinearDiscont2D"))
156 else if (!strcmp(name,
"GaussLinearDiscont2D"))
160 else if (!strcmp(name,
"P1OnQuad"))
164 else if (!strcmp(name,
"QuadraticDiscont2D"))
168 else if (!strcmp(name,
"QuadraticPosDiscont2D"))
172 else if (!strcmp(name,
"GaussQuadraticDiscont2D"))
176 else if (!strcmp(name,
"CubicDiscont2D"))
180 else if (!strcmp(name,
"LinearDiscont3D"))
184 else if (!strcmp(name,
"QuadraticDiscont3D"))
188 else if (!strcmp(name,
"LinearNonConf3D"))
192 else if (!strcmp(name,
"CrouzeixRaviart"))
196 else if (!strcmp(name,
"ND1_3D"))
200 else if (!strcmp(name,
"RT0_2D"))
204 else if (!strcmp(name,
"RT1_2D"))
208 else if (!strcmp(name,
"RT2_2D"))
212 else if (!strcmp(name,
"RT0_3D"))
216 else if (!strcmp(name,
"RT1_3D"))
220 else if (!strncmp(name,
"H1_Trace_", 9))
224 else if (!strncmp(name,
"H1_Trace@", 9))
229 else if (!strncmp(name,
"H1_", 3))
233 else if (!strncmp(name,
"H1Pos_Trace_", 12))
238 else if (!strncmp(name,
"H1Pos_", 6))
242 else if (!strncmp(name,
"H1Ser_", 6))
246 else if (!strncmp(name,
"H1@", 3))
251 else if (!strncmp(name,
"L2_T", 4))
254 else if (!strncmp(name,
"L2_", 3))
258 else if (!strncmp(name,
"L2Int_T", 7))
263 else if (!strncmp(name,
"L2Int_", 6))
269 else if (!strncmp(name,
"RT_Trace_", 9))
273 else if (!strncmp(name,
"RT_ValTrace_", 12))
278 else if (!strncmp(name,
"RT_Trace@", 9))
284 else if (!strncmp(name,
"RT_ValTrace@", 12))
290 else if (!strncmp(name,
"DG_Iface_", 9))
294 else if (!strncmp(name,
"DG_Iface@", 9))
300 else if (!strncmp(name,
"DG_IntIface_", 12))
305 else if (!strncmp(name,
"DG_IntIface@", 12))
311 else if (!strncmp(name,
"RT_R1D_", 7))
315 else if (!strncmp(name,
"RT_R1D@", 7))
321 else if (!strncmp(name,
"RT_R2D_", 7))
325 else if (!strncmp(name,
"RT_R2D@", 7))
331 else if (!strncmp(name,
"RT_", 3))
335 else if (!strncmp(name,
"RT@", 3))
341 else if (!strncmp(name,
"ND_Trace_", 9))
345 else if (!strncmp(name,
"ND_Trace@", 9))
351 else if (!strncmp(name,
"ND_R1D_", 7))
355 else if (!strncmp(name,
"ND_R1D@", 7))
361 else if (!strncmp(name,
"ND_R2D_", 7))
365 else if (!strncmp(name,
"ND_R2D@", 7))
371 else if (!strncmp(name,
"ND_", 3))
375 else if (!strncmp(name,
"ND@", 3))
381 else if (!strncmp(name,
"Local_", 6))
385 else if (!strncmp(name,
"NURBS_HDiv", 10))
387 if (name[10] !=
'\0')
398 else if (!strncmp(name,
"NURBS_HCurl", 11))
400 if (name[11] !=
'\0')
411 else if (!strncmp(name,
"NURBS", 5))
426 MFEM_ABORT(
"unknown FiniteElementCollection: " << name);
435 MFEM_ABORT(
"Collection " <<
Name() <<
" does not support variable orders.");
457template <Geometry::Type geom>
462 nv = g_consts::NumVert;
463 ne = g_consts::NumEdges;
466template <Geometry::Type geom,
typename v_t>
468GetEdge(
int &nv, v_t &v,
int &ne,
int &e,
int &eo,
const int edge_info)
473 nv = e_consts::NumVert;
477 MFEM_ASSERT(0 <= e && e < g_consts::NumEdges,
"");
478 MFEM_ASSERT(0 <= eo && eo < e_consts::NumOrient,
"");
479 v[0] = e_consts::Orient[eo][0];
480 v[1] = e_consts::Orient[eo][1];
481 v[0] = g_consts::Edges[e][v[0]];
482 v[1] = g_consts::Edges[e][v[1]];
486 typename v_t,
typename e_t,
typename eo_t>
488GetFace(
int &nv, v_t &v,
int &ne, e_t &e, eo_t &eo,
494 nv = f_consts::NumVert;
499 MFEM_ASSERT(0 <=
f &&
f < g_consts::NumFaces,
"");
500 MFEM_ASSERT(0 <= fo && fo < f_consts::NumOrient,
"");
501 for (
int i = 0; i < f_consts::NumVert; i++)
503 v[i] = f_consts::Orient[fo][i];
504 v[i] = g_consts::FaceVert[
f][v[i]];
506 ne = f_consts::NumEdges;
507 for (
int i = 0; i < f_consts::NumEdges; i++)
509 int v0 = v[f_consts::Edges[i][0]];
510 int v1 = v[f_consts::Edges[i][1]];
512 if (v0 > v1) { std::swap(v0, v1); eor = 1; }
513 for (
int j = g_consts::VertToVert::I[v0];
true; j++)
515 MFEM_ASSERT(j < g_consts::VertToVert::I[v0+1],
516 "internal error, edge not found");
517 if (v1 == g_consts::VertToVert::J[j][0])
519 int en = g_consts::VertToVert::J[j][1];
539 "invalid Geom = " << Geom);
541 "invalid SDim = " << SDim <<
547 const int off = nvd*(Info/64);
549 for (
int i = 0; i < nvd; i++)
556 int v[4], e[4], eo[4],
f[1], fo[1];
557 int av = 0, nv = 0, ae = 0, ne = 0, nf = 0;
579 nv, v, ne, e, eo, nf,
f[0], fg[0], fo[0], Info);
597 nv, v, ne, e, eo, nf,
f[0], fg[0], fo[0], Info);
615 nv, v, ne, e, eo, nf,
f[0], fg[0], fo[0], Info);
633 nv, v, ne, e, eo, nf,
f[0], fg[0], fo[0], Info);
642 MFEM_ABORT(
"invalid Geom = " << Geom);
649 for (
int i = 0; i < nv; i++)
651 for (
int j = 0; j < nvd; j++)
653 dofs[i*nvd+j] = v[i]*nvd+j;
656 int l_off = nv*nvd, g_off = av*nvd;
661 for (
int i = 0; i < ne; i++)
665 for (
int j = 0; j < ned; j++)
667 dofs[l_off+i*ned+j] =
669 g_off+e[i]*ned+ed[j] :
670 -1-(g_off+e[i]*ned+(-1-ed[j]));
682 for (
int i = 0; i < nf; i++)
685 for (
int j = 0; j < nfd; j++)
687 dofs[l_off+i*nfd+j] =
689 g_off+
f[i]*nfd+fd[j] :
690 -1-(g_off+
f[i]*nfd+(-1-fd[j]));
701 ", SDim = " << SDim <<
" is not supported");
719 mfem_error (
"LinearFECollection: unknown geometry type.");
737 mfem_error (
"LinearFECollection: unknown geometry type.");
763 mfem_error (
"QuadraticFECollection: unknown geometry type.");
780 mfem_error (
"QuadraticFECollection: unknown geometry type.");
788 static int indexes[] = { 0 };
804 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
817 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
825 static int indexes[] = { 0 };
845 mfem_error (
"CubicFECollection: unknown geometry type.");
862 mfem_error (
"CubicFECollection: unknown geometry type.");
872 static int ind_pos[] = { 0, 1 };
873 static int ind_neg[] = { 1, 0 };
883 static int indexes[] = { 0 };
889 static int sq_ind[8][4] = {{0, 1, 2, 3}, {0, 2, 1, 3},
890 {2, 0, 3, 1}, {1, 0, 3, 2},
891 {3, 2, 1, 0}, {3, 1, 2, 0},
892 {1, 3, 0, 2}, {2, 3, 0, 1}
912 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
926 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
934 static int indexes[] = { 0 };
950 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
964 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
972 static int ind_pos[] = { 0 };
973 static int ind_neg[] = { -1 };
993 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
1007 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
1015 static int ind_pos[] = { 0, 1 };
1016 static int ind_neg[] = { -2, -1 };
1035 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
1049 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
1057 static int ind_pos[] = { 0, 1, 2 };
1058 static int ind_neg[] = { -3, -2, -1 };
1077 mfem_error (
"Const2DFECollection: unknown geometry type.");
1091 mfem_error (
"Const2DFECollection: unknown geometry type.");
1113 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
1127 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
1149 mfem_error (
"GaussLinearDiscont2DFECollection:"
1150 " unknown geometry type.");
1165 mfem_error (
"GaussLinearDiscont2DFECollection:"
1166 " unknown geometry type.");
1184 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
1186 return &QuadrilateralFE;
1197 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
1219 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1234 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1255 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1269 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1286 mfem_error (
"GaussQuadraticDiscont2DFECollection:"
1287 " unknown geometry type.");
1289 return &QuadrilateralFE;
1302 mfem_error (
"GaussQuadraticDiscont2DFECollection:"
1303 " unknown geometry type.");
1325 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1339 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1363 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1379 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1387 static int indexes[] = { 0 };
1404 mfem_error (
"Const3DFECollection: unknown geometry type.");
1406 return &TetrahedronFE;
1422 mfem_error (
"Const3DFECollection: unknown geometry type.");
1446 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1448 return &TetrahedronFE;
1464 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1486 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1488 return &TetrahedronFE;
1503 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1528 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1544 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1552 static int indexes[] = { 0 };
1569 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1571 return &HexahedronFE;
1587 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1595 static int ind_pos[] = { 0 };
1596 static int ind_neg[] = { -1 };
1619 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1621 return &HexahedronFE;
1637 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1645 static int ind_pos[] = { 0 };
1646 static int ind_neg[] = { -1 };
1669 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1671 return &HexahedronFE;
1684 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1694 static int sq_ind[8][4] =
1696 {0, 1, 2, 3}, {-1, -3, -2, -4},
1697 {2, 0, 3, 1}, {-2, -1, -4, -3},
1698 {3, 2, 1, 0}, {-4, -2, -3, -1},
1699 {1, 3, 0, 2}, {-3, -4, -1, -2}
1716 MFEM_VERIFY(
p >= 1,
"H1_FECollection requires order >= 1.");
1717 MFEM_VERIFY(
dim >= 0 &&
dim <= 3,
"H1_FECollection requires 0 <= dim <= 3.");
1719 const int pm1 =
p - 1, pm2 = pm1 - 1, pm3 = pm2 - 1, pm4 = pm3 - 1;
1746 snprintf(
h1_name, 32,
"H1@%c_%dD_P%d",
1756 for (
int i = 0; i < 2; i++)
1760 for (
int i = 0; i < 6; i++)
1764 for (
int i = 0; i < 8; i++)
1768 for (
int i = 0; i < 24; i++)
1788 SegDofOrd[0] = (pm1 > 0) ?
new int[2*pm1] :
nullptr;
1790 for (
int i = 0; i < pm1; i++)
1826 TriDofOrd[0] = (TriDof > 0) ?
new int[6*TriDof] :
nullptr;
1827 for (
int i = 1; i < 6; i++)
1832 for (
int j = 0; j < pm2; j++)
1834 for (
int i = 0; i + j < pm2; i++)
1836 int o = TriDof - ((pm1 - j)*(pm2 - j))/2 + i;
1837 int k = pm3 - j - i;
1839 TriDofOrd[1][o] = TriDof - ((pm1-j)*(pm2-j))/2 + k;
1840 TriDofOrd[2][o] = TriDof - ((pm1-i)*(pm2-i))/2 + k;
1841 TriDofOrd[3][o] = TriDof - ((pm1-k)*(pm2-k))/2 + i;
1842 TriDofOrd[4][o] = TriDof - ((pm1-k)*(pm2-k))/2 + j;
1843 TriDofOrd[5][o] = TriDof - ((pm1-i)*(pm2-i))/2 + j;
1847 QuadDofOrd[0] = (QuadDof > 0) ?
new int[8*QuadDof] :
nullptr;
1848 for (
int i = 1; i < 8; i++)
1871 for (
int j = 0; j < pm3; j++)
1873 for (
int i = 0; i < pm3; i++)
1880 QuadDofOrd[4][o] = (pm4 - i) + (pm4 - j)*pm3;
1881 QuadDofOrd[5][o] = (pm4 - j) + (pm4 - i)*pm3;
1891 for (
int j = 0; j < pm1; j++)
1893 for (
int i = 0; i < pm1; i++)
1900 QuadDofOrd[4][o] = (pm2 - i) + (pm2 - j)*pm1;
1901 QuadDofOrd[5][o] = (pm2 - j) + (pm2 - i)*pm1;
1917 else if (pyrtype == 1)
1949 TetDofOrd[0] = (TetDof > 0) ?
new int[24*TetDof] :
nullptr;
1950 for (
int i = 1; i < 24; i++)
1955 for (
int k = 0; k < pm3; k++)
1957 for (
int j = 0; j + k < pm3; j++)
1959 for (
int i = 0; i + j + k < pm3; i++)
1961 int l = pm4 - k - j - i;
1962 int o = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1963 + (j * (2 *
p - 5 - j - 2 * k)) / 2 + i;
1964 int o1 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1965 + (k * (2 *
p - 5 - k - 2 * j)) / 2 + i;
1966 int o2 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1967 + (k * (2 *
p - 5 - k - 2 * i)) / 2 + j;
1968 int o3 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1969 + (i * (2 *
p - 5 - i - 2 * k)) / 2 + j;
1970 int o4 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1971 + (i * (2 *
p - 5 - i - 2 * j)) / 2 + k;
1972 int o5 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1973 + (j * (2 *
p - 5 - j - 2 * i)) / 2 + k;
1974 int o6 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1975 + (l * (2 *
p - 5 - l - 2 * k)) / 2 + j;
1976 int o7 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1977 + (k * (2 *
p - 5 - k - 2 * l)) / 2 + j;
1978 int o8 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1979 + (j * (2 *
p - 5 - j - 2 * l)) / 2 + k;
1980 int o9 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1981 + (l * (2 *
p - 5 - l - 2 * j)) / 2 + k;
1982 int o10 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1983 + (k * (2 *
p - 5 - k - 2 * j)) / 2 + l;
1984 int o11 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1985 + (j * (2 *
p - 5 - j - 2 * k)) / 2 + l;
1986 int o12 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1987 + (l * (2 *
p - 5 - l - 2 * i)) / 2 + k;
1988 int o13 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1989 + (i * (2 *
p - 5 - i - 2 * l)) / 2 + k;
1990 int o14 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1991 + (i * (2 *
p - 5 - i - 2 * k)) / 2 + l;
1992 int o15 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1993 + (k * (2 *
p - 5 - k - 2 * i)) / 2 + l;
1994 int o16 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1995 + (k * (2 *
p - 5 - k - 2 * l)) / 2 + i;
1996 int o17 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1997 + (l * (2 *
p - 5 - l - 2 * k)) / 2 + i;
1998 int o18 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1999 + (j * (2 *
p - 5 - j - 2 * i)) / 2 + l;
2000 int o19 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
2001 + (i * (2 *
p - 5 - i - 2 * j)) / 2 + l;
2002 int o20 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
2003 + (l * (2 *
p - 5 - l - 2 * j)) / 2 + i;
2004 int o21 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
2005 + (j * (2 *
p - 5 - j - 2 * l)) / 2 + i;
2006 int o22 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
2007 + (i * (2 *
p - 5 - i - 2 * l)) / 2 + j;
2008 int o23 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
2009 + (l * (2 *
p - 5 - l - 2 * i)) / 2 + j;
2073 if (!strncmp(
h1_name,
"H1_", 3))
2077 else if (!strncmp(
h1_name,
"H1Pos_", 6))
2081 else if (!strncmp(
h1_name,
"H1@", 3))
2090 const int *dof_map = NULL;
2100 MFEM_ABORT(
"Geometry type " <<
Geometry::Name[GeomType] <<
" is not "
2132 snprintf(
h1_name, 32,
"H1_Trace_%dD_P%d",
dim,
p);
2136 snprintf(
h1_name, 32,
"H1Pos_Trace_%dD_P%d",
dim,
p);
2140 snprintf(
h1_name, 32,
"H1_Trace@%c_%dD_P%d",
2147 const int map_type,
const int pyr_type)
2152 MFEM_VERIFY(
p >= 0,
"L2_FECollection requires order >= 0.");
2155 const char *prefix = NULL;
2161 MFEM_ABORT(
"invalid map_type: " << map_type);
2166 snprintf(d_name, 32,
"%s_%dD_P%d", prefix,
dim,
p);
2169 snprintf(d_name, 32,
"%s_T%d_%dD_P%d", prefix, btype,
dim,
p);
2174 L2_Elements[g] = NULL;
2175 Tr_Elements[g] = NULL;
2177 for (
int i = 0; i < 2; i++)
2179 SegDofOrd[i] = NULL;
2181 for (
int i = 0; i < 6; i++)
2183 TriDofOrd[i] = NULL;
2185 for (
int i = 0; i < 24; i++)
2187 TetDofOrd[i] = NULL;
2210 const int pp1 =
p + 1;
2211 SegDofOrd[0] = (pp1 > 0) ?
new int[2*pp1] :
nullptr;
2212 SegDofOrd[1] = SegDofOrd[0] + pp1;
2213 for (
int i = 0; i <=
p; i++)
2215 SegDofOrd[0][i] = i;
2216 SegDofOrd[1][i] =
p - i;
2244 TriDofOrd[0] = (TriDof > 0) ?
new int[6*TriDof] :
nullptr;
2245 for (
int i = 1; i < 6; i++)
2247 TriDofOrd[i] = TriDofOrd[i-1] + TriDof;
2249 const int pp1 =
p + 1, pp2 = pp1 + 1;
2250 for (
int j = 0; j <=
p; j++)
2252 for (
int i = 0; i + j <=
p; i++)
2254 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
2256 TriDofOrd[0][o] = o;
2257 TriDofOrd[1][o] = TriDof - ((pp2-j)*(pp1-j))/2 + k;
2258 TriDofOrd[2][o] = TriDof - ((pp2-i)*(pp1-i))/2 + k;
2259 TriDofOrd[3][o] = TriDof - ((pp2-k)*(pp1-k))/2 + i;
2260 TriDofOrd[4][o] = TriDof - ((pp2-k)*(pp1-k))/2 + j;
2261 TriDofOrd[5][o] = TriDof - ((pp2-i)*(pp1-i))/2 + j;
2265 OtherDofOrd = (QuadDof > 0) ?
new int[QuadDof] :
nullptr;
2266 for (
int j = 0; j < QuadDof; j++)
2320 const int MaxDof = std::max(std::max(TetDof, PyrDof),
2321 std::max(PriDof, HexDof));
2323 TetDofOrd[0] = (TetDof > 0) ?
new int[24*TetDof] :
nullptr;
2324 for (
int i = 1; i < 24; i++)
2326 TetDofOrd[i] = TetDofOrd[i-1] + TetDof;
2329 const int pp1 =
p + 1, pp2 = pp1 + 1, pp3 = pp2 + 1;
2330 for (
int k = 0; k <=
p; k++)
2332 for (
int j = 0; j + k <=
p; j++)
2334 for (
int i = 0; i + j + k <=
p; i++)
2336 int l =
p - k - j - i;
2337 int o = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2338 + (j * (2 *
p + 3 - j - 2 * k)) / 2 + i;
2339 int o1 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2340 + (k * (2 *
p + 3 - k - 2 * j)) / 2 + i;
2341 int o2 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2342 + (k * (2 *
p + 3 - k - 2 * i)) / 2 + j;
2343 int o3 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2344 + (i * (2 *
p + 3 - i - 2 * k)) / 2 + j;
2345 int o4 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2346 + (i * (2 *
p + 3 - i - 2 * j)) / 2 + k;
2347 int o5 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2348 + (j * (2 *
p + 3 - j - 2 * i)) / 2 + k;
2349 int o6 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2350 + (l * (2 *
p + 3 - l - 2 * k)) / 2 + j;
2351 int o7 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2352 + (k * (2 *
p + 3 - k - 2 * l)) / 2 + j;
2353 int o8 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2354 + (j * (2 *
p + 3 - j - 2 * l)) / 2 + k;
2355 int o9 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2356 + (l * (2 *
p + 3 - l - 2 * j)) / 2 + k;
2357 int o10 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2358 + (k * (2 *
p + 3 - k - 2 * j)) / 2 + l;
2359 int o11 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2360 + (j * (2 *
p + 3 - j - 2 * k)) / 2 + l;
2361 int o12 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2362 + (l * (2 *
p + 3 - l - 2 * i)) / 2 + k;
2363 int o13 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2364 + (i * (2 *
p + 3 - i - 2 * l)) / 2 + k;
2365 int o14 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2366 + (i * (2 *
p + 3 - i - 2 * k)) / 2 + l;
2367 int o15 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2368 + (k * (2 *
p + 3 - k - 2 * i)) / 2 + l;
2369 int o16 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2370 + (k * (2 *
p + 3 - k - 2 * l)) / 2 + i;
2371 int o17 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2372 + (l * (2 *
p + 3 - l - 2 * k)) / 2 + i;
2373 int o18 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2374 + (j * (2 *
p + 3 - j - 2 * i)) / 2 + l;
2375 int o19 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2376 + (i * (2 *
p + 3 - i - 2 * j)) / 2 + l;
2377 int o20 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2378 + (l * (2 *
p + 3 - l - 2 * j)) / 2 + i;
2379 int o21 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2380 + (j * (2 *
p + 3 - j - 2 * l)) / 2 + i;
2381 int o22 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2382 + (i * (2 *
p + 3 - i - 2 * l)) / 2 + j;
2383 int o23 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2384 + (l * (2 *
p + 3 - l - 2 * i)) / 2 + j;
2385 TetDofOrd[ 0][o] = o;
2386 TetDofOrd[ 1][o] = o1;
2387 TetDofOrd[ 2][o] = o2;
2388 TetDofOrd[ 3][o] = o3;
2389 TetDofOrd[ 4][o] = o4;
2390 TetDofOrd[ 5][o] = o5;
2391 TetDofOrd[ 6][o] = o6;
2392 TetDofOrd[ 7][o] = o7;
2393 TetDofOrd[ 8][o] = o8;
2394 TetDofOrd[ 9][o] = o9;
2395 TetDofOrd[10][o] = o10;
2396 TetDofOrd[11][o] = o11;
2397 TetDofOrd[12][o] = o12;
2398 TetDofOrd[13][o] = o13;
2399 TetDofOrd[14][o] = o14;
2400 TetDofOrd[15][o] = o15;
2401 TetDofOrd[16][o] = o16;
2402 TetDofOrd[17][o] = o17;
2403 TetDofOrd[18][o] = o18;
2404 TetDofOrd[19][o] = o19;
2405 TetDofOrd[20][o] = o20;
2406 TetDofOrd[21][o] = o21;
2407 TetDofOrd[22][o] = o22;
2408 TetDofOrd[23][o] = o23;
2412 OtherDofOrd = (MaxDof > 0) ?
new int[MaxDof] :
nullptr;
2413 for (
int j = 0; j < MaxDof; j++)
2420 mfem::err <<
"L2_FECollection::L2_FECollection : dim = "
2429 return L2_Elements[GeomType];
2438 return (Or > 0) ? SegDofOrd[0] : SegDofOrd[1];
2441 return TriDofOrd[Or%6];
2444 return TetDofOrd[Or%24];
2447 return (Or == 0) ? OtherDofOrd : NULL;
2453 delete [] OtherDofOrd;
2454 delete [] SegDofOrd[0];
2455 delete [] TriDofOrd[0];
2456 delete [] TetDofOrd[0];
2459 delete L2_Elements[i];
2460 delete Tr_Elements[i];
2466 const int cb_type,
const int ob_type)
2473 MFEM_VERIFY(
p >= 0,
"RT_FECollection requires order >= 0.");
2481 MFEM_ABORT(
"unknown closed BasisType: " << cb_name);
2486 MFEM_ABORT(
"unknown open BasisType: " << ob_name);
2502 const int pp1 =
p + 1;
2531 MFEM_ABORT(
"invalid dim = " <<
dim);
2538 const int map_type,
const bool signs,
2548 MFEM_ABORT(
"Invalid open basis type: " << ob_name);
2560 "invalid open point type");
2562 const int pp1 =
p + 1, pp2 =
p + 2;
2570 for (
int i = 0; i < 2; i++)
2574 for (
int i = 0; i < 6; i++)
2578 for (
int i = 0; i < 8; i++)
2590 SegDofOrd[0] = (pp1 > 0) ?
new int[2*pp1] :
nullptr;
2592 for (
int i = 0; i <=
p; i++)
2595 SegDofOrd[1][i] = signs ? (-1 - (
p - i)) : (
p - i);
2611 TriDofOrd[0] = (TriDof > 0) ?
new int[6*TriDof] :
nullptr;
2612 for (
int i = 1; i < 6; i++)
2618 for (
int j = 0; j <=
p; j++)
2620 for (
int i = 0; i + j <=
p; i++)
2622 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
2625 TriDofOrd[1][o] = -1-(TriDof-((pp2-j)*(pp1-j))/2+k);
2626 TriDofOrd[2][o] = TriDof-((pp2-i)*(pp1-i))/2+k;
2627 TriDofOrd[3][o] = -1-(TriDof-((pp2-k)*(pp1-k))/2+i);
2628 TriDofOrd[4][o] = TriDof-((pp2-k)*(pp1-k))/2+j;
2629 TriDofOrd[5][o] = -1-(TriDof-((pp2-i)*(pp1-i))/2+j);
2632 for (
int kk = 1; kk < 6; kk += 2)
2641 QuadDofOrd[0] = (QuadDof > 0) ?
new int[8*QuadDof] :
nullptr;
2642 for (
int i = 1; i < 8; i++)
2647 for (
int j = 0; j <=
p; j++)
2649 for (
int i = 0; i <=
p; i++)
2662 for (
int k = 1; k < 8; k += 2)
2699 if (!strncmp(
rt_name,
"RT_", 3))
2730 const char *prefix =
2732 char ob_str[3] = {
'\0',
'\0',
'\0' };
2739 snprintf(
rt_name, 32,
"%s%s_%dD_P%d", prefix, ob_str,
dim,
p);
2741 MFEM_VERIFY(
dim == 2 ||
dim == 3,
"Wrong dimension, dim = " <<
dim);
2750 MFEM_VERIFY(
dim == 2 ||
dim == 3,
"Wrong dimension, dim = " <<
dim);
2752 const char *prefix =
2756 snprintf(
rt_name, 32,
"%s_%dD_P%d", prefix,
dim,
p);
2760 snprintf(
rt_name, 32,
"%s@%c_%dD_P%d", prefix,
2766 const int cb_type,
const int ob_type)
2772 MFEM_VERIFY(
p >= 1,
"ND_FECollection requires order >= 1.");
2773 MFEM_VERIFY(
dim >= 1 &&
dim <= 3,
"ND_FECollection requires 1 <= dim <= 3.");
2775 const int pm1 =
p - 1, pm2 =
p - 2;
2793 for (
int i = 0; i < 2; i++)
2797 for (
int i = 0; i < 6; i++)
2801 for (
int i = 0; i < 8; i++)
2813 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
2818 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
2828 for (
int i = 0; i <
p; i++)
2846 QuadDofOrd[0] = (QuadDof > 0) ?
new int[8*QuadDof] :
nullptr;
2847 for (
int i = 1; i < 8; i++)
2852 for (
int j = 0; j < pm1; j++)
2854 for (
int i = 0; i <
p; i++)
2857 int d2 =
p*pm1 + j + i*pm1;
2867 QuadDofOrd[2][d1] = -1 - (
p*pm1 + j + (pm1 - i)*pm1);
2873 QuadDofOrd[4][d1] = -1 - ((pm1 - i) + (pm2 - j)*
p);
2874 QuadDofOrd[4][d2] = -1 - (
p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2876 QuadDofOrd[5][d1] = -1 - (
p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2877 QuadDofOrd[5][d2] = -1 - ((pm1 - i) + (pm2 - j)*
p);
2885 QuadDofOrd[7][d2] = -1 - (
p*pm1 + j + (pm1 - i)*pm1);
2890 TriDofOrd[0] = (TriDof > 0) ?
new int[6*TriDof] :
nullptr;
2891 for (
int i = 1; i < 6; i++)
2897 for (
int j = 0; j <= pm2; j++)
2899 for (
int i = 0; i + j <= pm2; i++)
2901 int k0 =
p*pm1 - (
p - j)*(pm1 - j) + 2*i;
2902 int k1 = 2*pm2 - 2*i + ((2*
p-3)-j)*j;
2903 int k2 = 2*pm2 - 2*j + ((2*
p-3)-i)*i;
2904 int k3 =
p*pm1 - 2 - 3*j - i - (i+j)*(i+j);
2905 int k4 =
p*pm1 - 2 - 3*i - j - (i+j)*(i+j);
2906 int k5 =
p*pm1 - (
p - i)*(pm1 - i) + 2*j;
2986 int tr_p, tr_dim, tr_cb_type, tr_ob_type;
3024 snprintf(
nd_name, 32,
"ND_Trace_%dD_P%d",
dim,
p);
3028 snprintf(
nd_name, 32,
"ND_Trace@%c%c_%dD_P%d",
3036 const int cb_type,
const int ob_type)
3039 MFEM_VERIFY(
p >= 1,
"ND_R1D_FECollection requires order >= 1.");
3040 MFEM_VERIFY(
dim == 1,
"ND_R1D_FECollection requires dim == 1.");
3049 snprintf(
nd_name, 32,
"ND_R1D@%c%c_%dD_P%d",
3067 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
3072 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
3105 const int cb_type,
const int ob_type)
3108 MFEM_VERIFY(
p >= 0,
"RT_R1D_FECollection requires order >= 0.");
3109 MFEM_VERIFY(
dim == 1,
"RT_R1D_FECollection requires dim == 1.");
3118 snprintf(
rt_name, 32,
"RT_R1D@%c%c_%dD_P%d",
3136 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
3141 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
3161 MFEM_ABORT(
"this method is not implemented in RT_R1D_FECollection!");
3175 const int cb_type,
const int ob_type)
3178 MFEM_VERIFY(
p >= 1,
"ND_R2D_FECollection requires order >= 1.");
3179 MFEM_VERIFY(
dim >= 1 &&
dim <= 2,
3180 "ND_R2D_FECollection requires 1 <= dim <= 2.");
3182 const int pm1 =
p - 1, pm2 =
p - 2;
3191 snprintf(
nd_name, 32,
"ND_R2D@%c%c_%dD_P%d",
3201 for (
int i = 0; i < 2; i++)
3213 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
3218 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
3230 SegDofOrd[0] = (4*
p > 2) ?
new int[4 *
p - 2] :
nullptr;
3232 for (
int i = 0; i <
p; i++)
3237 for (
int i = 0; i < pm1; i++)
3269 int p,
dim, cb_type, ob_type;
3305 snprintf(
nd_name, 32,
"ND_R2D_Trace_%dD_P%d",
dim,
p);
3309 snprintf(
nd_name, 32,
"ND_R2D_Trace@%c%c_%dD_P%d",
3317 const int cb_type,
const int ob_type)
3321 MFEM_VERIFY(
p >= 0,
"RT_R2D_FECollection requires order >= 0.");
3322 MFEM_VERIFY(
dim >= 1 &&
dim <= 2,
3323 "RT_R2D_FECollection requires 1 <= dim <= 2.");
3331 MFEM_ABORT(
"unknown closed BasisType: " << cb_name);
3336 MFEM_ABORT(
"unknown open BasisType: " << ob_name);
3348 snprintf(
rt_name, 32,
"RT_R2D@%c%c_%dD_P%d",
3353 const int pp1 =
p + 1;
3354 const int pp2 =
p + 2;
3373 const bool signs,
const int ob_type)
3380 MFEM_ABORT(
"Invalid open basis type: " << ob_name);
3392 "invalid open point type");
3394 const int pp1 =
p + 1;
3402 for (
int i = 0; i < 2; i++)
3414 SegDofOrd[0] = (pp1 > 0) ?
new int[2*pp1] :
nullptr;
3416 for (
int i = 0; i <=
p; i++)
3419 SegDofOrd[1][i] = signs ? (-1 - (
p - i)) : (
p - i);
3437 if (!strncmp(
rt_name,
"RT_R2D_", 7))
3465 const char *prefix =
3467 char ob_str[3] = {
'\0',
'\0',
'\0' };
3474 snprintf(
rt_name, 32,
"%s%s_%dD_P%d", prefix, ob_str,
dim,
p);
3476 MFEM_VERIFY(
dim == 2,
"Wrong dimension, dim = " <<
dim);
3482 snprintf(d_name, 32,
"Local_%s", fe_name);
3484 Local_Element = NULL;
3486 if (!strcmp(fe_name,
"BiCubic2DFiniteElement") ||
3487 !strcmp(fe_name,
"Quad_Q3"))
3492 else if (!strcmp(fe_name,
"Nedelec1HexFiniteElement") ||
3493 !strcmp(fe_name,
"Hex_ND1"))
3498 else if (!strncmp(fe_name,
"H1_", 3))
3503 else if (!strncmp(fe_name,
"H1Pos_", 6))
3508 else if (!strncmp(fe_name,
"L2_", 3))
3515 mfem::err <<
"Local_FECollection::Local_FECollection : fe_name = "
3539 snprintf(
name, 16,
"NURBS%i", Order);
3543 snprintf(
name, 16,
"NURBS");
3566 mfem_error (
"NURBSFECollection: unknown geometry type.");
3573 mfem_error(
"NURBSFECollection::DofForGeometry");
3580 mfem_error(
"NURBSFECollection::DofOrderForOrientation");
3586 MFEM_ABORT(
"NURBS finite elements can not be statically condensed!");
3611 qFE = QuadrilateralVFE;
3617 qFE = QuadrilateralFE;
3618 hFE = ParallelepipedVFE;
3623 mfem_error (
"NURBS_HDivFECollection: wrong dimension!");
3630 delete QuadrilateralFE;
3631 delete QuadrilateralVFE;
3632 delete ParallelepipedVFE;
3645 mfem_error (
"NURBS_HDivFECollection: unknown geometry type.");
3647 return QuadrilateralFE;
3655 snprintf(
name, 16,
"NURBS_HDiv%i", Order);
3659 snprintf(
name, 16,
"NURBS_HDiv");
3665 mfem_error(
"NURBS_HDivFECollection::DofForGeometry");
3673 mfem_error(
"NURBS_HDivFECollection::DofOrderForOrientation");
3679 MFEM_ABORT(
"NURBS finite elements can not be statically condensed!");
3702 qFE = QuadrilateralVFE;
3708 qFE = QuadrilateralFE;
3709 hFE = ParallelepipedVFE;
3714 mfem_error (
"NURBS_HCurlFECollection: wrong dimension!");
3723 delete QuadrilateralFE;
3724 delete QuadrilateralVFE;
3725 delete ParallelepipedVFE;
3738 mfem_error (
"NURBS_HCurlFECollection: unknown geometry type.");
3740 return QuadrilateralFE;
3748 snprintf(
name, 16,
"NURBS_HCurl%i", Order);
3752 snprintf(
name, 16,
"NURBS_HCurl");
3758 mfem_error(
"NURBS_HCurlFECollection::DofForGeometry");
3766 mfem_error(
"NURBS_HCurlFECollection::DofOrderForOrientation");
3772 MFEM_ABORT(
"NURBS finite elements can not be statically condensed!");
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
int Size() const
Return the logical size of the array.
T * GetData()
Returns the data.
static int GetQuadrature1D(int b_type)
Get the corresponding Quadrature1D constant, when that makes sense; otherwise return Quadrature1D::In...
static int Check(int b_type)
If the input does not represents a valid BasisType, abort with an error; otherwise return the input.
static char GetChar(int b_type)
Check and convert a BasisType constant to a char basis identifier.
@ Serendipity
Serendipity basis (squares / cubes)
@ GaussLobatto
Closed type.
@ GaussLegendre
Open type.
@ Positive
Bernstein polynomials.
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.
A 2D bi-cubic element on a square with uniformly spaces nodes.
Piecewise-constant discontinuous finite elements in 2D. This class is kept only for backward compatib...
int DofForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
Piecewise-constant discontinuous finite elements in 3D. This class is kept only for backward compatib...
int DofForGeometry(Geometry::Type GeomType) const override
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
Crouzeix-Raviart nonconforming elements in 2D.
int DofForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
Piecewise-cubic discontinuous finite elements in 2D. This class is kept only for backward compatibili...
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
int DofForGeometry(Geometry::Type GeomType) const override
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
Piecewise-(bi)cubic continuous finite elements.
int DofForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
DG_Interface_FECollection(const int p, const int dim, const int map_type=FiniteElement::VALUE, const int ob_type=BasisType::GaussLegendre)
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
ErrorMode error_mode
How to treat errors in FiniteElementForGeometry() calls.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const =0
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
int GetRangeType(int dim) const
static FiniteElementCollection * New(const char *name)
Factory method: return a newly allocated FiniteElementCollection according to the given name.
int GetOrder() const
Return the order (polynomial degree) of the FE collection, corresponding to the order/degree returned...
int HasFaceDofs(Geometry::Type geom, int p) const
int GetDerivRangeType(int dim) const
virtual FiniteElementCollection * Clone(int p) const
Instantiate a new collection of the same type with a different order.
virtual int DofForGeometry(Geometry::Type GeomType) const =0
virtual ~FiniteElementCollection()
int GetNumDof(Geometry::Type geom, int p) const
Variable order version of DofForGeometry().
virtual const FiniteElement * FiniteElementForDim(int dim) const
Returns the first non-NULL FiniteElement for the given dimension.
static void GetEdge(int &nv, v_t &v, int &ne, int &e, int &eo, const int edge_info)
void InitVarOrder(int p) const
int GetDerivType(int dim) const
const int base_p
Order as returned by GetOrder().
virtual const char * Name() const
int GetRangeDim(int dim) const
int GetDerivMapType(int dim) 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)
int GetMapType(int dim) const
Array< FiniteElementCollection * > var_orders
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const =0
virtual FiniteElementCollection * GetTraceCollection() const
void SubDofOrder(Geometry::Type Geom, int SDim, int Info, Array< int > &dofs) const
Get the local dofs for a given sub-manifold.
static void GetNVE(int &nv, int &ne)
ErrorMode
How to treat errors in FiniteElementForGeometry() calls.
@ RETURN_NULL
Return NULL on errors.
Abstract class for all finite elements.
int GetDerivMapType() const
Returns the FiniteElement::DerivType of the element describing how reference function derivatives are...
int GetRangeDim() const
Returns the vector dimension for vector-valued finite elements, which is also the dimension of the in...
int GetDerivType() const
Returns the FiniteElement::DerivType of the element describing the spatial derivative method implemen...
virtual const StatelessDofTransformation * GetDofTransformation() const
Return a DoF transformation object for this particular type of basis.
int GetMapType() const
Returns the FiniteElement::MapType of the element describing how reference functions are mapped to ph...
int GetRangeType() const
Returns the FiniteElement::RangeType of the element, one of {SCALAR, VECTOR}.
@ NONE
No derivatives implemented.
int GetDerivRangeType() const
Returns the FiniteElement::RangeType of the element derivative, either SCALAR or VECTOR.
int GetDof() const
Returns the number of degrees of freedom in the finite element.
Version of LinearDiscont2DFECollection with dofs in the Gaussian points.
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
int DofForGeometry(Geometry::Type GeomType) const override
Version of QuadraticDiscont2DFECollection with dofs in the Gaussian points.
int DofForGeometry(Geometry::Type GeomType) const override
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
static const int Dimension[NumGeom]
static const char * Name[NumGeom]
static bool IsTensorProduct(Type geom)
static const int DimStart[MaxDim+2]
Arbitrary order H1-conforming (continuous) finite elements with positive basis functions.
Arbitrary order H1 elements in 3D utilizing the Bernstein basis on a cube.
Arbitrary order H1 elements in 2D utilizing the Bernstein basis on a square.
Arbitrary order H1 elements in 1D utilizing the Bernstein basis.
Arbitrary order H1 elements in 2D utilizing the Bernstein basis on a triangle.
Arbitrary order H1 elements in 3D utilizing the Bernstein basis on a wedge.
Arbitrary order H1 serendipity elements in 2D on a quad.
Arbitrary order H1-conforming (continuous) finite elements.
H1_FECollection(const int p, const int dim=3, const int btype=BasisType::GaussLobatto, const int pyrtype=1)
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
virtual ~H1_FECollection()
FiniteElementCollection * GetTraceCollection() const override
int H1_dof[Geometry::NumGeom]
FiniteElement * H1_Elements[Geometry::NumGeom]
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
const int * GetDofMap(Geometry::Type GeomType) const
Get the Cartesian to local H1 dof map.
Arbitrary order H1 elements in 3D on a cube.
Arbitrary order H1 elements in 2D on a square.
Arbitrary order H1 elements in 1D.
Arbitrary order H1 elements in 3D on a tetrahedron.
Arbitrary order "H^{1/2}-conforming" trace finite elements defined on the interface between mesh elem...
H1_Trace_FECollection(const int p, const int dim, const int btype=BasisType::GaussLobatto)
Arbitrary order H1 elements in 2D on a triangle.
Arbitrary order H1 elements in 3D on a wedge.
Arbitrary order L2 elements in 3D utilizing the Bernstein basis on a cube.
Arbitrary order L2 elements in 3D utilizing the Bernstein basis on a pyramid.
Arbitrary order L2 elements in 2D utilizing the Bernstein basis on a square.
Arbitrary order L2 elements in 1D utilizing the Bernstein basis on a segment.
Arbitrary order L2 elements in 2D utilizing the Bernstein basis on a triangle.
Arbitrary order L2 elements in 3D utilizing the Bernstein basis on a wedge.
Arbitrary order L2 elements in 3D on a pyramid.
Arbitrary order "L2-conforming" discontinuous finite elements.
L2_FECollection(const int p, const int dim, const int btype=BasisType::GaussLegendre, const int map_type=FiniteElement::VALUE, const int pyrtype=1)
virtual ~L2_FECollection()
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
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 3D on a cube.
Arbitrary order L2 elements in 2D on a square.
Arbitrary order L2 elements in 1D on a segment.
Arbitrary order L2 elements in 3D on a tetrahedron.
Arbitrary order L2 elements in 2D on a triangle.
Arbitrary order L2 elements in 3D on a wedge.
Piecewise-linear discontinuous finite elements in 2D. This class is kept only for backward compatibil...
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
int DofForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
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 3D. This class is kept only for backward compatibil...
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
int DofForGeometry(Geometry::Type GeomType) const override
Piecewise-(bi/tri)linear continuous finite elements.
int DofForGeometry(Geometry::Type GeomType) const override
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
Piecewise-linear nonconforming finite elements in 3D.
int DofForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
Discontinuous collection defined locally by a given finite element.
Local_FECollection(const char *fe_name)
Lowest order Nedelec finite elements in 3D. This class is kept only for backward compatibility,...
int DofForGeometry(Geometry::Type GeomType) const override
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
Arbitrary order H(curl)-conforming Nedelec finite elements.
int ND_dof[Geometry::NumGeom]
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
FiniteElementCollection * GetTraceCollection() const override
virtual ~ND_FECollection()
const StatelessDofTransformation * DofTransformationForGeometry(Geometry::Type GeomType) const override
Returns a DoF transformation object compatible with this basis and geometry type.
FiniteElement * ND_Elements[Geometry::NumGeom]
ND_FECollection(const int p, const int dim, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Arbitrary order Nedelec elements in 3D on a cube.
Arbitrary order Nedelec elements in 2D on a square.
Arbitrary order 3D H(curl)-conforming Nedelec finite elements in 1D.
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
virtual ~ND_R1D_FECollection()
int ND_dof[Geometry::NumGeom]
ND_R1D_FECollection(const int p, const int dim, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
FiniteElement * ND_Elements[Geometry::NumGeom]
FiniteElementCollection * GetTraceCollection() const override
A 0D Nedelec finite element for the boundary of a 1D domain.
Arbitrary order, three component, Nedelec elements in 1D on a segment.
Arbitrary order 3D H(curl)-conforming Nedelec finite elements in 2D.
FiniteElementCollection * GetTraceCollection() const override
ND_R2D_FECollection(const int p, const int dim, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
virtual ~ND_R2D_FECollection()
FiniteElement * ND_Elements[Geometry::NumGeom]
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
int ND_dof[Geometry::NumGeom]
Arbitrary order Nedelec 3D elements in 2D on a square.
Arbitrary order 3D H(curl)-trace finite elements in 2D defined on the interface between mesh elements...
ND_R2D_Trace_FECollection(const int p, const int dim, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Arbitrary order Nedelec 3D elements in 2D on a triangle.
Arbitrary order Nedelec elements in 1D on a segment.
Arbitrary order Nedelec elements in 3D on a tetrahedron.
Arbitrary order H(curl)-trace finite elements defined on the interface between mesh elements (faces,...
ND_Trace_FECollection(const int p, const int dim, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Arbitrary order Nedelec elements in 2D on a triangle.
An arbitrary order 1D NURBS element on a segment.
An arbitrary order 2D NURBS element on a square.
An arbitrary order 3D NURBS element on a cube.
Arbitrary order non-uniform rational B-splines (NURBS) finite elements.
virtual ~NURBSFECollection()
int DofForGeometry(Geometry::Type GeomType) const override
virtual void SetOrder(int Order) const
Set the order and the name, based on the given Order: either a positive number for fixed order,...
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
NURBS2DFiniteElement * QuadrilateralFE
NURBS1DFiniteElement * SegmentFE
NURBSFECollection(int Order=VariableOrder)
The parameter Order must be either a positive number, for fixed order, or VariableOrder (default).
FiniteElementCollection * GetTraceCollection() const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
NURBS3DFiniteElement * ParallelepipedFE
PointFiniteElement * PointFE
Arbitrary order H(curl) NURBS finite elements.
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
void SetOrder(int Order) const override
Set the order and the name, based on the given Order: either a positive number for fixed order,...
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
NURBS_HCurlFECollection(int Order=VariableOrder, const int vdim=-1)
The parameter Order must be either a positive number, for fixed order, or VariableOrder (default).
void SetDim(const int dim) override
int DofForGeometry(Geometry::Type GeomType) const override
virtual ~NURBS_HCurlFECollection()
FiniteElementCollection * GetTraceCollection() const override
Arbitrary order H(div) NURBS finite elements.
void SetDim(const int dim) override
int DofForGeometry(Geometry::Type GeomType) const override
void SetOrder(int Order) const override
Set the order and the name, based on the given Order: either a positive number for fixed order,...
FiniteElementCollection * GetTraceCollection() const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
NURBS_HDivFECollection(int Order=VariableOrder, const int vdim=-1)
The parameter Order must be either a positive number, for fixed order, or VariableOrder (default).
virtual ~NURBS_HDivFECollection()
A 3D 1st order Nedelec element on a cube.
Class for standard nodal finite elements.
const Array< int > & GetLexicographicOrdering() const
Get an Array<int> that maps lexicographically ordered indices to the indices of the respective nodes/...
void SetMapType(const int map_type_) override
Set the FiniteElement::MapType of the element to either VALUE or INTEGRAL. Also sets the FiniteElemen...
Linear (P1) finite elements on quadrilaterals.
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
int DofForGeometry(Geometry::Type GeomType) const override
A 0D point finite element.
Piecewise-quadratic discontinuous finite elements in 2D. This class is kept only for backward compati...
int DofForGeometry(Geometry::Type GeomType) const override
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
Piecewise-quadratic discontinuous finite elements in 3D. This class is kept only for backward compati...
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
int DofForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
Piecewise-(bi)quadratic continuous finite elements.
int DofForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
Version of QuadraticDiscont2DFECollection with positive basis functions.
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
int DofForGeometry(Geometry::Type GeomType) const override
Version of QuadraticFECollection with positive basis functions.
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
int DofForGeometry(Geometry::Type GeomType) const override
static int CheckOpen(int type)
If the Quadrature1D type is not open return Invalid; otherwise return type.
static int CheckClosed(int type)
If the Quadrature1D type is not closed return Invalid; otherwise return type.
First order Raviart-Thomas finite elements in 2D. This class is kept only for backward compatibility,...
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
int DofForGeometry(Geometry::Type GeomType) const override
First order Raviart-Thomas finite elements in 3D. This class is kept only for backward compatibility,...
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
int DofForGeometry(Geometry::Type GeomType) const override
Second order Raviart-Thomas finite elements in 2D. This class is kept only for backward compatibility...
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
int DofForGeometry(Geometry::Type GeomType) const override
Second order Raviart-Thomas finite elements in 3D. This class is kept only for backward compatibility...
int DofForGeometry(Geometry::Type GeomType) const override
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
Third order Raviart-Thomas finite elements in 2D. This class is kept only for backward compatibility,...
int DofForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
Arbitrary order H(div)-conforming Raviart-Thomas finite elements.
int RT_dof[Geometry::NumGeom]
FiniteElement * RT_Elements[Geometry::NumGeom]
void InitFaces(const int p, const int dim, const int map_type, const bool signs)
virtual ~RT_FECollection()
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
FiniteElementCollection * GetTraceCollection() const override
RT_FECollection(const int p, const int dim, const int map_type, const bool signs, const int ob_type=BasisType::GaussLegendre)
Arbitrary order Raviart-Thomas elements in 3D on a cube.
Arbitrary order Raviart-Thomas elements in 2D on a square.
Arbitrary order 3D H(div)-conforming Raviart-Thomas finite elements in 1D.
virtual ~RT_R1D_FECollection()
FiniteElementCollection * GetTraceCollection() const override
FiniteElement * RT_Elements[Geometry::NumGeom]
RT_R1D_FECollection(const int p, const int dim, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
int RT_dof[Geometry::NumGeom]
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
Arbitrary order, three component, Raviart-Thomas elements in 1D on a segment.
Arbitrary order 3D H(div)-conforming Raviart-Thomas finite elements in 2D.
void InitFaces(const int p, const int dim, const int map_type, const bool signs)
RT_R2D_FECollection(const int p, const int dim, const int map_type, const bool signs, const int ob_type=BasisType::GaussLegendre)
FiniteElement * RT_Elements[Geometry::NumGeom]
virtual ~RT_R2D_FECollection()
int RT_dof[Geometry::NumGeom]
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
FiniteElementCollection * GetTraceCollection() const override
Arbitrary order Raviart-Thomas 3D elements in 2D on a square.
Arbitrary order 3D "H^{-1/2}-conforming" face finite elements defined on the interface between mesh e...
RT_R2D_Trace_FECollection(const int p, const int dim, const int map_type=FiniteElement::INTEGRAL, const int ob_type=BasisType::GaussLegendre)
Arbitrary order Raviart-Thomas 3D elements in 2D on a triangle.
Arbitrary order Raviart-Thomas elements in 3D on a tetrahedron.
Arbitrary order "H^{-1/2}-conforming" face finite elements defined on the interface between mesh elem...
RT_Trace_FECollection(const int p, const int dim, const int map_type=FiniteElement::INTEGRAL, const int ob_type=BasisType::GaussLegendre)
Arbitrary order Raviart-Thomas elements in 2D on a triangle.
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
int DofForGeometry(Geometry::Type GeomType) const override
const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const override
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i].
virtual void SetMapType(int M)
Set the FiniteElement::MapType of the element to either VALUE or INTEGRAL. Also sets the FiniteElemen...
void mfem_error(const char *msg)
OutStream err(std::cerr)
Global stream used by the library for standard error output. Initially it uses the same std::streambu...
std::function< real_t(const Vector &)> f(real_t mass_coeff)
real_t p(const Vector &x, real_t t)