47 std::vector<int> vertex_ids_;
48 std::vector<int> edge_ids_;
49 std::vector<int> tri_ids_;
50 std::vector<int> quad_ids_;
51 std::vector<int> tet_ids_;
52 std::vector<int> hex_ids_;
75 static Domain ofEdges(
const mfem::Mesh& mesh, std::function<
bool(std::vector<vec2>,
int)> func);
78 static Domain ofEdges(
const mfem::Mesh& mesh, std::function<
bool(std::vector<vec3>)> func);
87 static Domain ofFaces(
const mfem::Mesh& mesh, std::function<
bool(std::vector<vec2>,
int)> func);
90 static Domain ofFaces(
const mfem::Mesh& mesh, std::function<
bool(std::vector<vec3>,
int)> func);
99 static Domain ofElements(
const mfem::Mesh& mesh, std::function<
bool(std::vector<vec2>,
int)> func);
102 static Domain ofElements(
const mfem::Mesh& mesh, std::function<
bool(std::vector<vec3>,
int)> func);
115 const std::vector<int>&
get(mfem::Geometry::Type geom)
const
117 if (geom == mfem::Geometry::POINT)
return vertex_ids_;
118 if (geom == mfem::Geometry::SEGMENT)
return edge_ids_;
119 if (geom == mfem::Geometry::TRIANGLE)
return tri_ids_;
120 if (geom == mfem::Geometry::SQUARE)
return quad_ids_;
121 if (geom == mfem::Geometry::TETRAHEDRON)
return tet_ids_;
122 if (geom == mfem::Geometry::CUBE)
return hex_ids_;
135 Domain
operator|(
const Domain& a,
const Domain& b);
138 Domain
operator&(
const Domain& a,
const Domain& b);
141 Domain
operator-(
const Domain& a,
const Domain& b);
147 return [value](std::vector<tensor<double, dim> >,
int attr) {
return attr == value; };
Accelerator functionality.
Domain EntireBoundary(const mfem::Mesh &mesh)
constructs a domain from all the boundary elements in a mesh
auto by_attr(int value)
convenience predicate for creating domains by attribute
Domain operator-(const Domain &a, const Domain &b)
create a new domain that is the set difference of a and b
Domain operator&(const Domain &a, const Domain &b)
create a new domain that is the intersection of a and b
Domain operator|(const Domain &a, const Domain &b)
create a new domain that is the union of a and b
constexpr SERAC_HOST_DEVICE auto type(const tuple< T... > &values)
a function intended to be used for extracting the ith type from a tuple.
Domain EntireDomain(const mfem::Mesh &mesh)
constructs a domain from all the elements in a mesh
a class for representing a geometric region that can be used for integration
static Domain ofFaces(const mfem::Mesh &mesh, std::function< bool(std::vector< vec2 >, int)> func)
create a domain from some subset of the faces in an mfem::Mesh
static Domain ofBoundaryElements(const mfem::Mesh &mesh, std::function< bool(std::vector< vec2 >, int)> func)
create a domain from some subset of the boundary elements (spatial dim == geometry dim + 1) in an mfe...
static constexpr int num_types
the number of entries in the Type enum
static Domain ofVertices(const mfem::Mesh &mesh, std::function< bool(vec2)> func)
create a domain from some subset of the vertices in an mfem::Mesh
Domain(const mfem::Mesh &m, int d, Type type=Domain::Type::Elements)
Type type_
whether the elements in this domain are on the boundary or not
Type
enum describing what kind of elements are included in a Domain
int dim_
the geometric dimension of the domain
const mfem::Mesh & mesh_
the underyling mesh for this domain
const std::vector< int > & get(mfem::Geometry::Type geom) const
get elements by geometry type
static Domain ofElements(const mfem::Mesh &mesh, std::function< bool(std::vector< vec2 >, int)> func)
create a domain from some subset of the elements (spatial dim == geometry dim) in an mfem::Mesh
static Domain ofEdges(const mfem::Mesh &mesh, std::function< bool(std::vector< vec2 >, int)> func)
create a domain from some subset of the edges in an mfem::Mesh
Arbitrary-rank tensor class.
Implementation of the tensor class used by Functional.