MFEM v4.8.0
Finite element discretization library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
mfem::NCSubMesh Class Reference

Class representing a Nonconformal SubMesh. This is only used by SubMesh. More...

#include <ncsubmesh.hpp>

Inheritance diagram for mfem::NCSubMesh:
[legend]
Collaboration diagram for mfem::NCSubMesh:
[legend]

Public Types

using From = SubMesh::From
 
- Public Types inherited from mfem::NCMesh
using RefCoord = std::int64_t
 

Public Member Functions

const NCMeshGetParent () const
 Get the parent NCMesh object.
 
- Public Member Functions inherited from mfem::NCMesh
 NCMesh (const Mesh *mesh)
 
 NCMesh (std::istream &input, int version, int &curved, int &is_nc)
 
 NCMesh (const NCMesh &other)
 Deep copy of another instance.
 
NCMeshoperator= (NCMesh &)=delete
 Copy assignment not supported.
 
virtual ~NCMesh ()
 
int Dimension () const
 Return the dimension of the NCMesh.
 
int SpaceDimension () const
 Return the space dimension of the NCMesh.
 
int GetNVertices () const
 Return the number of vertices in the NCMesh.
 
int GetNEdges () const
 Return the number of edges in the NCMesh.
 
int GetNFaces () const
 Return the number of (2D) faces in the NCMesh.
 
virtual int GetNGhostElements () const
 
virtual void Refine (const Array< Refinement > &refinements)
 
virtual void LimitNCLevel (int max_nc_level)
 
const TableGetDerefinementTable ()
 
virtual void CheckDerefinementNCLevel (const Table &deref_table, Array< int > &level_ok, int max_nc_level)
 
virtual void Derefine (const Array< int > &derefs)
 
const NCListGetFaceList ()
 Return the current list of conforming and nonconforming faces.
 
const NCListGetEdgeList ()
 Return the current list of conforming and nonconforming edges.
 
const NCListGetVertexList ()
 
const NCListGetNCList (int entity)
 Return vertex/edge/face list (entity = 0/1/2, respectively).
 
void MarkCoarseLevel ()
 
const CoarseFineTransformationsGetRefinementTransforms () const
 
const CoarseFineTransformationsGetDerefinementTransforms () const
 
void ClearTransforms ()
 Free all internal data created by the above three functions.
 
void GetEdgeVertices (const MeshId &edge_id, int vert_index[2], bool oriented=true) const
 Return Mesh vertex indices of an edge identified by 'edge_id'.
 
int GetEdgeNCOrientation (const MeshId &edge_id) const
 
int GetFaceVerticesEdges (const MeshId &face_id, int vert_index[4], int edge_index[4], int edge_orientation[4]) const
 
int GetEdgeMaster (int v1, int v2) const
 
virtual void GetBoundaryClosure (const Array< int > &bdr_attr_is_ess, Array< int > &bdr_vertices, Array< int > &bdr_edges, Array< int > &bdr_faces)
 Get a list of vertices (2D/3D), edges (3D) and faces (3D) that coincide with boundary elements with the specified attributes (marked in 'bdr_attr_is_ess').
 
Geometry::Type GetElementGeometry (int index) const
 Return element geometry type. index is the Mesh element number.
 
Geometry::Type GetFaceGeometry (int index) const
 Return face geometry type. index is the Mesh face number.
 
int GetNumRootElements ()
 Return the number of root elements.
 
int GetElementDepth (int i) const
 Return the distance of leaf i from the root.
 
int GetElementSizeReduction (int i) const
 
void GetElementFacesAttributes (int i, Array< int > &faces, Array< int > &fattr) const
 Return the faces and face attributes of leaf element i.
 
void SetAttribute (int i, int attr)
 Set the attribute of leaf element i, which is a Mesh element index.
 
void Print (std::ostream &out, const std::string &comments="") const
 
bool IsLegacyLoaded () const
 I/O: Return true if the mesh was loaded from the legacy v1.1 format.
 
void LegacyToNewVertexOrdering (Array< int > &order) const
 I/O: Return a map from old (v1.1) vertex indices to new vertex indices.
 
virtual void Trim ()
 Save memory by releasing all non-essential and cached data.
 
long MemoryUsage () const
 Return total number of bytes allocated.
 
int PrintMemoryDetail () const
 
int GetNodeVertex (int node)
 Given a node index, return the vertex index associated.
 
int GetNumNodes () const
 The number of Nodes.
 
const NodeGetNode (int i) const
 Access a Node.
 
int GetNumFaces () const
 The number of faces.
 
const FaceGetFace (int i) const
 Access a Face.
 
int GetNumElements () const
 The number of elements.
 
const ElementGetElement (int i) const
 Access an Element.
 
int ParentFaceNodes (std::array< int, 4 > &nodes) const
 Given a set of nodes defining a face, traverse the nodes structure to find the nodes that make up the parent face and replace the input nodes with the parent nodes. Additionally return the child index that the child face would be, relative to the discovered parent face.
 
std::array< int, 4 > FindFaceNodes (int face) const
 Method for finding the nodes associated to a face.
 
std::array< int, 4 > FindFaceNodes (const Face &fa) const
 
MFEM_DEPRECATED void FindFaceNodes (int face, int node[4]) const
 Backwards compatible method for finding the node associated to a face.
 
void DebugLeafOrder (std::ostream &out) const
 
void DebugDump (std::ostream &out) const
 

Static Public Member Functions

static bool IsNCSubMesh (const NCMesh *m)
 Check if NCMesh m is a NCSubMesh.
 
- Static Public Member Functions inherited from mfem::NCMesh
static void GridSfcOrdering2D (int width, int height, Array< int > &coords)
 
static void GridSfcOrdering3D (int width, int height, int depth, Array< int > &coords)
 

Friends

class SubMesh
 Only SubMesh can use methods in this class.
 
void SubMeshUtils::ConstructFaceTree (NCSubMesh &submesh, const Array< int > &attributes)
 
void SubMeshUtils::ConstructVolumeTree (NCSubMesh &submesh, const Array< int > &attributes)
 

Additional Inherited Members

- Static Public Attributes inherited from mfem::NCMesh
static constexpr int MaxElemNodes
 Number of nodes an element can have.
 
static constexpr int MaxElemEdges
 Number of edges an element can have.
 
static constexpr int MaxElemFaces
 Number of faces an element can have.
 
static constexpr int MaxElemChildren
 Number of children an element can have.
 
static constexpr int MaxFaceNodes
 Number of faces an element can have.
 
- Protected Types inherited from mfem::NCMesh
using RefPathMap = std::map<std::string, int>
 
- Protected Member Functions inherited from mfem::NCMesh
 NCMesh ()=default
 
void GetMeshComponents (Mesh &mesh) const
 Fill Mesh::{vertices,elements,boundary} for the current finest level.
 
void OnMeshUpdated (Mesh *mesh)
 
void MakeTopologyOnly ()
 
virtual void Update ()
 
void UpdateLeafElements ()
 Update the leaf elements indices in leaf_elements.
 
void UpdateVertices ()
 This method assigns indices to vertices (Node::vert_index) that will be seen by the Mesh class and the rest of MFEM.
 
void CollectLeafElements (int elem, int state, Array< int > &ghosts, int &counter)
 
void InitRootState (int root_count)
 
void InitGeomFlags ()
 
bool HavePrisms () const
 Return true if the mesh contains prism elements.
 
bool HavePyramids () const
 Return true if the mesh contains pyramid elements.
 
bool HaveTets () const
 Return true if the mesh contains tetrahedral elements.
 
bool IsGhost (const Element &el) const
 Return true if the Element el is a ghost element.
 
void RefineElement (int elem, char ref_type)
 Refine the element elem with the refinement type ref_type.
 
void RefineElement (const Refinement &ref)
 Refine one element with type and scale specified by ref.
 
void DerefineElement (int elem)
 Derefine the element elem, does nothing on leaf elements.
 
void SetNodeScale (int p0, int p1, real_t scale)
 Helper function to set scale for a node with parents p0, p1.
 
int AddElement (const Element &el)
 Add an Element el to the NCMesh, optimized to reuse freed elements.
 
int AddElement (Geometry::Type geom, int attr)
 
void FreeElement (int id)
 
int NewHexahedron (int n0, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int attr, int fattr0, int fattr1, int fattr2, int fattr3, int fattr4, int fattr5)
 
int NewWedge (int n0, int n1, int n2, int n3, int n4, int n5, int attr, int fattr0, int fattr1, int fattr2, int fattr3, int fattr4)
 
int NewTetrahedron (int n0, int n1, int n2, int n3, int attr, int fattr0, int fattr1, int fattr2, int fattr3)
 
int NewPyramid (int n0, int n1, int n2, int n3, int n4, int attr, int fattr0, int fattr1, int fattr2, int fattr3, int fattr4)
 
int NewQuadrilateral (int n0, int n1, int n2, int n3, int attr, int eattr0, int eattr1, int eattr2, int eattr3)
 
int NewTriangle (int n0, int n1, int n2, int attr, int eattr0, int eattr1, int eattr2)
 
int NewSegment (int n0, int n1, int attr, int vattr1, int vattr2)
 
mfem::ElementNewMeshElement (int geom) const
 
int QuadFaceSplitType (int n1, int n2, int n3, int n4, real_t &s, int mid[5]=NULL) const
 Given a quad face defined by four vertices, establish which edges of this face have been split, and if so optionally return the mid points of those edges.
 
bool TriFaceSplit (int n1, int n2, int n3, int mid[3]=NULL) const
 Given a tri face defined by three vertices, establish whether the edges that make up this face have been split, and if so optionally return the midpoints.
 
bool TriFaceIsMaster (int n1, int n2, int n3) const
 Determine if a Triangle face is a master face.
 
bool QuadFaceIsMaster (int n1, int n2, int n3, int n4) const
 Determine if a Quad face is a master face.
 
void ForceRefinement (int vn1, int vn2, int vn3, int vn4)
 
void FindEdgeElements (int vn1, int vn2, int vn3, int vn4, Array< MeshId > &prisms) const
 
void CheckAnisoPrism (int vn1, int vn2, int vn3, int vn4, const Refinement *refs, int nref)
 
void CheckAnisoFace (int vn1, int vn2, int vn3, int vn4, int mid12, int mid34, int level=0)
 
void CheckIsoFace (int vn1, int vn2, int vn3, int vn4, int en1, int en2, int en3, int en4, int midf)
 
void ReparentNode (int node, int new_p1, int new_p2, real_t scale)
 
int FindMidEdgeNode (int node1, int node2) const
 
int GetMidEdgeNode (int node1, int node2)
 
int GetMidFaceNode (int en1, int en2, int en3, int en4)
 
void ReferenceElement (int elem)
 Add references to all nodes, edges and faces of the element.
 
void UnreferenceElement (int elem, Array< int > &elemFaces)
 
FaceGetFace (Element &elem, int face_no)
 
void RegisterFaces (int elem, int *fattr=NULL)
 
void DeleteUnusedFaces (const Array< int > &elemFaces)
 
void CollectDerefinements (int elem, Array< Connection > &list)
 
int RetrieveNode (const Element &el, int index)
 Return el.node[index] correctly, even if the element is refined.
 
int FindNodeExt (const Element &el, int node, bool abort=true)
 Extended version of find_node: works if 'el' is refined.
 
int ReorderFacePointMat (int v0, int v1, int v2, int v3, int elem, const PointMatrix &pm, PointMatrix &reordered) const
 
void TraverseQuadFace (int vn0, int vn1, int vn2, int vn3, const PointMatrix &pm, int level, Face *eface[4], MatrixMap &matrix_map)
 
TriFaceTraverseResults TraverseTriFace (int vn0, int vn1, int vn2, const PointMatrix &pm, int level, MatrixMap &matrix_map)
 
void TraverseTetEdge (int vn0, int vn1, const Point &p0, const Point &p1, MatrixMap &matrix_map)
 
void TraverseEdge (int vn0, int vn1, real_t t0, real_t t1, int flags, int level, MatrixMap &matrix_map)
 
virtual void BuildFaceList ()
 
virtual void BuildEdgeList ()
 
virtual void BuildVertexList ()
 
virtual void ElementSharesFace (int elem, int local, int face)
 
virtual void ElementSharesEdge (int elem, int local, int enode)
 
virtual void ElementSharesVertex (int elem, int local, int vnode)
 
void FindSetNeighbors (const Array< char > &elem_set, Array< int > *neighbors, Array< char > *neighbor_set=NULL)
 
void FindNeighbors (int elem, Array< int > &neighbors, const Array< int > *search_set=NULL)
 
void NeighborExpand (const Array< int > &elems, Array< int > &expanded, const Array< int > *search_set=NULL)
 
void CollectEdgeVertices (int v0, int v1, Array< int > &indices)
 
void CollectTriFaceVertices (int v0, int v1, int v2, Array< int > &indices)
 
void CollectQuadFaceVertices (int v0, int v1, int v2, int v3, Array< int > &indices)
 
void BuildElementToVertexTable ()
 
void UpdateElementToVertexTable ()
 
int GetVertexRootCoord (int elem, RefCoord coord[3]) const
 
void CollectIncidentElements (int elem, const RefCoord coord[3], Array< int > &list) const
 
void FindVertexCousins (int elem, int local, Array< int > &cousins) const
 
void GetPointMatrix (Geometry::Type geom, const char *ref_path, DenseMatrix &matrix) const
 
void TraverseRefinements (int elem, int coarse_index, std::string &ref_path, RefPathMap &map) const
 
void InitDerefTransforms ()
 
void SetDerefMatrixCodes (int parent, Array< int > &fine_coarse)
 
const real_tCalcVertexPos (int node) const
 
int GetEdgeMaster (int node) const
 
real_t GetScale (real_t s, bool reverse) const
 Return directed scale in (0,1).
 
int EdgeSplitLevel (int vn1, int vn2) const
 Return the number of splits of this edge that have occurred in the NCMesh. If zero, this means the segment is not the master of any other segments.
 
int TriFaceSplitLevel (int vn1, int vn2, int vn3) const
 Return the number of splits of this triangle that have occurred in the NCMesh. If zero, this means the triangle is neither split, nor the master of a split face.
 
void QuadFaceSplitLevel (int vn1, int vn2, int vn3, int vn4, int &h_level, int &v_level) const
 Computes the number of horizontal and vertical splits of this quad that have occurred in the NCMesh. If zero, this means the quad is not the master of any other quad.
 
int QuadFaceSplitLevel (int vn1, int vn2, int vn3, int vn4) const
 Returns the total number of splits of this quad that have occurred in the NCMesh. If zero, this means the quad is not the master of any other quad.
 
void CountSplits (int elem, int splits[3]) const
 
void GetLimitRefinements (Array< Refinement > &refinements, int max_level)
 
int PrintVertexParents (std::ostream *out) const
 Print the "vertex_parents" section of the mesh file.
 
void LoadVertexParents (std::istream &input)
 Load the vertex parent hierarchy from a mesh file.
 
int PrintBoundary (std::ostream *out) const
 
void LoadBoundary (std::istream &input)
 Load the "boundary" section of the mesh file.
 
void PrintCoordinates (std::ostream &out) const
 Print the "coordinates" section of the mesh file.
 
void LoadCoordinates (std::istream &input)
 Load the "coordinates" section of the mesh file.
 
void InitRootElements ()
 Count root elements and initialize root_state.
 
int CountTopLevelNodes () const
 Return the index of the last top-level node plus one.
 
bool ZeroRootStates () const
 Return true if all root_states are zero.
 
void LoadCoarseElements (std::istream &input)
 Load the element refinement hierarchy from a legacy mesh file.
 
void CopyElements (int elem, const BlockArray< Element > &tmp_elements)
 
void LoadLegacyFormat (std::istream &input, int &curved, int &is_nc)
 Load the deprecated MFEM mesh v1.1 format for backward compatibility.
 
- Static Protected Member Functions inherited from mfem::NCMesh
static int find_node (const Element &el, int node)
 
static int find_element_edge (const Element &el, int vn0, int vn1, bool abort=true)
 
static int find_local_face (int geom, int a, int b, int c)
 
static const PointMatrixGetGeomIdentity (Geometry::Type geom)
 
static void CheckSupportedGeom (Geometry::Type geom)
 
- Protected Attributes inherited from mfem::NCMesh
int Dim
 
int spaceDim
 dimensions of the elements and the vertex coordinates
 
int MyRank
 used in parallel, or when loading a parallel file in serial
 
bool Iso
 true if the mesh only contains isotropic refinements
 
int Geoms
 bit mask of element geometries present, see InitGeomFlags()
 
bool Legacy
 true if the mesh was loaded from the legacy v1.1 format
 
HashTable< Nodenodes
 
HashTable< Facefaces
 
bool using_scaling = false
 
BlockArray< Elementelements
 
Array< int > free_element_ids
 
Array< int > root_state
 
Array< real_tcoordinates
 
int NElements
 
int NVertices
 
int NEdges
 
int NFaces
 
int NGhostElements
 
int NGhostVertices
 
int NGhostEdges
 
int NGhostFaces
 
Array< int > leaf_elements
 finest elements, in Mesh ordering (+ ghosts)
 
Array< int > leaf_sfc_index
 natural tree ordering of leaf elements
 
Array< int > vertex_nodeId
 vertex-index to node-id map, see UpdateVertices
 
NCList face_list
 lazy-initialized list of faces, see GetFaceList
 
NCList edge_list
 lazy-initialized list of edges, see GetEdgeList
 
NCList vertex_list
 lazy-initialized list of vertices, see GetVertexList
 
Array< int > boundary_faces
 subset of all faces, set by BuildFaceList
 
Array< char > face_geom
 face geometry by face index, set by OnMeshUpdated
 
Table element_vertex
 leaf-element to vertex table, see FindSetNeighbors
 
Array< Refinementref_stack
 stack of scheduled refinements (temporary)
 
HashTable< Nodeshadow
 temporary storage for reparented nodes
 
Array< Triple< int, int, int > > reparents
 scheduled node reparents (tmp)
 
Array< real_treparent_scale
 scale associated with reparents (tmp)
 
Table derefinements
 possible derefinements, see GetDerefinementTable
 
CoarseFineTransformations transforms
 storage for data returned by Get[De]RefinementTransforms()
 
Array< int > coarse_elements
 state of leaf_elements before Refine(), set by MarkCoarseLevel()
 
TmpVertextmp_vertex
 
- Static Protected Attributes inherited from mfem::NCMesh
static PointMatrix pm_seg_identity
 
static PointMatrix pm_tri_identity
 
static PointMatrix pm_quad_identity
 
static PointMatrix pm_tet_identity
 
static PointMatrix pm_prism_identity
 
static PointMatrix pm_pyramid_identity
 
static PointMatrix pm_hex_identity
 
static GeomInfo GI [Geometry::NumGeom]
 

Detailed Description

Class representing a Nonconformal SubMesh. This is only used by SubMesh.

Definition at line 27 of file ncsubmesh.hpp.

Member Typedef Documentation

◆ From

Convenience type alias

Definition at line 31 of file ncsubmesh.hpp.

Member Function Documentation

◆ GetParent()

const NCMesh * mfem::NCSubMesh::GetParent ( ) const
inline

Get the parent NCMesh object.

Definition at line 33 of file ncsubmesh.hpp.

◆ IsNCSubMesh()

static bool mfem::NCSubMesh::IsNCSubMesh ( const NCMesh * m)
inlinestatic

Check if NCMesh m is a NCSubMesh.

Parameters
mThe input NCMesh

Definition at line 43 of file ncsubmesh.hpp.

Friends And Related Symbol Documentation

◆ SubMesh

friend class SubMesh
friend

Only SubMesh can use methods in this class.

Definition at line 29 of file ncsubmesh.hpp.

◆ SubMeshUtils::ConstructFaceTree

void SubMeshUtils::ConstructFaceTree ( NCSubMesh & submesh,
const Array< int > & attributes )
friend

◆ SubMeshUtils::ConstructVolumeTree

void SubMeshUtils::ConstructVolumeTree ( NCSubMesh & submesh,
const Array< int > & attributes )
friend

The documentation for this class was generated from the following files: