21 constexpr
operator int() {
return d; }
33 if (g == mfem::Geometry::SEGMENT) {
36 if (g == mfem::Geometry::TRIANGLE) {
37 return (Q * (Q + 1)) / 2;
39 if (g == mfem::Geometry::SQUARE) {
42 if (g == mfem::Geometry::TETRAHEDRON) {
43 return (Q * (Q + 1) * (Q + 2)) / 6;
45 if (g == mfem::Geometry::CUBE) {
57 if (g == mfem::Geometry::SEGMENT) {
61 if (g == mfem::Geometry::TRIANGLE || g == mfem::Geometry::SQUARE) {
65 if (g == mfem::Geometry::TETRAHEDRON || g == mfem::Geometry::CUBE) {
76 inline std::array<uint32_t, mfem::Geometry::NUM_GEOMETRIES>
geometry_counts(
const mfem::Mesh& mesh)
78 std::array<uint32_t, mfem::Geometry::NUM_GEOMETRIES> counts{};
79 for (
int i = 0; i < mesh.GetNE(); i++) {
80 counts[uint64_t(mesh.GetElementGeometry(i))]++;
91 std::array<uint32_t, mfem::Geometry::NUM_GEOMETRIES> counts{};
92 for (
int f = 0; f < mesh.GetNumFaces(); f++) {
94 if (mesh.GetFaceInformation(f).IsInterior())
continue;
96 counts[uint64_t(mesh.GetFaceGeometry(f))]++;
Accelerator functionality.
constexpr int num_quadrature_points(mfem::Geometry::Type g, int Q)
return the number of quadrature points in a Gauss-Legendre rule with parameter "Q"
std::array< uint32_t, mfem::Geometry::NUM_GEOMETRIES > geometry_counts(const Domain &domain)
count the number of elements of each geometry in a domain
std::array< uint32_t, mfem::Geometry::NUM_GEOMETRIES > boundary_geometry_counts(const mfem::Mesh &mesh)
count the number of boundary elements of each geometry in a mesh
constexpr int dimension_of(mfem::Geometry::Type g)
Returns the dimension of an element geometry.
Compile-time alias for a dimension.