17#define snprintf _snprintf_s
34 if (fe !=
nullptr) {
break; }
115 MFEM_ABORT(
"unknown geometry type");
122 MFEM_ABORT(
"this method is not implemented in this derived class!");
130 if (!strcmp(name,
"Linear"))
134 else if (!strcmp(name,
"Quadratic"))
138 else if (!strcmp(name,
"QuadraticPos"))
142 else if (!strcmp(name,
"Cubic"))
146 else if (!strcmp(name,
"Const3D"))
150 else if (!strcmp(name,
"Const2D"))
154 else if (!strcmp(name,
"LinearDiscont2D"))
158 else if (!strcmp(name,
"GaussLinearDiscont2D"))
162 else if (!strcmp(name,
"P1OnQuad"))
166 else if (!strcmp(name,
"QuadraticDiscont2D"))
170 else if (!strcmp(name,
"QuadraticPosDiscont2D"))
174 else if (!strcmp(name,
"GaussQuadraticDiscont2D"))
178 else if (!strcmp(name,
"CubicDiscont2D"))
182 else if (!strcmp(name,
"LinearDiscont3D"))
186 else if (!strcmp(name,
"QuadraticDiscont3D"))
190 else if (!strcmp(name,
"LinearNonConf3D"))
194 else if (!strcmp(name,
"CrouzeixRaviart"))
198 else if (!strcmp(name,
"ND1_3D"))
202 else if (!strcmp(name,
"RT0_2D"))
206 else if (!strcmp(name,
"RT1_2D"))
210 else if (!strcmp(name,
"RT2_2D"))
214 else if (!strcmp(name,
"RT0_3D"))
218 else if (!strcmp(name,
"RT1_3D"))
222 else if (!strncmp(name,
"H1_Trace_", 9))
226 else if (!strncmp(name,
"H1_Trace@", 9))
231 else if (!strncmp(name,
"H1_", 3))
235 else if (!strncmp(name,
"H1Pos_Trace_", 12))
240 else if (!strncmp(name,
"H1Pos_", 6))
244 else if (!strncmp(name,
"H1Ser_", 6))
248 else if (!strncmp(name,
"H1@", 3))
253 else if (!strncmp(name,
"L2_T", 4))
256 else if (!strncmp(name,
"L2_", 3))
260 else if (!strncmp(name,
"L2Int_T", 7))
265 else if (!strncmp(name,
"L2Int_", 6))
271 else if (!strncmp(name,
"RT_Trace_", 9))
275 else if (!strncmp(name,
"RT_ValTrace_", 12))
280 else if (!strncmp(name,
"RT_Trace@", 9))
286 else if (!strncmp(name,
"RT_ValTrace@", 12))
292 else if (!strncmp(name,
"DG_Iface_", 9))
296 else if (!strncmp(name,
"DG_Iface@", 9))
302 else if (!strncmp(name,
"DG_IntIface_", 12))
307 else if (!strncmp(name,
"DG_IntIface@", 12))
313 else if (!strncmp(name,
"RT_", 3))
317 else if (!strncmp(name,
"RT@", 3))
323 else if (!strncmp(name,
"ND_Trace_", 9))
327 else if (!strncmp(name,
"ND_Trace@", 9))
333 else if (!strncmp(name,
"ND_", 3))
337 else if (!strncmp(name,
"ND@", 3))
343 else if (!strncmp(name,
"Local_", 6))
347 else if (!strncmp(name,
"NURBS", 5))
362 MFEM_ABORT(
"unknown FiniteElementCollection: " << name);
364 MFEM_VERIFY(!strcmp(fec->
Name(), name),
"input name: \"" << name
365 <<
"\" does not match the created collection name: \""
366 << fec->
Name() <<
'"');
374 MFEM_ABORT(
"Collection " <<
Name() <<
" does not support variable orders.");
396template <Geometry::Type geom>
401 nv = g_consts::NumVert;
402 ne = g_consts::NumEdges;
405template <Geometry::Type geom,
typename v_t>
407GetEdge(
int &nv, v_t &v,
int &ne,
int &e,
int &eo,
const int edge_info)
412 nv = e_consts::NumVert;
416 MFEM_ASSERT(0 <= e && e < g_consts::NumEdges,
"");
417 MFEM_ASSERT(0 <= eo && eo < e_consts::NumOrient,
"");
418 v[0] = e_consts::Orient[eo][0];
419 v[1] = e_consts::Orient[eo][1];
420 v[0] = g_consts::Edges[e][v[0]];
421 v[1] = g_consts::Edges[e][v[1]];
425 typename v_t,
typename e_t,
typename eo_t>
427GetFace(
int &nv, v_t &v,
int &ne, e_t &e, eo_t &eo,
433 nv = f_consts::NumVert;
438 MFEM_ASSERT(0 <=
f &&
f < g_consts::NumFaces,
"");
439 MFEM_ASSERT(0 <= fo && fo < f_consts::NumOrient,
"");
440 for (
int i = 0; i < f_consts::NumVert; i++)
442 v[i] = f_consts::Orient[fo][i];
443 v[i] = g_consts::FaceVert[
f][v[i]];
445 ne = f_consts::NumEdges;
446 for (
int i = 0; i < f_consts::NumEdges; i++)
448 int v0 = v[f_consts::Edges[i][0]];
449 int v1 = v[f_consts::Edges[i][1]];
451 if (v0 > v1) { swap(v0, v1); eor = 1; }
452 for (
int j = g_consts::VertToVert::I[v0];
true; j++)
454 MFEM_ASSERT(j < g_consts::VertToVert::I[v0+1],
455 "internal error, edge not found");
456 if (v1 == g_consts::VertToVert::J[j][0])
458 int en = g_consts::VertToVert::J[j][1];
478 "invalid Geom = " << Geom);
480 "invalid SDim = " << SDim <<
486 const int off = nvd*(Info/64);
488 for (
int i = 0; i < nvd; i++)
495 int v[4], e[4], eo[4],
f[1], fo[1];
496 int av = 0, nv = 0, ae = 0, ne = 0, nf = 0;
518 nv, v, ne, e, eo, nf,
f[0], fg[0], fo[0], Info);
536 nv, v, ne, e, eo, nf,
f[0], fg[0], fo[0], Info);
554 nv, v, ne, e, eo, nf,
f[0], fg[0], fo[0], Info);
572 nv, v, ne, e, eo, nf,
f[0], fg[0], fo[0], Info);
581 MFEM_ABORT(
"invalid Geom = " << Geom);
588 for (
int i = 0; i < nv; i++)
590 for (
int j = 0; j < nvd; j++)
592 dofs[i*nvd+j] = v[i]*nvd+j;
595 int l_off = nv*nvd, g_off = av*nvd;
600 for (
int i = 0; i < ne; i++)
604 for (
int j = 0; j < ned; j++)
606 dofs[l_off+i*ned+j] =
608 g_off+e[i]*ned+ed[j] :
609 -1-(g_off+e[i]*ned+(-1-ed[j]));
621 for (
int i = 0; i < nf; i++)
624 for (
int j = 0; j < nfd; j++)
626 dofs[l_off+i*nfd+j] =
628 g_off+
f[i]*nfd+fd[j] :
629 -1-(g_off+
f[i]*nfd+(-1-fd[j]));
640 ", SDim = " << SDim <<
" is not supported");
658 mfem_error (
"LinearFECollection: unknown geometry type.");
676 mfem_error (
"LinearFECollection: unknown geometry type.");
702 mfem_error (
"QuadraticFECollection: unknown geometry type.");
719 mfem_error (
"QuadraticFECollection: unknown geometry type.");
727 static int indexes[] = { 0 };
743 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
756 mfem_error (
"QuadraticPosFECollection: unknown geometry type.");
764 static int indexes[] = { 0 };
784 mfem_error (
"CubicFECollection: unknown geometry type.");
801 mfem_error (
"CubicFECollection: unknown geometry type.");
811 static int ind_pos[] = { 0, 1 };
812 static int ind_neg[] = { 1, 0 };
822 static int indexes[] = { 0 };
828 static int sq_ind[8][4] = {{0, 1, 2, 3}, {0, 2, 1, 3},
829 {2, 0, 3, 1}, {1, 0, 3, 2},
830 {3, 2, 1, 0}, {3, 1, 2, 0},
831 {1, 3, 0, 2}, {2, 3, 0, 1}
851 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
865 mfem_error (
"CrouzeixRaviartFECollection: unknown geometry type.");
873 static int indexes[] = { 0 };
889 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
903 mfem_error (
"RT0_2DFECollection: unknown geometry type.");
911 static int ind_pos[] = { 0 };
912 static int ind_neg[] = { -1 };
932 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
946 mfem_error (
"RT1_2DFECollection: unknown geometry type.");
954 static int ind_pos[] = { 0, 1 };
955 static int ind_neg[] = { -2, -1 };
974 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
988 mfem_error (
"RT2_2DFECollection: unknown geometry type.");
996 static int ind_pos[] = { 0, 1, 2 };
997 static int ind_neg[] = { -3, -2, -1 };
1016 mfem_error (
"Const2DFECollection: unknown geometry type.");
1030 mfem_error (
"Const2DFECollection: unknown geometry type.");
1052 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
1066 mfem_error (
"LinearDiscont2DFECollection: unknown geometry type.");
1088 mfem_error (
"GaussLinearDiscont2DFECollection:"
1089 " unknown geometry type.");
1104 mfem_error (
"GaussLinearDiscont2DFECollection:"
1105 " unknown geometry type.");
1123 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
1125 return &QuadrilateralFE;
1136 mfem_error (
"P1OnQuadFECollection: unknown geometry type.");
1158 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1173 mfem_error (
"QuadraticDiscont2DFECollection: unknown geometry type.");
1194 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1208 mfem_error (
"QuadraticPosDiscont2DFECollection: unknown geometry type.");
1225 mfem_error (
"GaussQuadraticDiscont2DFECollection:"
1226 " unknown geometry type.");
1228 return &QuadrilateralFE;
1241 mfem_error (
"GaussQuadraticDiscont2DFECollection:"
1242 " unknown geometry type.");
1264 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1278 mfem_error (
"CubicDiscont2DFECollection: unknown geometry type.");
1302 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1318 mfem_error (
"LinearNonConf3DFECollection: unknown geometry type.");
1326 static int indexes[] = { 0 };
1343 mfem_error (
"Const3DFECollection: unknown geometry type.");
1345 return &TetrahedronFE;
1361 mfem_error (
"Const3DFECollection: unknown geometry type.");
1385 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1387 return &TetrahedronFE;
1403 mfem_error (
"LinearDiscont3DFECollection: unknown geometry type.");
1425 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1427 return &TetrahedronFE;
1442 mfem_error (
"QuadraticDiscont3DFECollection: unknown geometry type.");
1467 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1483 mfem_error (
"RefinedLinearFECollection: unknown geometry type.");
1491 static int indexes[] = { 0 };
1508 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1510 return &HexahedronFE;
1526 mfem_error (
"ND1_3DFECollection: unknown geometry type.");
1534 static int ind_pos[] = { 0 };
1535 static int ind_neg[] = { -1 };
1558 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1560 return &HexahedronFE;
1576 mfem_error (
"RT0_3DFECollection: unknown geometry type.");
1584 static int ind_pos[] = { 0 };
1585 static int ind_neg[] = { -1 };
1608 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1610 return &HexahedronFE;
1623 mfem_error (
"RT1_3DFECollection: unknown geometry type.");
1633 static int sq_ind[8][4] =
1635 {0, 1, 2, 3}, {-1, -3, -2, -4},
1636 {2, 0, 3, 1}, {-2, -1, -4, -3},
1637 {3, 2, 1, 0}, {-4, -2, -3, -1},
1638 {1, 3, 0, 2}, {-3, -4, -1, -2}
1654 MFEM_VERIFY(
p >= 1,
"H1_FECollection requires order >= 1.");
1655 MFEM_VERIFY(
dim >= 0 &&
dim <= 3,
"H1_FECollection requires 0 <= dim <= 3.");
1657 const int pm1 =
p - 1, pm2 = pm1 - 1, pm3 = pm2 - 1, pm4 = pm3 - 1;
1684 snprintf(
h1_name, 32,
"H1@%c_%dD_P%d",
1694 for (
int i = 0; i < 2; i++)
1698 for (
int i = 0; i < 6; i++)
1702 for (
int i = 0; i < 8; i++)
1706 for (
int i = 0; i < 24; i++)
1726 SegDofOrd[0] = (pm1 > 0) ?
new int[2*pm1] :
nullptr;
1728 for (
int i = 0; i < pm1; i++)
1764 TriDofOrd[0] = (TriDof > 0) ?
new int[6*TriDof] :
nullptr;
1765 for (
int i = 1; i < 6; i++)
1770 for (
int j = 0; j < pm2; j++)
1772 for (
int i = 0; i + j < pm2; i++)
1774 int o = TriDof - ((pm1 - j)*(pm2 - j))/2 + i;
1775 int k = pm3 - j - i;
1777 TriDofOrd[1][o] = TriDof - ((pm1-j)*(pm2-j))/2 + k;
1778 TriDofOrd[2][o] = TriDof - ((pm1-i)*(pm2-i))/2 + k;
1779 TriDofOrd[3][o] = TriDof - ((pm1-k)*(pm2-k))/2 + i;
1780 TriDofOrd[4][o] = TriDof - ((pm1-k)*(pm2-k))/2 + j;
1781 TriDofOrd[5][o] = TriDof - ((pm1-i)*(pm2-i))/2 + j;
1785 QuadDofOrd[0] = (QuadDof > 0) ?
new int[8*QuadDof] :
nullptr;
1786 for (
int i = 1; i < 8; i++)
1809 for (
int j = 0; j < pm3; j++)
1811 for (
int i = 0; i < pm3; i++)
1818 QuadDofOrd[4][o] = (pm4 - i) + (pm4 - j)*pm3;
1819 QuadDofOrd[5][o] = (pm4 - j) + (pm4 - i)*pm3;
1829 for (
int j = 0; j < pm1; j++)
1831 for (
int i = 0; i < pm1; i++)
1838 QuadDofOrd[4][o] = (pm2 - i) + (pm2 - j)*pm1;
1839 QuadDofOrd[5][o] = (pm2 - j) + (pm2 - i)*pm1;
1868 TetDofOrd[0] = (TetDof > 0) ?
new int[24*TetDof] :
nullptr;
1869 for (
int i = 1; i < 24; i++)
1874 for (
int k = 0; k < pm3; k++)
1876 for (
int j = 0; j + k < pm3; j++)
1878 for (
int i = 0; i + j + k < pm3; i++)
1880 int l = pm4 - k - j - i;
1881 int o = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1882 + (j * (2 *
p - 5 - j - 2 * k)) / 2 + i;
1883 int o1 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1884 + (k * (2 *
p - 5 - k - 2 * j)) / 2 + i;
1885 int o2 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1886 + (k * (2 *
p - 5 - k - 2 * i)) / 2 + j;
1887 int o3 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1888 + (i * (2 *
p - 5 - i - 2 * k)) / 2 + j;
1889 int o4 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1890 + (i * (2 *
p - 5 - i - 2 * j)) / 2 + k;
1891 int o5 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1892 + (j * (2 *
p - 5 - j - 2 * i)) / 2 + k;
1893 int o6 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1894 + (l * (2 *
p - 5 - l - 2 * k)) / 2 + j;
1895 int o7 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1896 + (k * (2 *
p - 5 - k - 2 * l)) / 2 + j;
1897 int o8 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1898 + (j * (2 *
p - 5 - j - 2 * l)) / 2 + k;
1899 int o9 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1900 + (l * (2 *
p - 5 - l - 2 * j)) / 2 + k;
1901 int o10 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1902 + (k * (2 *
p - 5 - k - 2 * j)) / 2 + l;
1903 int o11 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1904 + (j * (2 *
p - 5 - j - 2 * k)) / 2 + l;
1905 int o12 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1906 + (l * (2 *
p - 5 - l - 2 * i)) / 2 + k;
1907 int o13 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1908 + (i * (2 *
p - 5 - i - 2 * l)) / 2 + k;
1909 int o14 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1910 + (i * (2 *
p - 5 - i - 2 * k)) / 2 + l;
1911 int o15 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1912 + (k * (2 *
p - 5 - k - 2 * i)) / 2 + l;
1913 int o16 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1914 + (k * (2 *
p - 5 - k - 2 * l)) / 2 + i;
1915 int o17 = TetDof - ((pm1 - k) * (pm2 - k) * (pm3 - k)) / 6
1916 + (l * (2 *
p - 5 - l - 2 * k)) / 2 + i;
1917 int o18 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1918 + (j * (2 *
p - 5 - j - 2 * i)) / 2 + l;
1919 int o19 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1920 + (i * (2 *
p - 5 - i - 2 * j)) / 2 + l;
1921 int o20 = TetDof - ((pm1 - j) * (pm2 - j) * (pm3 - j)) / 6
1922 + (l * (2 *
p - 5 - l - 2 * j)) / 2 + i;
1923 int o21 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1924 + (j * (2 *
p - 5 - j - 2 * l)) / 2 + i;
1925 int o22 = TetDof - ((pm1 - l) * (pm2 - l) * (pm3 - l)) / 6
1926 + (i * (2 *
p - 5 - i - 2 * l)) / 2 + j;
1927 int o23 = TetDof - ((pm1 - i) * (pm2 - i) * (pm3 - i)) / 6
1928 + (l * (2 *
p - 5 - l - 2 * i)) / 2 + j;
1970 MFEM_ABORT(
"H1 Pyramid basis functions are not yet supported "
2002 if (!strncmp(
h1_name,
"H1_", 3))
2006 else if (!strncmp(
h1_name,
"H1Pos_", 6))
2010 else if (!strncmp(
h1_name,
"H1@", 3))
2019 const int *dof_map = NULL;
2029 MFEM_ABORT(
"Geometry type " <<
Geometry::Name[GeomType] <<
" is not "
2061 snprintf(
h1_name, 32,
"H1_Trace_%dD_P%d",
dim,
p);
2065 snprintf(
h1_name, 32,
"H1Pos_Trace_%dD_P%d",
dim,
p);
2069 snprintf(
h1_name, 32,
"H1_Trace@%c_%dD_P%d",
2081 MFEM_VERIFY(
p >= 0,
"L2_FECollection requires order >= 0.");
2084 const char *prefix = NULL;
2090 MFEM_ABORT(
"invalid map_type: " << map_type);
2095 snprintf(d_name, 32,
"%s_%dD_P%d", prefix,
dim,
p);
2098 snprintf(d_name, 32,
"%s_T%d_%dD_P%d", prefix, btype,
dim,
p);
2103 L2_Elements[g] = NULL;
2104 Tr_Elements[g] = NULL;
2106 for (
int i = 0; i < 2; i++)
2108 SegDofOrd[i] = NULL;
2110 for (
int i = 0; i < 6; i++)
2112 TriDofOrd[i] = NULL;
2114 for (
int i = 0; i < 24; i++)
2116 TetDofOrd[i] = NULL;
2139 const int pp1 =
p + 1;
2140 SegDofOrd[0] = (pp1 > 0) ?
new int[2*pp1] :
nullptr;
2141 SegDofOrd[1] = SegDofOrd[0] + pp1;
2142 for (
int i = 0; i <=
p; i++)
2144 SegDofOrd[0][i] = i;
2145 SegDofOrd[1][i] =
p - i;
2173 TriDofOrd[0] = (TriDof > 0) ?
new int[6*TriDof] :
nullptr;
2174 for (
int i = 1; i < 6; i++)
2176 TriDofOrd[i] = TriDofOrd[i-1] + TriDof;
2178 const int pp1 =
p + 1, pp2 = pp1 + 1;
2179 for (
int j = 0; j <=
p; j++)
2181 for (
int i = 0; i + j <=
p; i++)
2183 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
2185 TriDofOrd[0][o] = o;
2186 TriDofOrd[1][o] = TriDof - ((pp2-j)*(pp1-j))/2 + k;
2187 TriDofOrd[2][o] = TriDof - ((pp2-i)*(pp1-i))/2 + k;
2188 TriDofOrd[3][o] = TriDof - ((pp2-k)*(pp1-k))/2 + i;
2189 TriDofOrd[4][o] = TriDof - ((pp2-k)*(pp1-k))/2 + j;
2190 TriDofOrd[5][o] = TriDof - ((pp2-i)*(pp1-i))/2 + j;
2194 OtherDofOrd = (QuadDof > 0) ?
new int[QuadDof] :
nullptr;
2195 for (
int j = 0; j < QuadDof; j++)
2236 const int MaxDof = std::max(TetDof, std::max(PriDof, HexDof));
2238 TetDofOrd[0] = (TetDof > 0) ?
new int[24*TetDof] :
nullptr;
2239 for (
int i = 1; i < 24; i++)
2241 TetDofOrd[i] = TetDofOrd[i-1] + TetDof;
2244 const int pp1 =
p + 1, pp2 = pp1 + 1, pp3 = pp2 + 1;
2245 for (
int k = 0; k <=
p; k++)
2247 for (
int j = 0; j + k <=
p; j++)
2249 for (
int i = 0; i + j + k <=
p; i++)
2251 int l =
p - k - j - i;
2252 int o = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2253 + (j * (2 *
p + 3 - j - 2 * k)) / 2 + i;
2254 int o1 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2255 + (k * (2 *
p + 3 - k - 2 * j)) / 2 + i;
2256 int o2 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2257 + (k * (2 *
p + 3 - k - 2 * i)) / 2 + j;
2258 int o3 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2259 + (i * (2 *
p + 3 - i - 2 * k)) / 2 + j;
2260 int o4 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2261 + (i * (2 *
p + 3 - i - 2 * j)) / 2 + k;
2262 int o5 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2263 + (j * (2 *
p + 3 - j - 2 * i)) / 2 + k;
2264 int o6 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2265 + (l * (2 *
p + 3 - l - 2 * k)) / 2 + j;
2266 int o7 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2267 + (k * (2 *
p + 3 - k - 2 * l)) / 2 + j;
2268 int o8 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2269 + (j * (2 *
p + 3 - j - 2 * l)) / 2 + k;
2270 int o9 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2271 + (l * (2 *
p + 3 - l - 2 * j)) / 2 + k;
2272 int o10 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2273 + (k * (2 *
p + 3 - k - 2 * j)) / 2 + l;
2274 int o11 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2275 + (j * (2 *
p + 3 - j - 2 * k)) / 2 + l;
2276 int o12 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2277 + (l * (2 *
p + 3 - l - 2 * i)) / 2 + k;
2278 int o13 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2279 + (i * (2 *
p + 3 - i - 2 * l)) / 2 + k;
2280 int o14 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2281 + (i * (2 *
p + 3 - i - 2 * k)) / 2 + l;
2282 int o15 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2283 + (k * (2 *
p + 3 - k - 2 * i)) / 2 + l;
2284 int o16 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2285 + (k * (2 *
p + 3 - k - 2 * l)) / 2 + i;
2286 int o17 = TetDof - ((pp1 - k) * (pp2 - k) * (pp3 - k)) / 6
2287 + (l * (2 *
p + 3 - l - 2 * k)) / 2 + i;
2288 int o18 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2289 + (j * (2 *
p + 3 - j - 2 * i)) / 2 + l;
2290 int o19 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2291 + (i * (2 *
p + 3 - i - 2 * j)) / 2 + l;
2292 int o20 = TetDof - ((pp1 - j) * (pp2 - j) * (pp3 - j)) / 6
2293 + (l * (2 *
p + 3 - l - 2 * j)) / 2 + i;
2294 int o21 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2295 + (j * (2 *
p + 3 - j - 2 * l)) / 2 + i;
2296 int o22 = TetDof - ((pp1 - l) * (pp2 - l) * (pp3 - l)) / 6
2297 + (i * (2 *
p + 3 - i - 2 * l)) / 2 + j;
2298 int o23 = TetDof - ((pp1 - i) * (pp2 - i) * (pp3 - i)) / 6
2299 + (l * (2 *
p + 3 - l - 2 * i)) / 2 + j;
2300 TetDofOrd[ 0][o] = o;
2301 TetDofOrd[ 1][o] = o1;
2302 TetDofOrd[ 2][o] = o2;
2303 TetDofOrd[ 3][o] = o3;
2304 TetDofOrd[ 4][o] = o4;
2305 TetDofOrd[ 5][o] = o5;
2306 TetDofOrd[ 6][o] = o6;
2307 TetDofOrd[ 7][o] = o7;
2308 TetDofOrd[ 8][o] = o8;
2309 TetDofOrd[ 9][o] = o9;
2310 TetDofOrd[10][o] = o10;
2311 TetDofOrd[11][o] = o11;
2312 TetDofOrd[12][o] = o12;
2313 TetDofOrd[13][o] = o13;
2314 TetDofOrd[14][o] = o14;
2315 TetDofOrd[15][o] = o15;
2316 TetDofOrd[16][o] = o16;
2317 TetDofOrd[17][o] = o17;
2318 TetDofOrd[18][o] = o18;
2319 TetDofOrd[19][o] = o19;
2320 TetDofOrd[20][o] = o20;
2321 TetDofOrd[21][o] = o21;
2322 TetDofOrd[22][o] = o22;
2323 TetDofOrd[23][o] = o23;
2327 OtherDofOrd = (MaxDof > 0) ?
new int[MaxDof] :
nullptr;
2328 for (
int j = 0; j < MaxDof; j++)
2335 mfem::err <<
"L2_FECollection::L2_FECollection : dim = "
2346 return L2_Elements[GeomType];
2351 MFEM_ABORT(
"L2 Pyramid basis functions are not yet supported "
2363 return (Or > 0) ? SegDofOrd[0] : SegDofOrd[1];
2366 return TriDofOrd[Or%6];
2369 return TetDofOrd[Or%24];
2372 return (Or == 0) ? OtherDofOrd : NULL;
2378 delete [] OtherDofOrd;
2379 delete [] SegDofOrd[0];
2380 delete [] TriDofOrd[0];
2381 delete [] TetDofOrd[0];
2384 delete L2_Elements[i];
2385 delete Tr_Elements[i];
2391 const int cb_type,
const int ob_type)
2398 MFEM_VERIFY(
p >= 0,
"RT_FECollection requires order >= 0.");
2406 MFEM_ABORT(
"unknown closed BasisType: " << cb_name);
2412 MFEM_ABORT(
"unknown open BasisType: " << ob_name);
2428 const int pp1 =
p + 1;
2457 MFEM_ABORT(
"invalid dim = " <<
dim);
2464 const int map_type,
const bool signs,
2473 MFEM_ABORT(
"Invalid open basis type: " << ob_name);
2485 "invalid open point type");
2487 const int pp1 =
p + 1, pp2 =
p + 2;
2495 for (
int i = 0; i < 2; i++)
2499 for (
int i = 0; i < 6; i++)
2503 for (
int i = 0; i < 8; i++)
2515 SegDofOrd[0] = (pp1 > 0) ?
new int[2*pp1] :
nullptr;
2517 for (
int i = 0; i <=
p; i++)
2520 SegDofOrd[1][i] = signs ? (-1 - (
p - i)) : (
p - i);
2536 TriDofOrd[0] = (TriDof > 0) ?
new int[6*TriDof] :
nullptr;
2537 for (
int i = 1; i < 6; i++)
2543 for (
int j = 0; j <=
p; j++)
2545 for (
int i = 0; i + j <=
p; i++)
2547 int o = TriDof - ((pp2 - j)*(pp1 - j))/2 + i;
2550 TriDofOrd[1][o] = -1-(TriDof-((pp2-j)*(pp1-j))/2+k);
2551 TriDofOrd[2][o] = TriDof-((pp2-i)*(pp1-i))/2+k;
2552 TriDofOrd[3][o] = -1-(TriDof-((pp2-k)*(pp1-k))/2+i);
2553 TriDofOrd[4][o] = TriDof-((pp2-k)*(pp1-k))/2+j;
2554 TriDofOrd[5][o] = -1-(TriDof-((pp2-i)*(pp1-i))/2+j);
2557 for (
int kk = 1; kk < 6; kk += 2)
2566 QuadDofOrd[0] = (QuadDof > 0) ?
new int[8*QuadDof] :
nullptr;
2567 for (
int i = 1; i < 8; i++)
2572 for (
int j = 0; j <=
p; j++)
2574 for (
int i = 0; i <=
p; i++)
2587 for (
int k = 1; k < 8; k += 2)
2607 MFEM_ABORT(
"RT Pyramid basis functions are not yet supported "
2634 if (!strncmp(
rt_name,
"RT_", 3))
2665 const char *prefix =
2667 char ob_str[3] = {
'\0',
'\0',
'\0' };
2674 snprintf(
rt_name, 32,
"%s%s_%dD_P%d", prefix, ob_str,
dim,
p);
2676 MFEM_VERIFY(
dim == 2 ||
dim == 3,
"Wrong dimension, dim = " <<
dim);
2685 MFEM_VERIFY(
dim == 2 ||
dim == 3,
"Wrong dimension, dim = " <<
dim);
2687 const char *prefix =
2691 snprintf(
rt_name, 32,
"%s_%dD_P%d", prefix,
dim,
p);
2695 snprintf(
rt_name, 32,
"%s@%c_%dD_P%d", prefix,
2701 const int cb_type,
const int ob_type)
2707 MFEM_VERIFY(
p >= 1,
"ND_FECollection requires order >= 1.");
2708 MFEM_VERIFY(
dim >= 1 &&
dim <= 3,
"ND_FECollection requires 1 <= dim <= 3.");
2710 const int pm1 =
p - 1, pm2 =
p - 2;
2728 for (
int i = 0; i < 2; i++)
2732 for (
int i = 0; i < 6; i++)
2736 for (
int i = 0; i < 8; i++)
2749 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
2754 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
2764 for (
int i = 0; i <
p; i++)
2782 QuadDofOrd[0] = (QuadDof > 0) ?
new int[8*QuadDof] :
nullptr;
2783 for (
int i = 1; i < 8; i++)
2788 for (
int j = 0; j < pm1; j++)
2790 for (
int i = 0; i <
p; i++)
2793 int d2 =
p*pm1 + j + i*pm1;
2803 QuadDofOrd[2][d1] = -1 - (
p*pm1 + j + (pm1 - i)*pm1);
2809 QuadDofOrd[4][d1] = -1 - ((pm1 - i) + (pm2 - j)*
p);
2810 QuadDofOrd[4][d2] = -1 - (
p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2812 QuadDofOrd[5][d1] = -1 - (
p*pm1 + (pm2 - j) + (pm1 - i)*pm1);
2813 QuadDofOrd[5][d2] = -1 - ((pm1 - i) + (pm2 - j)*
p);
2821 QuadDofOrd[7][d2] = -1 - (
p*pm1 + j + (pm1 - i)*pm1);
2826 TriDofOrd[0] = (TriDof > 0) ?
new int[6*TriDof] :
nullptr;
2827 for (
int i = 1; i < 6; i++)
2833 for (
int j = 0; j <= pm2; j++)
2835 for (
int i = 0; i + j <= pm2; i++)
2837 int k0 =
p*pm1 - (
p - j)*(pm1 - j) + 2*i;
2838 int k1 = 2*pm2 - 2*i + ((2*
p-3)-j)*j;
2839 int k2 = 2*pm2 - 2*j + ((2*
p-3)-i)*i;
2840 int k3 =
p*pm1 - 2 - 3*j - i - (i+j)*(i+j);
2841 int k4 =
p*pm1 - 2 - 3*i - j - (i+j)*(i+j);
2842 int k5 =
p*pm1 - (
p - i)*(pm1 - i) + 2*j;
2893 MFEM_ABORT(
"ND Pyramid basis functions are not yet supported "
2932 int tr_p, tr_dim, tr_cb_type, tr_ob_type;
2970 snprintf(
nd_name, 32,
"ND_Trace_%dD_P%d",
dim,
p);
2974 snprintf(
nd_name, 32,
"ND_Trace@%c%c_%dD_P%d",
2982 const int cb_type,
const int ob_type)
2985 MFEM_VERIFY(
p >= 1,
"ND_R1D_FECollection requires order >= 1.");
2986 MFEM_VERIFY(
dim == 1,
"ND_R1D_FECollection requires dim == 1.");
2995 snprintf(
nd_name, 32,
"ND_R1D@%c%c_%dD_P%d",
3013 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
3018 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
3051 const int cb_type,
const int ob_type)
3054 MFEM_VERIFY(
p >= 0,
"RT_R1D_FECollection requires order >= 0.");
3055 MFEM_VERIFY(
dim == 1,
"RT_R1D_FECollection requires dim == 1.");
3064 snprintf(
rt_name, 32,
"RT_R1D@%c%c_%dD_P%d",
3082 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
3087 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
3107 MFEM_ABORT(
"this method is not implemented in RT_R1D_FECollection!");
3121 const int cb_type,
const int ob_type)
3124 MFEM_VERIFY(
p >= 1,
"ND_R2D_FECollection requires order >= 1.");
3125 MFEM_VERIFY(
dim >= 1 &&
dim <= 2,
3126 "ND_R2D_FECollection requires 1 <= dim <= 2.");
3128 const int pm1 =
p - 1, pm2 =
p - 2;
3137 snprintf(
nd_name, 32,
"ND_R2D@%c%c_%dD_P%d",
3147 for (
int i = 0; i < 2; i++)
3159 MFEM_ABORT(
"Invalid open basis point type: " << ob_name);
3164 MFEM_ABORT(
"Invalid closed basis point type: " << cb_name);
3176 SegDofOrd[0] = (4*
p > 2) ?
new int[4 *
p - 2] :
nullptr;
3178 for (
int i = 0; i <
p; i++)
3183 for (
int i = 0; i < pm1; i++)
3215 int p,
dim, cb_type, ob_type;
3251 snprintf(
nd_name, 32,
"ND_R2D_Trace_%dD_P%d",
dim,
p);
3255 snprintf(
nd_name, 32,
"ND_R2D_Trace@%c%c_%dD_P%d",
3263 const int cb_type,
const int ob_type)
3267 MFEM_VERIFY(
p >= 0,
"RT_R2D_FECollection requires order >= 0.");
3268 MFEM_VERIFY(
dim >= 1 &&
dim <= 2,
3269 "RT_R2D_FECollection requires 1 <= dim <= 2.");
3277 MFEM_ABORT(
"unknown closed BasisType: " << cb_name);
3282 MFEM_ABORT(
"unknown open BasisType: " << ob_name);
3294 snprintf(
rt_name, 32,
"RT_R2D@%c%c_%dD_P%d",
3299 const int pp1 =
p + 1;
3300 const int pp2 =
p + 2;
3319 const bool signs,
const int ob_type)
3326 MFEM_ABORT(
"Invalid open basis type: " << ob_name);
3338 "invalid open point type");
3340 const int pp1 =
p + 1;
3348 for (
int i = 0; i < 2; i++)
3360 SegDofOrd[0] = (pp1 > 0) ?
new int[2*pp1] :
nullptr;
3362 for (
int i = 0; i <=
p; i++)
3365 SegDofOrd[1][i] = signs ? (-1 - (
p - i)) : (
p - i);
3383 if (!strncmp(
rt_name,
"RT_R2D_", 7))
3411 const char *prefix =
3413 char ob_str[3] = {
'\0',
'\0',
'\0' };
3420 snprintf(
rt_name, 32,
"%s%s_%dD_P%d", prefix, ob_str,
dim,
p);
3422 MFEM_VERIFY(
dim == 2,
"Wrong dimension, dim = " <<
dim);
3428 snprintf(d_name, 32,
"Local_%s", fe_name);
3430 Local_Element = NULL;
3432 if (!strcmp(fe_name,
"BiCubic2DFiniteElement") ||
3433 !strcmp(fe_name,
"Quad_Q3"))
3438 else if (!strcmp(fe_name,
"Nedelec1HexFiniteElement") ||
3439 !strcmp(fe_name,
"Hex_ND1"))
3444 else if (!strncmp(fe_name,
"H1_", 3))
3449 else if (!strncmp(fe_name,
"H1Pos_", 6))
3454 else if (!strncmp(fe_name,
"L2_", 3))
3461 mfem::err <<
"Local_FECollection::Local_FECollection : fe_name = "
3485 snprintf(name, 16,
"NURBS%i", Order);
3489 snprintf(name, 16,
"NURBS");
3497 delete QuadrilateralFE;
3498 delete ParallelepipedFE;
3512 mfem_error (
"NURBSFECollection: unknown geometry type.");
3519 mfem_error(
"NURBSFECollection::DofForGeometry");
3526 mfem_error(
"NURBSFECollection::DofOrderForOrientation");
3532 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.
@ Serendipity
Serendipity basis (squares / cubes)
@ GaussLobatto
Closed type.
@ GaussLegendre
Open type.
@ Positive
Bernstein polynomials.
@ IntegratedGLL
Integrated GLL indicator functions.
static char GetChar(int b_type)
Check and convert a BasisType constant to a char basis identifier.
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.
const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const override
virtual ~H1_FECollection()
H1_FECollection(const int p, const int dim=3, const int btype=BasisType::GaussLobatto)
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 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-conforming" discontinuous finite elements.
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].
L2_FECollection(const int p, const int dim, const int btype=BasisType::GaussLegendre, const int map_type=FiniteElement::VALUE)
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
A linear element defined on a square pyramid.
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.
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
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
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].
A 3D 1st order Nedelec element on a cube.
A 3D 1st order Nedelec element on a pyramid.
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...
A 3D constant element on a pyramid.
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.
A 3D 0th order Raviert-Thomas element on a pyramid.
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.
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)