34 const Array<int> &attributes) : parent_(&parent), from_(from),
35 attributes_(attributes)
41 std::tie(parent_vertex_ids_,
49 std::tie(parent_vertex_ids_,
55 parent_to_submesh_vertex_ids_ = -1;
56 for (
int i = 0; i < parent_vertex_ids_.
Size(); i++)
58 parent_to_submesh_vertex_ids_[parent_vertex_ids_[i]] = i;
63 parent_to_submesh_element_ids_ = -1;
64 for (
int i = 0; i < parent_element_ids_.
Size(); i++)
66 parent_to_submesh_element_ids_[parent_element_ids_[i]] = i;
80 parent_to_submesh_vertex_ids_ = -1;
81 for (
int i = 0; i < parent_vertex_ids_.
Size(); i++)
85 auto parent_node = ncsubmesh_->parent_node_ids_[node];
87 parent_vertex_ids_[i] = parent_vertex;
88 parent_to_submesh_vertex_ids_[parent_vertex] = i;
94 DSTable v2v(parent_->
GetNV());
102 int parent_edge_id = v2v(parent_vertex_ids_[lv[0]],
103 parent_vertex_ids_[lv[1]]);
104 parent_edge_ids_.
Append(parent_edge_id);
108 parent_to_submesh_edge_ids_ = -1;
109 for (
int i = 0; i < parent_edge_ids_.
Size(); i++)
111 parent_to_submesh_edge_ids_[parent_edge_ids_[i]] = i;
117 parent_element_ids_);
120 parent_to_submesh_face_ids_ = -1;
121 for (
int i = 0; i < parent_face_ids_.
Size(); i++)
123 parent_to_submesh_face_ids_[parent_face_ids_[i]] = i;
132 Array<int> sub_par_vert(sub_vert.Size());
133 for (
int j = 0; j < sub_vert.Size(); j++)
135 sub_par_vert[j] = parent_vertex_ids_[sub_vert[j]];
140 if (par_vert.Size() == 3)
155 parent_element_ids_);
158 parent_to_submesh_edge_ids_ = -1;
159 for (
int i = 0; i < parent_edge_ids_.
Size(); i++)
161 parent_to_submesh_edge_ids_[parent_edge_ids_[i]] = i;
194 Array<int> sub_par_vert(sub_vert.Size());
195 for (
int j = 0; j < sub_vert.Size(); j++)
197 sub_par_vert[j] = parent_vertex_ids_[sub_vert[j]];
214 if (par_vert.Size() == 3)
242 const GridFunction *parent_nodes = parent.
GetNodes();
245 const FiniteElementSpace *parent_fes = parent_nodes->FESpace();
248 parent_fes->FEColl()->GetOrder(),
249 parent_fes->IsDGSpace(),
251 parent_fes->GetOrdering());
T Max() const
Find the maximal element in the array, using the comparison operator < for class T.
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
int Size() const
Return the logical size of the array.
int Append(const T &el)
Append element 'el' to array, resize if necessary.
void SetAttribute(const int attr)
Set element's attribute.
int GetAttribute() const
Return element's attribute.
Class for grid function - Vector with associated FE space.
int GetElementToEdgeTable(Table &)
int GetNEdges() const
Return the number of edges.
void GetBdrElementFace(int i, int *f, int *o) const
void InitMesh(int Dim_, int spaceDim_, int NVert, int NElem, int NBdrElem)
Begin construction of a mesh.
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
static int GetQuadOrientation(const int *base, const int *test)
Returns the orientation of "test" relative to "base".
void GetBdrElementVertices(int i, Array< int > &v) const
Returns the indices of the vertices of boundary element i.
void GetElementVertices(int i, Array< int > &v) const
Returns the indices of the vertices of element i.
Array< int > GetFaceToBdrElMap() const
void GenerateNCFaceInfo()
bool Nonconforming() const
Return a bool indicating whether this mesh is nonconforming.
int GetBdrElementFaceIndex(int be_idx) const
Return the local face (codimension-1) index for the given boundary element index.
void InitFromNCMesh(const NCMesh &ncmesh)
Initialize vertices/elements/boundary/tables from a nonconforming mesh.
static int GetTriOrientation(const int *base, const int *test)
Returns the orientation of "test" relative to "base".
int GetNFaces() const
Return the number of faces in a 3D mesh.
void FinalizeTopology(bool generate_bdr=true)
Finalize the construction of the secondary topology (connectivity) data of a Mesh.
int GetNE() const
Returns number of elements.
int Dimension() const
Dimension of the reference space used within the elements.
const Element * GetBdrElement(int i) const
Return pointer to the i'th boundary element object.
STable3D * GetElementToFaceTable(int ret_ftbl=0)
int SpaceDimension() const
Dimension of the physical space containing the mesh.
void GetNodes(Vector &node_coord) const
static int ComposeTriOrientations(int ori_a_b, int ori_b_c)
int GetNV() const
Returns number of vertices. Vertices are only at the corners of elements, where you would expect them...
void GetEdgeVertices(int i, Array< int > &vert) const
Returns the indices of the vertices of edge i.
void GetFaceVertices(int i, Array< int > &vert) const
Returns the indices of the vertices of face i.
int GetNBE() const
Returns number of boundary elements.
virtual void Finalize(bool refine=false, bool fix_orientation=false)
Finalize the construction of a general Mesh.
NCMesh * ncmesh
Optional nonconforming mesh extension.
GridFunction * GetNodes()
Return a pointer to the internal node GridFunction (may be NULL).
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 GetVertexToVertexTable(DSTable &) const
Array< int > attributes
A list of all unique element attributes used by the Mesh.
virtual void SetAttributes()
Determine the sets of unique attribute values in domain and boundary elements.
void OnMeshUpdated(Mesh *mesh)
int GetNodeVertex(int node)
Given a node index, return the vertex index associated.
Array< int > vertex_nodeId
vertex-index to node-id map, see UpdateVertices
Subdomain representation of a topological parent in another Mesh.
static SubMesh CreateFromBoundary(const Mesh &parent, const Array< int > &boundary_attributes)
Create a surface SubMesh from its parent.
static void Transfer(const GridFunction &src, GridFunction &dst)
Transfer the dofs of a GridFunction.
static SubMesh CreateFromDomain(const Mesh &parent, const Array< int > &domain_attributes)
Create a domain SubMesh from its parent.
static TransferMap CreateTransferMap(const GridFunction &src, const GridFunction &dst)
Create a Transfer Map object.
TransferMap represents a mapping of degrees of freedom from a source GridFunction to a destination Gr...
void Transfer(const GridFunction &src, GridFunction &dst) const
Transfer the source GridFunction to the destination GridFunction.
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,...
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 AddBoundaryElements(SubMeshT &mesh, const std::unordered_map< int, int > &lface_to_boundary_attribute)
Add boundary elements to the SubMesh.
std::function< real_t(const Vector &)> f(real_t mass_coeff)