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",6))
315 else if (!strncmp(name,
"RT_R2D",6))
319 else if (!strncmp(name,
"RT_", 3))
323 else if (!strncmp(name,
"RT@", 3))
329 else if (!strncmp(name,
"ND_Trace_", 9))
333 else if (!strncmp(name,
"ND_Trace@", 9))
339 else if (!strncmp(name,
"ND_R1D",6))
343 else if (!strncmp(name,
"ND_R2D",6))
347 else if (!strncmp(name,
"ND_", 3))
351 else if (!strncmp(name,
"ND@", 3))
357 else if (!strncmp(name,
"Local_", 6))
361 else if (!strncmp(name,
"NURBS_HDiv", 10))
363 if (name[10] !=
'\0')
374 else if (!strncmp(name,
"NURBS_HCurl", 11))
376 if (name[11] !=
'\0')
387 else if (!strncmp(name,
"NURBS", 5))
402 MFEM_ABORT(
"unknown FiniteElementCollection: " << name);
404 MFEM_VERIFY(!strcmp(fec->
Name(), name),
"input name: \"" << name
405 <<
"\" does not match the created collection name: \""
406 << fec->
Name() <<
'"');
414 MFEM_ABORT(
"Collection " <<
Name() <<
" does not support variable orders.");
436template <Geometry::Type geom>
441 nv = g_consts::NumVert;
442 ne = g_consts::NumEdges;
445template <Geometry::Type geom,
typename v_t>
447GetEdge(
int &nv, v_t &v,
int &ne,
int &e,
int &eo,
const int edge_info)
452 nv = e_consts::NumVert;
456 MFEM_ASSERT(0 <= e && e < g_consts::NumEdges,
"");
457 MFEM_ASSERT(0 <= eo && eo < e_consts::NumOrient,
"");
458 v[0] = e_consts::Orient[eo][0];
459 v[1] = e_consts::Orient[eo][1];
460 v[0] = g_consts::Edges[e][v[0]];
461 v[1] = g_consts::Edges[e][v[1]];
465 typename v_t,
typename e_t,
typename eo_t>
467GetFace(
int &nv, v_t &v,
int &ne, e_t &e, eo_t &eo,
473 nv = f_consts::NumVert;
478 MFEM_ASSERT(0 <=
f &&
f < g_consts::NumFaces,
"");
479 MFEM_ASSERT(0 <= fo && fo < f_consts::NumOrient,
"");
480 for (
int i = 0; i < f_consts::NumVert; i++)
482 v[i] = f_consts::Orient[fo][i];
483 v[i] = g_consts::FaceVert[
f][v[i]];
485 ne = f_consts::NumEdges;
486 for (
int i = 0; i < f_consts::NumEdges; i++)
488 int v0 = v[f_consts::Edges[i][0]];
489 int v1 = v[f_consts::Edges[i][1]];
491 if (v0 > v1) { swap(v0, v1); eor = 1; }
492 for (
int j = g_consts::VertToVert::I[v0];
true; j++)
494 MFEM_ASSERT(j < g_consts::VertToVert::I[v0+1],
495 "internal error, edge not found");
496 if (v1 == g_consts::VertToVert::J[j][0])
498 int en = g_consts::VertToVert::J[j][1];
518 "invalid Geom = " << Geom);
520 "invalid SDim = " << SDim <<
526 const int off = nvd*(Info/64);
528 for (
int i = 0; i < nvd; i++)
535 int v[4], e[4], eo[4],
f[1], fo[1];
536 int av = 0, nv = 0, ae = 0, ne = 0, nf = 0;
558 nv, v, ne, e, eo, nf,
f[0], fg[0], fo[0], Info);
576 nv, v, ne, e, eo, nf,
f[0], fg[0], fo[0], Info);
594 nv, v, ne, e, eo, nf,
f[0], fg[0], fo[0], Info);
612 nv, v, ne, e, eo, nf,
f[0], fg[0], fo[0], Info);
621 MFEM_ABORT(
"invalid Geom = " << Geom);
628 for (
int i = 0; i < nv; i++)
630 for (
int j = 0; j < nvd; j++)
632 dofs[i*nvd+j] = v[i]*nvd+j;
635 int l_off = nv*nvd, g_off = av*nvd;
640 for (
int i = 0; i < ne; i++)
644 for (
int j = 0; j < ned; j++)
646 dofs[l_off+i*ned+j] =
648 g_off+e[i]*ned+ed[j] :
649 -1-(g_off+e[i]*ned+(-1-ed[j]));
661 for (
int i = 0; i < nf; i++)
664 for (
int j = 0; j < nfd; j++)
666 dofs[l_off+i*nfd+j] =
668 g_off+
f[i]*nfd+fd[j] :
669 -1-(g_off+
f[i]*nfd+(-1-fd[j]));
680 ", SDim = " << SDim <<
" is not supported");
698 mfem_error (
"LinearFECollection: unknown geometry type.");
716 mfem_error (
"LinearFECollection: unknown geometry type.");
742 mfem_error (
"QuadraticFECollection: unknown geometry type.");
759 mfem_error (
"QuadraticFECollection: unknown geometry type.");
767 static int indexes[] = { 0 };
783 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
796 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
804 static int indexes[] = { 0 };
824 mfem_error (
"CubicFECollection: unknown geometry type.");
841 mfem_error (
"CubicFECollection: unknown geometry type.");
851 static int ind_pos[] = { 0, 1 };
852 static int ind_neg[] = { 1, 0 };
862 static int indexes[] = { 0 };
868 static int sq_ind[8][4] = {{0, 1, 2, 3}, {0, 2, 1, 3},
869 {2, 0, 3, 1}, {1, 0, 3, 2},
870 {3, 2, 1, 0}, {3, 1, 2, 0},
871 {1, 3, 0, 2}, {2, 3, 0, 1}
891 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
905 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
913 static int indexes[] = { 0 };
929 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
943 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
951 static int ind_pos[] = { 0 };
952 static int ind_neg[] = { -1 };
972 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
986 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
994 static int ind_pos[] = { 0, 1 };
995 static int ind_neg[] = { -2, -1 };
1014 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
1028 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
1036 static int ind_pos[] = { 0, 1, 2 };
1037 static int ind_neg[] = { -3, -2, -1 };
1056 mfem_error (
"Const2DFECollection: unknown geometry type.");
1070 mfem_error (
"Const2DFECollection: unknown geometry type.");
1092 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
1106 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
1128 mfem_error (
"GaussLinearDiscont2DFECollection:"
1129 " unknown geometry type.");
1144 mfem_error (
"GaussLinearDiscont2DFECollection:"
1145 " unknown geometry type.");
1163 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
1165 return &QuadrilateralFE;
1176 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
1198 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1213 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1234 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1248 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1265 mfem_error (
"GaussQuadraticDiscont2DFECollection:"
1266 " unknown geometry type.");
1268 return &QuadrilateralFE;
1281 mfem_error (
"GaussQuadraticDiscont2DFECollection:"
1282 " unknown geometry type.");
1304 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1318 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1342 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1358 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1366 static int indexes[] = { 0 };
1383 mfem_error (
"Const3DFECollection: unknown geometry type.");
1385 return &TetrahedronFE;
1401 mfem_error (
"Const3DFECollection: unknown geometry type.");
1425 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1427 return &TetrahedronFE;
1443 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1465 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1467 return &TetrahedronFE;
1482 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1507 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1523 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1531 static int indexes[] = { 0 };
1548 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1550 return &HexahedronFE;
1566 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1574 static int ind_pos[] = { 0 };
1575 static int ind_neg[] = { -1 };
1598 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1600 return &HexahedronFE;
1616 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1624 static int ind_pos[] = { 0 };
1625 static int ind_neg[] = { -1 };
1648 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1650 return &HexahedronFE;
1663 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1673 static int sq_ind[8][4] =
1675 {0, 1, 2, 3}, {-1, -3, -2, -4},
1676 {2, 0, 3, 1}, {-2, -1, -4, -3},
1677 {3, 2, 1, 0}, {-4, -2, -3, -1},
1678 {1, 3, 0, 2}, {-3, -4, -1, -2}
1695 MFEM_VERIFY(
p >= 1,
"H1_FECollection requires order >= 1.");
1696 MFEM_VERIFY(
dim >= 0 &&
dim <= 3,
"H1_FECollection requires 0 <= dim <= 3.");
1698 const int pm1 =
p - 1, pm2 = pm1 - 1, pm3 = pm2 - 1, pm4 = pm3 - 1;
1725 snprintf(
h1_name, 32,
"H1@%c_%dD_P%d",
1735 for (
int i = 0; i < 2; i++)
1739 for (
int i = 0; i < 6; i++)
1743 for (
int i = 0; i < 8; i++)
1747 for (
int i = 0; i < 24; i++)
1767 SegDofOrd[0] = (pm1 > 0) ?
new int[2*pm1] :
nullptr;
1769 for (
int i = 0; i < pm1; i++)
1805 TriDofOrd[0] = (TriDof > 0) ?
new int[6*TriDof] :
nullptr;
1806 for (
int i = 1; i < 6; i++)
1811 for (
int j = 0; j < pm2; j++)
1813 for (
int i = 0; i + j < pm2; i++)
1815 int o = TriDof - ((pm1 - j)*(pm2 - j))/2 + i;
1816 int k = pm3 - j - i;
1818 TriDofOrd[1][o] = TriDof - ((pm1-j)*(pm2-j))/2 + k;
1819 TriDofOrd[2][o] = TriDof - ((pm1-i)*(pm2-i))/2 + k;
1820 TriDofOrd[3][o] = TriDof - ((pm1-k)*(pm2-k))/2 + i;
1821 TriDofOrd[4][o] = TriDof - ((pm1-k)*(pm2-k))/2 + j;
1822 TriDofOrd[5][o] = TriDof - ((pm1-i)*(pm2-i))/2 + j;
1826 QuadDofOrd[0] = (QuadDof > 0) ?
new int[8*QuadDof] :
nullptr;
1827 for (
int i = 1; i < 8; i++)
1850 for (
int j = 0; j < pm3; j++)
1852 for (
int i = 0; i < pm3; i++)
1859 QuadDofOrd[4][o] = (pm4 - i) + (pm4 - j)*pm3;
1860 QuadDofOrd[5][o] = (pm4 - j) + (pm4 - i)*pm3;
1870 for (
int j = 0; j < pm1; j++)
1872 for (
int i = 0; i < pm1; i++)
1879 QuadDofOrd[4][o] = (pm2 - i) + (pm2 - j)*pm1;
1880 QuadDofOrd[5][o] = (pm2 - j) + (pm2 - i)*pm1;
1896 else if (pyrtype == 1)
1928 TetDofOrd[0] = (TetDof > 0) ?
new int[24*TetDof] :
nullptr;
1929 for (
int i = 1; i < 24; i++)
1934 for (
int k = 0; k < pm3; k++)
1936 for (
int j = 0; j + k < pm3; j++)
1938 for (
int i = 0; i + j + k < pm3; i++)
1940 int l = pm4 - k - j - i;
1941 int o = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1942 + (j * (2 *
p - 5 - j - 2 * k)) / 2 + i;
1943 int o1 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1944 + (k * (2 *
p - 5 - k - 2 * j)) / 2 + i;
1945 int o2 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1946 + (k * (2 *
p - 5 - k - 2 * i)) / 2 + j;
1947 int o3 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1948 + (i * (2 *
p - 5 - i - 2 * k)) / 2 + j;
1949 int o4 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1950 + (i * (2 *
p - 5 - i - 2 * j)) / 2 + k;
1951 int o5 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1952 + (j * (2 *
p - 5 - j - 2 * i)) / 2 + k;
1953 int o6 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1954 + (l * (2 *
p - 5 - l - 2 * k)) / 2 + j;
1955 int o7 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1956 + (k * (2 *
p - 5 - k - 2 * l)) / 2 + j;
1957 int o8 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1958 + (j * (2 *
p - 5 - j - 2 * l)) / 2 + k;
1959 int o9 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1960 + (l * (2 *
p - 5 - l - 2 * j)) / 2 + k;
1961 int o10 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1962 + (k * (2 *
p - 5 - k - 2 * j)) / 2 + l;
1963 int o11 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1964 + (j * (2 *
p - 5 - j - 2 * k)) / 2 + l;
1965 int o12 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1966 + (l * (2 *
p - 5 - l - 2 * i)) / 2 + k;
1967 int o13 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1968 + (i * (2 *
p - 5 - i - 2 * l)) / 2 + k;
1969 int o14 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1970 + (i * (2 *
p - 5 - i - 2 * k)) / 2 + l;
1971 int o15 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1972 + (k * (2 *
p - 5 - k - 2 * i)) / 2 + l;
1973 int o16 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1974 + (k * (2 *
p - 5 - k - 2 * l)) / 2 + i;
1975 int o17 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1976 + (l * (2 *
p - 5 - l - 2 * k)) / 2 + i;
1977 int o18 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1978 + (j * (2 *
p - 5 - j - 2 * i)) / 2 + l;
1979 int o19 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1980 + (i * (2 *
p - 5 - i - 2 * j)) / 2 + l;
1981 int o20 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1982 + (l * (2 *
p - 5 - l - 2 * j)) / 2 + i;
1983 int o21 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1984 + (j * (2 *
p - 5 - j - 2 * l)) / 2 + i;
1985 int o22 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1986 + (i * (2 *
p - 5 - i - 2 * l)) / 2 + j;
1987 int o23 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1988 + (l * (2 *
p - 5 - l - 2 * i)) / 2 + j;
2052 if (!strncmp(
h1_name,
"H1_", 3))
2056 else if (!strncmp(
h1_name,
"H1Pos_", 6))
2060 else if (!strncmp(
h1_name,
"H1@", 3))
2069 const int *dof_map = NULL;
2079 MFEM_ABORT(
"Geometry type " <<
Geometry::Name[GeomType] <<
" is not "
2111 snprintf(
h1_name, 32,
"H1_Trace_%dD_P%d",
dim,
p);
2115 snprintf(
h1_name, 32,
"H1Pos_Trace_%dD_P%d",
dim,
p);
2119 snprintf(
h1_name, 32,
"H1_Trace@%c_%dD_P%d",
2126 const int map_type,
const int pyr_type)
2131 MFEM_VERIFY(
p >= 0,
"L2_FECollection requires order >= 0.");
2134 const char *prefix = NULL;
2140 MFEM_ABORT(
"invalid map_type: " << map_type);
2145 snprintf(d_name, 32,
"%s_%dD_P%d", prefix,
dim,
p);
2148 snprintf(d_name, 32,
"%s_T%d_%dD_P%d", prefix, btype,
dim,
p);
2153 L2_Elements[g] = NULL;
2154 Tr_Elements[g] = NULL;
2156 for (
int i = 0; i < 2; i++)
2158 SegDofOrd[i] = NULL;
2160 for (
int i = 0; i < 6; i++)
2162 TriDofOrd[i] = NULL;
2164 for (
int i = 0; i < 24; i++)
2166 TetDofOrd[i] = NULL;
2189 const int pp1 =
p + 1;
2190 SegDofOrd[0] = (pp1 > 0) ?
new int[2*pp1] :
nullptr;
2191 SegDofOrd[1] = SegDofOrd[0] + pp1;
2192 for (
int i = 0; i <=
p; i++)
2194 SegDofOrd[0][i] = i;
2195 SegDofOrd[1][i] =
p - i;
2223 TriDofOrd[0] = (TriDof > 0) ?
new int[6*TriDof] :
nullptr;
2224 for (
int i = 1; i < 6; i++)
2226 TriDofOrd[i] = TriDofOrd[i-1] + TriDof;
2228 const int pp1 =
p + 1, pp2 = pp1 + 1;
2229 for (
int j = 0; j <=
p; j++)
2231 for (
int i = 0; i + j <=
p; i++)
2233 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
2235 TriDofOrd[0][o] = o;
2236 TriDofOrd[1][o] = TriDof - ((pp2-j)*(pp1-j))/2 + k;
2237 TriDofOrd[2][o] = TriDof - ((pp2-i)*(pp1-i))/2 + k;
2238 TriDofOrd[3][o] = TriDof - ((pp2-k)*(pp1-k))/2 + i;
2239 TriDofOrd[4][o] = TriDof - ((pp2-k)*(pp1-k))/2 + j;
2240 TriDofOrd[5][o] = TriDof - ((pp2-i)*(pp1-i))/2 + j;
2244 OtherDofOrd = (QuadDof > 0) ?
new int[QuadDof] :
nullptr;
2245 for (
int j = 0; j < QuadDof; j++)
2299 const int MaxDof = std::max(std::max(TetDof, PyrDof),
2300 std::max(PriDof, HexDof));
2302 TetDofOrd[0] = (TetDof > 0) ?
new int[24*TetDof] :
nullptr;
2303 for (
int i = 1; i < 24; i++)
2305 TetDofOrd[i] = TetDofOrd[i-1] + TetDof;
2308 const int pp1 =
p + 1, pp2 = pp1 + 1, pp3 = pp2 + 1;
2309 for (
int k = 0; k <=
p; k++)
2311 for (
int j = 0; j + k <=
p; j++)
2313 for (
int i = 0; i + j + k <=
p; i++)
2315 int l =
p - k - j - i;
2316 int o = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2317 + (j * (2 *
p + 3 - j - 2 * k)) / 2 + i;
2318 int o1 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2319 + (k * (2 *
p + 3 - k - 2 * j)) / 2 + i;
2320 int o2 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2321 + (k * (2 *
p + 3 - k - 2 * i)) / 2 + j;
2322 int o3 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2323 + (i * (2 *
p + 3 - i - 2 * k)) / 2 + j;
2324 int o4 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2325 + (i * (2 *
p + 3 - i - 2 * j)) / 2 + k;
2326 int o5 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2327 + (j * (2 *
p + 3 - j - 2 * i)) / 2 + k;
2328 int o6 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2329 + (l * (2 *
p + 3 - l - 2 * k)) / 2 + j;
2330 int o7 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2331 + (k * (2 *
p + 3 - k - 2 * l)) / 2 + j;
2332 int o8 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2333 + (j * (2 *
p + 3 - j - 2 * l)) / 2 + k;
2334 int o9 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2335 + (l * (2 *
p + 3 - l - 2 * j)) / 2 + k;
2336 int o10 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2337 + (k * (2 *
p + 3 - k - 2 * j)) / 2 + l;
2338 int o11 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2339 + (j * (2 *
p + 3 - j - 2 * k)) / 2 + l;
2340 int o12 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2341 + (l * (2 *
p + 3 - l - 2 * i)) / 2 + k;
2342 int o13 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2343 + (i * (2 *
p + 3 - i - 2 * l)) / 2 + k;
2344 int o14 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2345 + (i * (2 *
p + 3 - i - 2 * k)) / 2 + l;
2346 int o15 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2347 + (k * (2 *
p + 3 - k - 2 * i)) / 2 + l;
2348 int o16 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2349 + (k * (2 *
p + 3 - k - 2 * l)) / 2 + i;
2350 int o17 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2351 + (l * (2 *
p + 3 - l - 2 * k)) / 2 + i;
2352 int o18 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2353 + (j * (2 *
p + 3 - j - 2 * i)) / 2 + l;
2354 int o19 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2355 + (i * (2 *
p + 3 - i - 2 * j)) / 2 + l;
2356 int o20 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2357 + (l * (2 *
p + 3 - l - 2 * j)) / 2 + i;
2358 int o21 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2359 + (j * (2 *
p + 3 - j - 2 * l)) / 2 + i;
2360 int o22 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2361 + (i * (2 *
p + 3 - i - 2 * l)) / 2 + j;
2362 int o23 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2363 + (l * (2 *
p + 3 - l - 2 * i)) / 2 + j;
2364 TetDofOrd[ 0][o] = o;
2365 TetDofOrd[ 1][o] = o1;
2366 TetDofOrd[ 2][o] = o2;
2367 TetDofOrd[ 3][o] = o3;
2368 TetDofOrd[ 4][o] = o4;
2369 TetDofOrd[ 5][o] = o5;
2370 TetDofOrd[ 6][o] = o6;
2371 TetDofOrd[ 7][o] = o7;
2372 TetDofOrd[ 8][o] = o8;
2373 TetDofOrd[ 9][o] = o9;
2374 TetDofOrd[10][o] = o10;
2375 TetDofOrd[11][o] = o11;
2376 TetDofOrd[12][o] = o12;
2377 TetDofOrd[13][o] = o13;
2378 TetDofOrd[14][o] = o14;
2379 TetDofOrd[15][o] = o15;
2380 TetDofOrd[16][o] = o16;
2381 TetDofOrd[17][o] = o17;
2382 TetDofOrd[18][o] = o18;
2383 TetDofOrd[19][o] = o19;
2384 TetDofOrd[20][o] = o20;
2385 TetDofOrd[21][o] = o21;
2386 TetDofOrd[22][o] = o22;
2387 TetDofOrd[23][o] = o23;
2391 OtherDofOrd = (MaxDof > 0) ?
new int[MaxDof] :
nullptr;
2392 for (
int j = 0; j < MaxDof; j++)
2399 mfem::err <<
"L2_FECollection::L2_FECollection : dim = "
2408 return L2_Elements[GeomType];
2417 return (Or > 0) ? SegDofOrd[0] : SegDofOrd[1];
2420 return TriDofOrd[Or%6];
2423 return TetDofOrd[Or%24];
2426 return (Or == 0) ? OtherDofOrd : NULL;
2432 delete [] OtherDofOrd;
2433 delete [] SegDofOrd[0];
2434 delete [] TriDofOrd[0];
2435 delete [] TetDofOrd[0];
2438 delete L2_Elements[i];
2439 delete Tr_Elements[i];
2445 const int cb_type,
const int ob_type)
2452 MFEM_VERIFY(
p >= 0,
"RT_FECollection requires order >= 0.");
2460 MFEM_ABORT(
"unknown closed BasisType: " << cb_name);
2466 MFEM_ABORT(
"unknown open BasisType: " << ob_name);
2482 const int pp1 =
p + 1;
2511 MFEM_ABORT(
"invalid dim = " <<
dim);
2518 const int map_type,
const bool signs,
2527 MFEM_ABORT(
"Invalid open basis type: " << ob_name);
2539 "invalid open point type");
2541 const int pp1 =
p + 1, pp2 =
p + 2;
2549 for (
int i = 0; i < 2; i++)
2553 for (
int i = 0; i < 6; i++)
2557 for (
int i = 0; i < 8; i++)
2569 SegDofOrd[0] = (pp1 > 0) ?
new int[2*pp1] :
nullptr;
2571 for (
int i = 0; i <=
p; i++)
2574 SegDofOrd[1][i] = signs ? (-1 - (
p - i)) : (
p - i);
2590 TriDofOrd[0] = (TriDof > 0) ?
new int[6*TriDof] :
nullptr;
2591 for (
int i = 1; i < 6; i++)
2597 for (
int j = 0; j <=
p; j++)
2599 for (
int i = 0; i + j <=
p; i++)
2601 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
2604 TriDofOrd[1][o] = -1-(TriDof-((pp2-j)*(pp1-j))/2+k);
2605 TriDofOrd[2][o] = TriDof-((pp2-i)*(pp1-i))/2+k;
2606 TriDofOrd[3][o] = -1-(TriDof-((pp2-k)*(pp1-k))/2+i);
2607 TriDofOrd[4][o] = TriDof-((pp2-k)*(pp1-k))/2+j;
2608 TriDofOrd[5][o] = -1-(TriDof-((pp2-i)*(pp1-i))/2+j);
2611 for (
int kk = 1; kk < 6; kk += 2)
2620 QuadDofOrd[0] = (QuadDof > 0) ?
new int[8*QuadDof] :
nullptr;
2621 for (
int i = 1; i < 8; i++)
2626 for (
int j = 0; j <=
p; j++)
2628 for (
int i = 0; i <=
p; i++)
2641 for (
int k = 1; k < 8; k += 2)
2678 if (!strncmp(
rt_name,
"RT_", 3))
2709 const char *prefix =
2711 char ob_str[3] = {
'\0',
'\0',
'\0' };
2718 snprintf(
rt_name, 32,
"%s%s_%dD_P%d", prefix, ob_str,
dim,
p);
2720 MFEM_VERIFY(
dim == 2 ||
dim == 3,
"Wrong dimension, dim = " <<
dim);
2729 MFEM_VERIFY(
dim == 2 ||
dim == 3,
"Wrong dimension, dim = " <<
dim);
2731 const char *prefix =
2735 snprintf(
rt_name, 32,
"%s_%dD_P%d", prefix,
dim,
p);
2739 snprintf(
rt_name, 32,
"%s@%c_%dD_P%d", prefix,
2745 const int cb_type,
const int ob_type)
2751 MFEM_VERIFY(
p >= 1,
"ND_FECollection requires order >= 1.");
2752 MFEM_VERIFY(
dim >= 1 &&
dim <= 3,
"ND_FECollection requires 1 <= dim <= 3.");
2754 const int pm1 =
p - 1, pm2 =
p - 2;
2772 for (
int i = 0; i < 2; i++)
2776 for (
int i = 0; i < 6; i++)
2780 for (
int i = 0; i < 8; i++)
2793 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
2798 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
2808 for (
int i = 0; i <
p; i++)
2826 QuadDofOrd[0] = (QuadDof > 0) ?
new int[8*QuadDof] :
nullptr;
2827 for (
int i = 1; i < 8; i++)
2832 for (
int j = 0; j < pm1; j++)
2834 for (
int i = 0; i <
p; i++)
2837 int d2 =
p*pm1 + j + i*pm1;
2847 QuadDofOrd[2][d1] = -1 - (
p*pm1 + j + (pm1 - i)*pm1);
2853 QuadDofOrd[4][d1] = -1 - ((pm1 - i) + (pm2 - j)*
p);
2854 QuadDofOrd[4][d2] = -1 - (
p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2856 QuadDofOrd[5][d1] = -1 - (
p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2857 QuadDofOrd[5][d2] = -1 - ((pm1 - i) + (pm2 - j)*
p);
2865 QuadDofOrd[7][d2] = -1 - (
p*pm1 + j + (pm1 - i)*pm1);
2870 TriDofOrd[0] = (TriDof > 0) ?
new int[6*TriDof] :
nullptr;
2871 for (
int i = 1; i < 6; i++)
2877 for (
int j = 0; j <= pm2; j++)
2879 for (
int i = 0; i + j <= pm2; i++)
2881 int k0 =
p*pm1 - (
p - j)*(pm1 - j) + 2*i;
2882 int k1 = 2*pm2 - 2*i + ((2*
p-3)-j)*j;
2883 int k2 = 2*pm2 - 2*j + ((2*
p-3)-i)*i;
2884 int k3 =
p*pm1 - 2 - 3*j - i - (i+j)*(i+j);
2885 int k4 =
p*pm1 - 2 - 3*i - j - (i+j)*(i+j);
2886 int k5 =
p*pm1 - (
p - i)*(pm1 - i) + 2*j;
2966 int tr_p, tr_dim, tr_cb_type, tr_ob_type;
3004 snprintf(
nd_name, 32,
"ND_Trace_%dD_P%d",
dim,
p);
3008 snprintf(
nd_name, 32,
"ND_Trace@%c%c_%dD_P%d",
3016 const int cb_type,
const int ob_type)
3019 MFEM_VERIFY(
p >= 1,
"ND_R1D_FECollection requires order >= 1.");
3020 MFEM_VERIFY(
dim == 1,
"ND_R1D_FECollection requires dim == 1.");
3029 snprintf(
nd_name, 32,
"ND_R1D@%c%c_%dD_P%d",
3047 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
3052 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
3085 const int cb_type,
const int ob_type)
3088 MFEM_VERIFY(
p >= 0,
"RT_R1D_FECollection requires order >= 0.");
3089 MFEM_VERIFY(
dim == 1,
"RT_R1D_FECollection requires dim == 1.");
3098 snprintf(
rt_name, 32,
"RT_R1D@%c%c_%dD_P%d",
3116 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
3121 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
3141 MFEM_ABORT(
"this method is not implemented in RT_R1D_FECollection!");
3155 const int cb_type,
const int ob_type)
3158 MFEM_VERIFY(
p >= 1,
"ND_R2D_FECollection requires order >= 1.");
3159 MFEM_VERIFY(
dim >= 1 &&
dim <= 2,
3160 "ND_R2D_FECollection requires 1 <= dim <= 2.");
3162 const int pm1 =
p - 1, pm2 =
p - 2;
3171 snprintf(
nd_name, 32,
"ND_R2D@%c%c_%dD_P%d",
3181 for (
int i = 0; i < 2; i++)
3193 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
3198 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
3210 SegDofOrd[0] = (4*
p > 2) ?
new int[4 *
p - 2] :
nullptr;
3212 for (
int i = 0; i <
p; i++)
3217 for (
int i = 0; i < pm1; i++)
3249 int p,
dim, cb_type, ob_type;
3285 snprintf(
nd_name, 32,
"ND_R2D_Trace_%dD_P%d",
dim,
p);
3289 snprintf(
nd_name, 32,
"ND_R2D_Trace@%c%c_%dD_P%d",
3297 const int cb_type,
const int ob_type)
3301 MFEM_VERIFY(
p >= 0,
"RT_R2D_FECollection requires order >= 0.");
3302 MFEM_VERIFY(
dim >= 1 &&
dim <= 2,
3303 "RT_R2D_FECollection requires 1 <= dim <= 2.");
3311 MFEM_ABORT(
"unknown closed BasisType: " << cb_name);
3316 MFEM_ABORT(
"unknown open BasisType: " << ob_name);
3328 snprintf(
rt_name, 32,
"RT_R2D@%c%c_%dD_P%d",
3333 const int pp1 =
p + 1;
3334 const int pp2 =
p + 2;
3353 const bool signs,
const int ob_type)
3360 MFEM_ABORT(
"Invalid open basis type: " << ob_name);
3372 "invalid open point type");
3374 const int pp1 =
p + 1;
3382 for (
int i = 0; i < 2; i++)
3394 SegDofOrd[0] = (pp1 > 0) ?
new int[2*pp1] :
nullptr;
3396 for (
int i = 0; i <=
p; i++)
3399 SegDofOrd[1][i] = signs ? (-1 - (
p - i)) : (
p - i);
3417 if (!strncmp(
rt_name,
"RT_R2D_", 7))
3445 const char *prefix =
3447 char ob_str[3] = {
'\0',
'\0',
'\0' };
3454 snprintf(
rt_name, 32,
"%s%s_%dD_P%d", prefix, ob_str,
dim,
p);
3456 MFEM_VERIFY(
dim == 2,
"Wrong dimension, dim = " <<
dim);
3462 snprintf(d_name, 32,
"Local_%s", fe_name);
3464 Local_Element = NULL;
3466 if (!strcmp(fe_name,
"BiCubic2DFiniteElement") ||
3467 !strcmp(fe_name,
"Quad_Q3"))
3472 else if (!strcmp(fe_name,
"Nedelec1HexFiniteElement") ||
3473 !strcmp(fe_name,
"Hex_ND1"))
3478 else if (!strncmp(fe_name,
"H1_", 3))
3483 else if (!strncmp(fe_name,
"H1Pos_", 6))
3488 else if (!strncmp(fe_name,
"L2_", 3))
3495 mfem::err <<
"Local_FECollection::Local_FECollection : fe_name = "
3519 snprintf(
name, 16,
"NURBS%i", Order);
3523 snprintf(
name, 16,
"NURBS");
3546 mfem_error (
"NURBSFECollection: unknown geometry type.");
3553 mfem_error(
"NURBSFECollection::DofForGeometry");
3560 mfem_error(
"NURBSFECollection::DofOrderForOrientation");
3566 MFEM_ABORT(
"NURBS finite elements can not be statically condensed!");
3591 qFE = QuadrilateralVFE;
3597 qFE = QuadrilateralFE;
3598 hFE = ParallelepipedVFE;
3603 mfem_error (
"NURBS_HDivFECollection: wrong dimension!");
3610 delete QuadrilateralFE;
3611 delete QuadrilateralVFE;
3612 delete ParallelepipedVFE;
3625 mfem_error (
"NURBS_HDivFECollection: unknown geometry type.");
3627 return QuadrilateralFE;
3635 snprintf(
name, 16,
"NURBS_HDiv%i", Order);
3639 snprintf(
name, 16,
"NURBS_HDiv");
3645 mfem_error(
"NURBS_HDivFECollection::DofForGeometry");
3653 mfem_error(
"NURBS_HDivFECollection::DofOrderForOrientation");
3659 MFEM_ABORT(
"NURBS finite elements can not be statically condensed!");
3682 qFE = QuadrilateralVFE;
3688 qFE = QuadrilateralFE;
3689 hFE = ParallelepipedVFE;
3694 mfem_error (
"NURBS_HCurlFECollection: wrong dimension!");
3703 delete QuadrilateralFE;
3704 delete QuadrilateralVFE;
3705 delete ParallelepipedVFE;
3718 mfem_error (
"NURBS_HCurlFECollection: unknown geometry type.");
3720 return QuadrilateralFE;
3728 snprintf(
name, 16,
"NURBS_HCurl%i", Order);
3732 snprintf(
name, 16,
"NURBS_HCurl");
3738 mfem_error(
"NURBS_HCurlFECollection::DofForGeometry");
3746 mfem_error(
"NURBS_HCurlFECollection::DofOrderForOrientation");
3752 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.
@ IntegratedGLL
Integrated GLL indicator functions.
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)