14 #include "../../fem/gridfunc.hpp" 22 return SubMesh(parent, From::Domain, domain_attributes);
32 Array<int> attributes) : parent_(parent), from_(from), attributes_(attributes)
36 MFEM_ABORT(
"SubMesh does not support non-conforming meshes");
39 if (from == From::Domain)
43 std::tie(parent_vertex_ids_,
51 std::tie(parent_vertex_ids_,
68 int pbeid = parent_face_to_be[parent_face_ids_[
GetBdrFace(i)]];
90 Array<int> sub_par_vert(sub_vert.Size());
91 for (
int j = 0; j < sub_vert.Size(); j++)
93 sub_par_vert[j] = parent_vertex_ids_[sub_vert[j]];
99 if (par_vert.Size() == 3)
111 if (from == From::Domain)
114 parent_element_ids_);
120 int pbeid = parent_face_to_be[parent_edge_ids_[
GetBdrFace(i)]];
143 Array<int> sub_par_vert(sub_vert.Size());
144 for (
int j = 0; j < sub_vert.Size(); j++)
146 sub_par_vert[j] = parent_vertex_ids_[sub_vert[j]];
163 if (par_vert.Size() == 3)
178 const GridFunction *parent_nodes = parent.
GetNodes();
181 const FiniteElementSpace *parent_fes = parent_nodes->FESpace();
184 parent_fes->FEColl()->GetOrder(),
185 parent_fes->IsDGSpace(),
187 parent_fes->GetOrdering());
Array< int > GetFaceToBdrElMap() const
Class for grid function - Vector with associated FE space.
int Dimension() const
Dimension of the reference space used within the elements.
static SubMesh CreateFromDomain(const Mesh &parent, Array< int > domain_attributes)
Create a domain SubMesh from its parent.
void Transfer(const GridFunction &src, GridFunction &dst) const
Transfer the source GridFunction to the destination GridFunction.
int GetAttribute() const
Return element's attribute.
bool Nonconforming() const
T Max() const
Find the maximal element in the array, using the comparison operator < for class T.
void GetBdrElementVertices(int i, Array< int > &v) const
Returns the indices of the vertices of boundary element i.
static int GetQuadOrientation(const int *base, const int *test)
Returns the orientation of "test" relative to "base".
std::function< double(const Vector &)> f(double mass_coeff)
void GetBdrElementFace(int i, int *f, int *o) const
Return the index and the orientation of the face of bdr element i. (3D)
virtual void SetAttributes()
Determine the sets of unique attribute values in domain and boundary elements.
TransferMap represents a mapping of degrees of freedom from a source GridFunction to a destination Gr...
virtual void SetCurvature(int order, bool discont=false, int space_dim=-1, int ordering=1)
Set the curvature of the mesh nodes using the given polynomial degree.
void GetFaceVertices(int i, Array< int > &vert) const
Returns the indices of the vertices of face i.
void GetElementVertices(int i, Array< int > &v) const
Returns the indices of the vertices of element i.
int GetBdrFace(int BdrElemNo) const
Return the local face index for the given boundary face.
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
std::tuple< Array< int >, Array< int > > AddElementsToMesh(const Mesh &parent, Mesh &mesh, const Array< int > &attributes, bool from_boundary)
Given a Mesh parent and another Mesh mesh using the list of attributes in attributes, this function adds matching elements with those attributes from parent to mesh.
void FinalizeTopology(bool generate_bdr=true)
Finalize the construction of the secondary topology (connectivity) data of a Mesh.
GridFunction * GetNodes()
Return a pointer to the internal node GridFunction (may be NULL).
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
Array< int > BuildFaceMap(const Mesh &pm, const Mesh &sm, const Array< int > &parent_element_ids)
Given two meshes that have a parent to SubMesh relationship create a face map, using a SubMesh to par...
void InitMesh(int Dim_, int spaceDim_, int NVert, int NElem, int NBdrElem)
Begin construction of a mesh.
int SpaceDimension() const
Dimension of the physical space containing the mesh.
virtual void Finalize(bool refine=false, bool fix_orientation=false)
Finalize the construction of a general Mesh.
static void Transfer(const GridFunction &src, GridFunction &dst)
Transfer the dofs of a GridFunction.
static TransferMap CreateTransferMap(const GridFunction &src, const GridFunction &dst)
Create a Transfer Map object.
Subdomain representation of a topological parent in another Mesh.
void SetAttribute(const int attr)
Set element's attribute.
static SubMesh CreateFromBoundary(const Mesh &parent, Array< int > boundary_attributes)
Create a surface SubMesh from its parent.
static int GetTriOrientation(const int *base, const int *test)
Returns the orientation of "test" relative to "base".
void GetNodes(Vector &node_coord) const
const Element * GetBdrElement(int i) const
Return pointer to the i'th boundary element object.
static int ComposeTriOrientations(int ori_a_b, int ori_b_c)