MFEM
v3.1
Finite element discretization library
|
A class for non-conforming AMR on higher-order hexahedral, quadrilateral or triangular meshes. More...
#include <ncmesh.hpp>
Classes | |
struct | Edge |
struct | Element |
struct | ElemRefType |
struct | Face |
struct | FineTransform |
struct | GeomInfo |
struct | Master |
struct | MeshId |
Identifies a vertex/edge/face in both Mesh and NCMesh. More... | |
struct | NCList |
Lists all edges/faces in the nonconforming mesh. More... | |
struct | Node |
struct | Point |
struct | PointMatrix |
struct | RefCount |
struct | Slave |
struct | Vertex |
Public Member Functions | |
NCMesh (const Mesh *mesh, std::istream *vertex_parents=NULL) | |
NCMesh (const NCMesh &other) | |
Deep copy of 'other'. More... | |
int | Dimension () const |
int | SpaceDimension () const |
virtual void | Refine (const Array< Refinement > &refinements) |
virtual void | LimitNCLevel (int max_level) |
const NCList & | GetFaceList () |
Return the current list of conforming and nonconforming faces. More... | |
const NCList & | GetEdgeList () |
Return the current list of conforming and nonconforming edges. More... | |
void | MarkCoarseLevel () |
void | ClearCoarseLevel () |
Free the internally stored array of coarse leaf elements. More... | |
FineTransform * | GetFineTransforms () |
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) |
void | PrintVertexParents (std::ostream &out) const |
I/O: Print the "vertex_parents" section of the mesh file (ver. >= 1.1). More... | |
void | PrintCoarseElements (std::ostream &out) const |
I/O: Print the "coarse_elements" section of the mesh file (ver. >= 1.1). More... | |
void | LoadVertexParents (std::istream &input) |
void | LoadCoarseElements (std::istream &input) |
I/O: Load the element refinement hierarchy from a mesh file. More... | |
void | SetVertexPositions (const Array< mfem::Vertex > &vertices) |
I/O: Set positions of all vertices (used by mesh loader). More... | |
long | MemoryUsage () const |
Return total number of bytes allocated. More... | |
void | PrintMemoryDetail () const |
virtual | ~NCMesh () |
void | DebugNeighbors (Array< char > &elem_set) |
Static Public Attributes | |
static GeomInfo | GI [Geometry::NumGeom] |
Protected Member Functions | |
void | GetMeshComponents (Array< mfem::Vertex > &vertices, Array< mfem::Element * > &elements, Array< mfem::Element * > &boundary) const |
Return the basic Mesh arrays for the current finest level. More... | |
virtual void | OnMeshUpdated (Mesh *mesh) |
Element * | CopyHierarchy (Element *elem) |
void | DeleteHierarchy (Element *elem) |
virtual void | Update () |
virtual void | UpdateVertices () |
update Vertex::index and vertex_nodeId More... | |
void | CollectLeafElements (Element *elem) |
void | UpdateLeafElements () |
virtual void | AssignLeafIndices () |
virtual bool | IsGhost (const Element *elem) const |
virtual int | GetNumGhosts () const |
void | RefineElement (Element *elem, char ref_type) |
void | DerefineElement (Element *elem) |
Element * | NewHexahedron (Node *n0, Node *n1, Node *n2, Node *n3, Node *n4, Node *n5, Node *n6, Node *n7, int attr, int fattr0, int fattr1, int fattr2, int fattr3, int fattr4, int fattr5) |
Element * | NewQuadrilateral (Node *n0, Node *n1, Node *n2, Node *n3, int attr, int eattr0, int eattr1, int eattr2, int eattr3) |
Element * | NewTriangle (Node *n0, Node *n1, Node *n2, int attr, int eattr0, int eattr1, int eattr2) |
Vertex * | NewVertex (Node *v1, Node *v2) |
Node * | GetMidEdgeVertex (Node *v1, Node *v2) |
Node * | GetMidEdgeVertexSimple (Node *v1, Node *v2) |
Node * | GetMidFaceVertex (Node *e1, Node *e2, Node *e3, Node *e4) |
int | FaceSplitType (Node *v1, Node *v2, Node *v3, Node *v4, Node *mid[4]=NULL) const |
void | ForceRefinement (Node *v1, Node *v2, Node *v3, Node *v4) |
void | CheckAnisoFace (Node *v1, Node *v2, Node *v3, Node *v4, Node *mid12, Node *mid34, int level=0) |
void | CheckIsoFace (Node *v1, Node *v2, Node *v3, Node *v4, Node *e1, Node *e2, Node *e3, Node *e4, Node *midf) |
void | RefElementNodes (Element *elem) |
void | UnrefElementNodes (Element *elem) |
void | RegisterFaces (Element *elem, int *fattr=NULL) |
Node * | PeekAltParents (Node *v1, Node *v2) |
bool | NodeSetX1 (Node *node, Node **n) |
bool | NodeSetX2 (Node *node, Node **n) |
bool | NodeSetY1 (Node *node, Node **n) |
bool | NodeSetY2 (Node *node, Node **n) |
bool | NodeSetZ1 (Node *node, Node **n) |
bool | NodeSetZ2 (Node *node, Node **n) |
void | ReorderFacePointMat (Node *v0, Node *v1, Node *v2, Node *v3, Element *elem, DenseMatrix &mat) const |
void | TraverseFace (Node *v0, Node *v1, Node *v2, Node *v3, const PointMatrix &pm, int level) |
void | TraverseEdge (Node *v0, Node *v1, double t0, double t1, int level) |
virtual void | BuildFaceList () |
virtual void | BuildEdgeList () |
virtual void | ElementSharesEdge (Element *elem, Edge *edge) |
virtual void | ElementSharesFace (Element *elem, Face *face) |
void | FindSetNeighbors (const Array< char > &elem_set, Array< Element * > *neighbors, Array< char > *neighbor_set=NULL) |
void | FindNeighbors (const Element *elem, Array< Element * > &neighbors, const Array< Element * > *search_set=NULL) |
void | CollectEdgeVertices (Node *v0, Node *v1, Array< int > &indices) |
void | CollectFaceVertices (Node *v0, Node *v1, Node *v2, Node *v3, Array< int > &indices) |
void | BuildElementToVertexTable () |
void | UpdateElementToVertexTable () |
void | GetFineTransforms (Element *elem, int coarse_index, FineTransform *transforms, const PointMatrix &pm) |
Node * | GetEdgeMaster (Node *node) const |
int | EdgeSplitLevel (Node *v1, Node *v2) const |
void | FaceSplitLevel (Node *v1, Node *v2, Node *v3, Node *v4, int &h_level, int &v_level) const |
void | CountSplits (Element *elem, int splits[3]) const |
int | CountElements (Element *elem) const |
int | PrintElements (std::ostream &out, Element *elem, int &coarse_id) const |
void | CountObjects (int &nelem, int &nvert, int &nedges) const |
Static Protected Member Functions | |
static int | find_node (Element *elem, Node *node) |
static int | find_node (Element *elem, int node_id) |
static int | find_hex_face (int a, int b, int c) |
static void | find_face_nodes (const Face *face, Node *node[4]) |
Protected Attributes | |
int | Dim |
int | spaceDim |
dimensions of the elements and the vertex coordinates More... | |
bool | Iso |
true if the mesh only contains isotropic refinements More... | |
Array< Element * > | root_elements |
HashTable< Node > | nodes |
HashTable< Face > | faces |
Array< Element * > | leaf_elements |
Array< int > | vertex_nodeId |
NCList | face_list |
lazy-initialized list of faces, see GetFaceList More... | |
NCList | edge_list |
lazy-initialized list of edges, see GetEdgeList More... | |
Array< Face * > | boundary_faces |
subset of all faces, set by BuildFaceList More... | |
Array< Node * > | boundary_edges |
subset of all edges, set by BuildEdgeList More... | |
Table | element_vertex |
leaf-element to vertex table, see FindSetNeighbors More... | |
int | num_vertices |
width of the table More... | |
Array< ElemRefType > | ref_stack |
stack of scheduled refinements (temporary) More... | |
Array< Element * > | coarse_elements |
state of leaf_elements before Refine(), set by MarkCoarseLevel() More... | |
Friends | |
class | Mesh |
class | ParNCMesh |
A class for non-conforming AMR on higher-order hexahedral, quadrilateral or triangular meshes.
The class is used as follows:
Definition at line 63 of file ncmesh.hpp.
mfem::NCMesh::NCMesh | ( | const Mesh * | mesh, |
std::istream * | vertex_parents = NULL |
||
) |
Initialize with elements from 'mesh'. If an already nonconforming mesh is being loaded, 'vertex_parents' must point to a stream at the appropriate section of the mesh file which contains the vertex hierarchy.
Definition at line 55 of file ncmesh.cpp.
mfem::NCMesh::NCMesh | ( | const NCMesh & | other | ) |
Deep copy of 'other'.
Definition at line 227 of file ncmesh.cpp.
|
virtual |
Definition at line 241 of file ncmesh.cpp.
|
protectedvirtual |
Reimplemented in mfem::ParNCMesh.
Definition at line 1335 of file ncmesh.cpp.
|
protectedvirtual |
Reimplemented in mfem::ParNCMesh.
Definition at line 1693 of file ncmesh.cpp.
|
protected |
Definition at line 1807 of file ncmesh.cpp.
|
protectedvirtual |
Reimplemented in mfem::ParNCMesh.
Definition at line 1591 of file ncmesh.cpp.
|
protected |
Definition at line 654 of file ncmesh.cpp.
|
protected |
Definition at line 707 of file ncmesh.cpp.
|
inline |
Free the internally stored array of coarse leaf elements.
Definition at line 169 of file ncmesh.hpp.
Definition at line 1771 of file ncmesh.cpp.
|
protected |
Definition at line 1783 of file ncmesh.cpp.
|
protected |
Definition at line 1309 of file ncmesh.cpp.
|
protected |
Definition at line 185 of file ncmesh.cpp.
|
protected |
Definition at line 2741 of file ncmesh.cpp.
|
protected |
Definition at line 2769 of file ncmesh.cpp.
|
protected |
Definition at line 2483 of file ncmesh.cpp.
void mfem::NCMesh::DebugNeighbors | ( | Array< char > & | elem_set | ) |
Definition at line 1995 of file ncmesh.cpp.
|
protected |
Definition at line 211 of file ncmesh.cpp.
|
protected |
Definition at line 1179 of file ncmesh.cpp.
|
inline |
Definition at line 78 of file ncmesh.hpp.
Definition at line 2443 of file ncmesh.cpp.
Definition at line 481 of file ncmesh.hpp.
Definition at line 482 of file ncmesh.hpp.
|
protected |
Definition at line 2450 of file ncmesh.cpp.
|
protected |
Definition at line 1453 of file ncmesh.cpp.
Definition at line 2367 of file ncmesh.cpp.
|
staticprotected |
Definition at line 1497 of file ncmesh.cpp.
Definition at line 1479 of file ncmesh.cpp.
|
staticprotected |
Definition at line 1488 of file ncmesh.cpp.
|
protected |
Return all vertex-, edge- and face-neighbors of a single element. You can limit the number of elements being checked using 'search_set'. The complexity of the function is linear in the size of the search set.
Definition at line 1965 of file ncmesh.cpp.
|
protected |
Return all vertex-, edge- and face-neighbors of a set of elements. The neighbors are returned as a list (neighbors != NULL), as a set (neighbor_set != NULL), or both. The sizes of the set arrays must match that of leaf_elements. NOTE: the function is intended to be used for large sets of elements and its complexity is linear in the number of leaf elements in the mesh.
Definition at line 1881 of file ncmesh.cpp.
Definition at line 620 of file ncmesh.cpp.
|
virtual |
Get a list of vertices (2D/3D) and edges (3D) that coincide with boundary elements with the specified attributes (marked in 'bdr_attr_is_ess'). In 3D this function also reveals "hidden" boundary edges. In parallel it helps identifying boundary vertices/edges affected by non-local boundary elements.
Reimplemented in mfem::ParNCMesh.
Definition at line 2387 of file ncmesh.cpp.
|
inline |
Return the current list of conforming and nonconforming edges.
Definition at line 144 of file ncmesh.hpp.
int mfem::NCMesh::GetEdgeMaster | ( | int | v1, |
int | v2 | ||
) | const |
Given an edge (by its vertex indices v1 and v2) return the first (geometric) parent edge that exists in the Mesh or -1 if there is no such parent.
Definition at line 2358 of file ncmesh.cpp.
|
protected |
Definition at line 2332 of file ncmesh.cpp.
|
inline |
Return the current list of conforming and nonconforming faces.
Definition at line 137 of file ncmesh.hpp.
NCMesh::FineTransform * mfem::NCMesh::GetFineTransforms | ( | ) |
Return an array of structures 'FineTransform', one for each leaf element. This data can be used to transfer functions from a previous coarse level of the mesh (marked with 'MarkCoarseLevel') to a newly refined state of the mesh. NOTE: the caller needs to free the returned array.
Definition at line 2280 of file ncmesh.cpp.
|
protected |
Definition at line 2022 of file ncmesh.cpp.
|
protected |
Return the basic Mesh arrays for the current finest level.
Definition at line 1344 of file ncmesh.cpp.
|
protected |
Definition at line 565 of file ncmesh.cpp.
|
protected |
Definition at line 574 of file ncmesh.cpp.
|
protected |
Definition at line 583 of file ncmesh.cpp.
|
inlineprotectedvirtual |
Reimplemented in mfem::ParNCMesh.
Definition at line 400 of file ncmesh.hpp.
|
inlineprotectedvirtual |
Definition at line 399 of file ncmesh.hpp.
|
virtual |
Check the mesh and potentially refine some elements so that the maximum difference of refinement levels between adjacent elements is not greater than 'max_level'.
Reimplemented in mfem::ParNCMesh.
Definition at line 2530 of file ncmesh.cpp.
void mfem::NCMesh::LoadCoarseElements | ( | std::istream & | input | ) |
I/O: Load the element refinement hierarchy from a mesh file.
Definition at line 2677 of file ncmesh.cpp.
void mfem::NCMesh::LoadVertexParents | ( | std::istream & | input | ) |
I/O: Load the vertex parent hierarchy from a mesh file. NOTE: called indirectly through the constructor.
Definition at line 2596 of file ncmesh.cpp.
void mfem::NCMesh::MarkCoarseLevel | ( | ) |
Store the current layer of leaf elements before the mesh is refined. This is later used by 'GetFineTransforms' to determine the relations of the coarse and refined elements.
Definition at line 2268 of file ncmesh.cpp.
long mfem::NCMesh::MemoryUsage | ( | ) | const |
Return total number of bytes allocated.
Definition at line 2783 of file ncmesh.cpp.
|
protected |
Definition at line 472 of file ncmesh.cpp.
|
protected |
Definition at line 500 of file ncmesh.cpp.
|
protected |
Definition at line 527 of file ncmesh.cpp.
|
protected |
Definition at line 551 of file ncmesh.cpp.
Definition at line 601 of file ncmesh.cpp.
Definition at line 604 of file ncmesh.cpp.
Definition at line 607 of file ncmesh.cpp.
Definition at line 610 of file ncmesh.cpp.
Definition at line 613 of file ncmesh.cpp.
Definition at line 616 of file ncmesh.cpp.
|
protectedvirtual |
Get edge and face numbering from 'mesh' (i.e., set all Edge::index and Face::index) after a new mesh was created from us.
Reimplemented in mfem::ParNCMesh.
Definition at line 1426 of file ncmesh.cpp.
|
protected |
Definition at line 406 of file ncmesh.cpp.
void mfem::NCMesh::PrintCoarseElements | ( | std::ostream & | out | ) | const |
I/O: Print the "coarse_elements" section of the mesh file (ver. >= 1.1).
Definition at line 2659 of file ncmesh.cpp.
|
protected |
Definition at line 2630 of file ncmesh.cpp.
void mfem::NCMesh::PrintMemoryDetail | ( | ) | const |
Definition at line 2806 of file ncmesh.cpp.
void mfem::NCMesh::PrintVertexParents | ( | std::ostream & | out | ) | const |
I/O: Print the "vertex_parents" section of the mesh file (ver. >= 1.1).
Definition at line 2568 of file ncmesh.cpp.
|
protected |
Definition at line 293 of file ncmesh.cpp.
|
virtual |
Perform the given batch of refinements. Please note that in the presence of anisotropic splits additional refinements may be necessary to keep the mesh consistent. However, the function always performs at least the requested refinements.
Reimplemented in mfem::ParNCMesh.
Definition at line 1139 of file ncmesh.cpp.
|
protected |
Definition at line 725 of file ncmesh.cpp.
|
protected |
Definition at line 378 of file ncmesh.cpp.
|
protected |
Definition at line 1513 of file ncmesh.cpp.
void mfem::NCMesh::SetVertexPositions | ( | const Array< mfem::Vertex > & | vertices | ) |
I/O: Set positions of all vertices (used by mesh loader).
Definition at line 2616 of file ncmesh.cpp.
|
inline |
Definition at line 79 of file ncmesh.hpp.
Definition at line 1666 of file ncmesh.cpp.
|
protected |
Definition at line 1544 of file ncmesh.cpp.
|
protected |
Definition at line 322 of file ncmesh.cpp.
|
protectedvirtual |
Apart from the primary data structure, which is the element/node/face hierarchy, there is secondary data that is derived from the primary data and needs to be updated when the primary data changes. Update() takes care of that and needs to be called after refinement and derefinement. Secondary data includes: leaf_elements, vertex_nodeId, face_list, edge_list, and everything in ParNCMesh.
Reimplemented in mfem::ParNCMesh.
Definition at line 174 of file ncmesh.cpp.
|
inlineprotected |
Definition at line 509 of file ncmesh.hpp.
|
protected |
Definition at line 1324 of file ncmesh.cpp.
|
protectedvirtual |
update Vertex::index and vertex_nodeId
Reimplemented in mfem::ParNCMesh.
Definition at line 1291 of file ncmesh.cpp.
|
friend |
Definition at line 218 of file ncmesh.hpp.
|
friend |
Definition at line 639 of file ncmesh.hpp.
subset of all edges, set by BuildEdgeList
Definition at line 387 of file ncmesh.hpp.
subset of all faces, set by BuildFaceList
Definition at line 386 of file ncmesh.hpp.
state of leaf_elements before Refine(), set by MarkCoarseLevel()
Definition at line 592 of file ncmesh.hpp.
|
protected |
Definition at line 232 of file ncmesh.hpp.
|
protected |
lazy-initialized list of edges, see GetEdgeList
Definition at line 384 of file ncmesh.hpp.
|
protected |
leaf-element to vertex table, see FindSetNeighbors
Definition at line 389 of file ncmesh.hpp.
|
protected |
lazy-initialized list of faces, see GetFaceList
Definition at line 383 of file ncmesh.hpp.
Definition at line 366 of file ncmesh.hpp.
|
static |
Definition at line 632 of file ncmesh.hpp.
|
protected |
true if the mesh only contains isotropic refinements
Definition at line 233 of file ncmesh.hpp.
Definition at line 379 of file ncmesh.hpp.
Definition at line 365 of file ncmesh.hpp.
|
protected |
width of the table
Definition at line 390 of file ncmesh.hpp.
|
protected |
stack of scheduled refinements (temporary)
Definition at line 414 of file ncmesh.hpp.
Definition at line 363 of file ncmesh.hpp.
|
protected |
dimensions of the elements and the vertex coordinates
Definition at line 232 of file ncmesh.hpp.
|
protected |
Definition at line 381 of file ncmesh.hpp.