MFEM  v3.2
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Classes | Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
mfem::NCMesh Class Reference

A class for non-conforming AMR on higher-order hexahedral, quadrilateral or triangular meshes. More...

#include <ncmesh.hpp>

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

Classes

struct  Edge
 
struct  Element
 
struct  ElemRefType
 
struct  Face
 
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...
 
virtual ~NCMesh ()
 
int Dimension () const
 
int SpaceDimension () 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. More...
 
const NCListGetEdgeList ()
 Return the current list of conforming and nonconforming edges. More...
 
void MarkCoarseLevel ()
 
const CoarseFineTransformationsGetRefinementTransforms ()
 
const CoarseFineTransformationsGetDerefinementTransforms ()
 
void ClearTransforms ()
 Free all internal data created by the above three functions. More...
 
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)
 
int GetElementGeometry () const
 Return the type of elements in the mesh. More...
 
int GetElementDepth (int i) const
 Return the distance of leaf 'i' from the root. More...
 
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
 
void DebugNeighbors (Array< char > &elem_set)
 
void DebugLeafOrder () const
 Print the space-filling curve formed by the sequence of leaf elements. More...
 

Static Public Attributes

static GeomInfo GI [Geometry::NumGeom]
 

Protected Types

typedef std::map< std::string,
int > 
RefPathMap
 

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)
 
ElementCopyHierarchy (Element *elem)
 
void DeleteHierarchy (Element *elem)
 
virtual void Update ()
 
virtual void UpdateVertices ()
 update Vertex::index and vertex_nodeId More...
 
void CollectLeafElements (Element *elem, int state)
 
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)
 
ElementNewHexahedron (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)
 
ElementNewQuadrilateral (Node *n0, Node *n1, Node *n2, Node *n3, int attr, int eattr0, int eattr1, int eattr2, int eattr3)
 
ElementNewTriangle (Node *n0, Node *n1, Node *n2, int attr, int eattr0, int eattr1, int eattr2)
 
VertexNewVertex (Node *v1, Node *v2)
 
mfem::ElementNewMeshElement (int geom) const
 
NodeGetMidEdgeVertex (Node *v1, Node *v2)
 
NodeGetMidEdgeVertexSimple (Node *v1, Node *v2)
 
NodeGetMidFaceVertex (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)
 
FaceGetFace (Element *elem, int face_no)
 
void RegisterFaces (Element *elem, int *fattr=NULL)
 
NodePeekAltParents (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 CollectDerefinements (Element *elem, Array< Connection > &list)
 
int 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 flags, 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 NeighborExpand (const Array< Element * > &elements, Array< Element * > &expanded, 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 GetPointMatrix (int geom, const char *ref_path, DenseMatrix &matrix)
 
void TraverseRefinements (Element *elem, int coarse_index, std::string &ref_path, RefPathMap &map)
 
void InitDerefTransforms ()
 
void SetDerefMatrixCodes (Element *parent, Array< Element * > &coarse)
 
NodeGetEdgeMaster (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
 
void GetLimitRefinements (Array< Refinement > &refinements, int max_level)
 
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_element_edge (Element *elem, int v0, int v1)
 
static int find_hex_face (int a, int b, int c)
 
static const PointMatrixGetGeomIdentity (int geom)
 
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< Nodenodes
 
HashTable< Facefaces
 
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< ElemRefTyperef_stack
 stack of scheduled refinements (temporary) More...
 
Table derefinements
 possible derefinements, see GetDerefinementTable More...
 
CoarseFineTransformations transforms
 storage for data returned by Get[De]RefinementTransforms() More...
 
Array< Element * > coarse_elements
 state of leaf_elements before Refine(), set by MarkCoarseLevel() More...
 

Static Protected Attributes

static PointMatrix pm_tri_identity
 
static PointMatrix pm_quad_identity
 
static PointMatrix pm_hex_identity
 

Friends

class Mesh
 
class ParNCMesh
 

Detailed Description

A class for non-conforming AMR on higher-order hexahedral, quadrilateral or triangular meshes.

The class is used as follows:

  1. NCMesh is constructed from elements of an existing Mesh. The elements are copied and become roots of the refinement hierarchy.
  2. Some elements are refined with the Refine() method. Both isotropic and anisotropic refinements of quads/hexes are supported.
  3. A new Mesh is created from NCMesh containing the leaf elements. This new mesh may have non-conforming (hanging) edges and faces.
  4. FiniteElementSpace asks NCMesh for a list of conforming, master and slave edges/faces and creates the conforming interpolation matrix P.
  5. A continuous/conforming solution is obtained by solving P'*A*P x = P'*b.
  6. Repeat from step 2.

Definition at line 79 of file ncmesh.hpp.

Member Typedef Documentation

typedef std::map<std::string, int> mfem::NCMesh::RefPathMap
protected

Definition at line 662 of file ncmesh.hpp.

Constructor & Destructor Documentation

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 68 of file ncmesh.cpp.

mfem::NCMesh::NCMesh ( const NCMesh other)

Deep copy of 'other'.

Definition at line 240 of file ncmesh.cpp.

mfem::NCMesh::~NCMesh ( )
virtual

Definition at line 254 of file ncmesh.cpp.

Member Function Documentation

void mfem::NCMesh::AssignLeafIndices ( )
protectedvirtual

Reimplemented in mfem::ParNCMesh.

Definition at line 1574 of file ncmesh.cpp.

void mfem::NCMesh::BuildEdgeList ( )
protectedvirtual

Reimplemented in mfem::ParNCMesh.

Definition at line 1987 of file ncmesh.cpp.

void mfem::NCMesh::BuildElementToVertexTable ( )
protected

Definition at line 2119 of file ncmesh.cpp.

void mfem::NCMesh::BuildFaceList ( )
protectedvirtual

Reimplemented in mfem::ParNCMesh.

Definition at line 1876 of file ncmesh.cpp.

void mfem::NCMesh::CheckAnisoFace ( Node v1,
Node v2,
Node v3,
Node v4,
Node mid12,
Node mid34,
int  level = 0 
)
protected

Definition at line 673 of file ncmesh.cpp.

void mfem::NCMesh::CheckDerefinementNCLevel ( const Table deref_table,
Array< int > &  level_ok,
int  max_nc_level 
)
virtual

Check derefinements returned by GetDerefinementTable and mark those that can be done safely so that the maximum NC level condition is not violated. On return, level_ok.Size() == deref_table.Size() and contains 0/1s.

Reimplemented in mfem::ParNCMesh.

Definition at line 1371 of file ncmesh.cpp.

void mfem::NCMesh::CheckIsoFace ( Node v1,
Node v2,
Node v3,
Node v4,
Node e1,
Node e2,
Node e3,
Node e4,
Node midf 
)
protected

Definition at line 739 of file ncmesh.cpp.

void mfem::NCMesh::ClearTransforms ( )

Free all internal data created by the above three functions.

Definition at line 2855 of file ncmesh.cpp.

void mfem::NCMesh::CollectDerefinements ( Element elem,
Array< Connection > &  list 
)
protected

Definition at line 1320 of file ncmesh.cpp.

void mfem::NCMesh::CollectEdgeVertices ( Node v0,
Node v1,
Array< int > &  indices 
)
protected

Definition at line 2083 of file ncmesh.cpp.

void mfem::NCMesh::CollectFaceVertices ( Node v0,
Node v1,
Node v2,
Node v3,
Array< int > &  indices 
)
protected

Definition at line 2095 of file ncmesh.cpp.

void mfem::NCMesh::CollectLeafElements ( Element elem,
int  state 
)
protected

Definition at line 1520 of file ncmesh.cpp.

NCMesh::Element * mfem::NCMesh::CopyHierarchy ( Element elem)
protected

Definition at line 198 of file ncmesh.cpp.

int mfem::NCMesh::CountElements ( Element elem) const
protected

Definition at line 3294 of file ncmesh.cpp.

void mfem::NCMesh::CountObjects ( int &  nelem,
int &  nvert,
int &  nedges 
) const
protected

Definition at line 3322 of file ncmesh.cpp.

void mfem::NCMesh::CountSplits ( Element elem,
int  splits[3] 
) const
protected

Definition at line 3028 of file ncmesh.cpp.

void mfem::NCMesh::DebugLeafOrder ( ) const

Print the space-filling curve formed by the sequence of leaf elements.

Definition at line 3385 of file ncmesh.cpp.

void mfem::NCMesh::DebugNeighbors ( Array< char > &  elem_set)

Definition at line 2385 of file ncmesh.cpp.

void mfem::NCMesh::DeleteHierarchy ( Element elem)
protected

Definition at line 224 of file ncmesh.cpp.

void mfem::NCMesh::Derefine ( const Array< int > &  derefs)
virtual

Perform a subset of the possible derefinements (see GetDerefinementTable). Note that if anisotropic refinements are present in the mesh, some of the derefinements may have to be skipped to preserve mesh consistency.

Reimplemented in mfem::ParNCMesh.

Definition at line 1400 of file ncmesh.cpp.

void mfem::NCMesh::DerefineElement ( Element elem)
protected

Definition at line 1211 of file ncmesh.cpp.

int mfem::NCMesh::Dimension ( ) const
inline

Definition at line 96 of file ncmesh.hpp.

int mfem::NCMesh::EdgeSplitLevel ( Node v1,
Node v2 
) const
protected

Definition at line 2988 of file ncmesh.cpp.

virtual void mfem::NCMesh::ElementSharesEdge ( Element elem,
Edge edge 
)
inlineprotectedvirtual

Reimplemented in mfem::ParNCMesh.

Definition at line 541 of file ncmesh.hpp.

virtual void mfem::NCMesh::ElementSharesFace ( Element elem,
Face face 
)
inlineprotectedvirtual

Reimplemented in mfem::ParNCMesh.

Definition at line 542 of file ncmesh.hpp.

void mfem::NCMesh::FaceSplitLevel ( Node v1,
Node v2,
Node v3,
Node v4,
int &  h_level,
int &  v_level 
) const
protected

Definition at line 2995 of file ncmesh.cpp.

int mfem::NCMesh::FaceSplitType ( Node v1,
Node v2,
Node v3,
Node v4,
Node mid[4] = NULL 
) const
protected

Definition at line 1717 of file ncmesh.cpp.

int mfem::NCMesh::find_element_edge ( Element elem,
int  v0,
int  v1 
)
staticprotected

Definition at line 1763 of file ncmesh.cpp.

void mfem::NCMesh::find_face_nodes ( const Face face,
Node node[4] 
)
staticprotected

Definition at line 2912 of file ncmesh.cpp.

int mfem::NCMesh::find_hex_face ( int  a,
int  b,
int  c 
)
staticprotected

Definition at line 1779 of file ncmesh.cpp.

int mfem::NCMesh::find_node ( Element elem,
Node node 
)
staticprotected

Definition at line 1745 of file ncmesh.cpp.

int mfem::NCMesh::find_node ( Element elem,
int  node_id 
)
staticprotected

Definition at line 1754 of file ncmesh.cpp.

void mfem::NCMesh::FindNeighbors ( const Element elem,
Array< Element * > &  neighbors,
const Array< Element * > *  search_set = NULL 
)
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 2280 of file ncmesh.cpp.

void mfem::NCMesh::FindSetNeighbors ( const Array< char > &  elem_set,
Array< Element * > *  neighbors,
Array< char > *  neighbor_set = NULL 
)
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. 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 2196 of file ncmesh.cpp.

void mfem::NCMesh::ForceRefinement ( Node v1,
Node v2,
Node v3,
Node v4 
)
protected

Definition at line 639 of file ncmesh.cpp.

void mfem::NCMesh::GetBoundaryClosure ( const Array< int > &  bdr_attr_is_ess,
Array< int > &  bdr_vertices,
Array< int > &  bdr_edges 
)
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 2932 of file ncmesh.cpp.

const Table & mfem::NCMesh::GetDerefinementTable ( )

Return a list of derefinement opportunities. Each row of the table contains Mesh indices of existing elements that can be derefined to form a single new coarse element. Row numbers are then passed to Derefine. This function works both in serial and parallel.

Definition at line 1356 of file ncmesh.cpp.

const CoarseFineTransformations & mfem::NCMesh::GetDerefinementTransforms ( )

After derefinement, calculate the relations of previous fine elements (some of which may no longer exist) to the current leaf elements. Unlike for refinement, Derefine() may only be called once before this function so there is no MarkFineLevel().

Definition at line 2812 of file ncmesh.cpp.

const NCList& mfem::NCMesh::GetEdgeList ( )
inline

Return the current list of conforming and nonconforming edges.

Definition at line 188 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 2891 of file ncmesh.cpp.

NCMesh::Node * mfem::NCMesh::GetEdgeMaster ( Node node) const
protected

Definition at line 2865 of file ncmesh.cpp.

int mfem::NCMesh::GetElementDepth ( int  i) const

Return the distance of leaf 'i' from the root.

Definition at line 2900 of file ncmesh.cpp.

int mfem::NCMesh::GetElementGeometry ( ) const
inline

Return the type of elements in the mesh.

Definition at line 233 of file ncmesh.hpp.

NCMesh::Face * mfem::NCMesh::GetFace ( Element elem,
int  face_no 
)
protected

Definition at line 391 of file ncmesh.cpp.

const NCList& mfem::NCMesh::GetFaceList ( )
inline

Return the current list of conforming and nonconforming faces.

Definition at line 181 of file ncmesh.hpp.

const NCMesh::PointMatrix & mfem::NCMesh::GetGeomIdentity ( int  geom)
staticprotected

Definition at line 2423 of file ncmesh.cpp.

void mfem::NCMesh::GetLimitRefinements ( Array< Refinement > &  refinements,
int  max_level 
)
protected

Definition at line 3075 of file ncmesh.cpp.

void mfem::NCMesh::GetMeshComponents ( Array< mfem::Vertex > &  vertices,
Array< mfem::Element * > &  elements,
Array< mfem::Element * > &  boundary 
) const
protected

Return the basic Mesh arrays for the current finest level.

Definition at line 1595 of file ncmesh.cpp.

NCMesh::Node * mfem::NCMesh::GetMidEdgeVertex ( Node v1,
Node v2 
)
protected

Definition at line 584 of file ncmesh.cpp.

NCMesh::Node * mfem::NCMesh::GetMidEdgeVertexSimple ( Node v1,
Node v2 
)
protected

Definition at line 593 of file ncmesh.cpp.

NCMesh::Node * mfem::NCMesh::GetMidFaceVertex ( Node e1,
Node e2,
Node e3,
Node e4 
)
protected

Definition at line 602 of file ncmesh.cpp.

virtual int mfem::NCMesh::GetNumGhosts ( ) const
inlineprotectedvirtual

Reimplemented in mfem::ParNCMesh.

Definition at line 451 of file ncmesh.hpp.

void mfem::NCMesh::GetPointMatrix ( int  geom,
const char *  ref_path,
DenseMatrix matrix 
)
protected

Definition at line 2435 of file ncmesh.cpp.

const CoarseFineTransformations & mfem::NCMesh::GetRefinementTransforms ( )

After refinement, calculate the relation of each fine element to its parent coarse element. Note that Refine() or LimitNCLevel() can be called multiple times between MarkCoarseLevel() and this function.

Definition at line 2775 of file ncmesh.cpp.

void mfem::NCMesh::InitDerefTransforms ( )
protected

Definition at line 1436 of file ncmesh.cpp.

virtual bool mfem::NCMesh::IsGhost ( const Element elem) const
inlineprotectedvirtual

Reimplemented in mfem::ParNCMesh.

Definition at line 450 of file ncmesh.hpp.

void mfem::NCMesh::LimitNCLevel ( int  max_nc_level)
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_nc_level'.

Reimplemented in mfem::ParNCMesh.

Definition at line 3105 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 3229 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 3148 of file ncmesh.cpp.

void mfem::NCMesh::MarkCoarseLevel ( )

Remember the current layer of leaf elements before the mesh is refined. Needed by GetRefinementTransforms(), must be called before Refine().

Definition at line 2732 of file ncmesh.cpp.

long mfem::NCMesh::MemoryUsage ( ) const

Return total number of bytes allocated.

Definition at line 3336 of file ncmesh.cpp.

void mfem::NCMesh::NeighborExpand ( const Array< Element * > &  elements,
Array< Element * > &  expanded,
const Array< Element * > *  search_set = NULL 
)
protected

Expand a set of elements by all vertex-, edge- and face-neighbors. The output array 'expanded' will contain all items from 'elements' (provided they are in 'search_set') plus their neighbors. The neighbor search can be limited to the optional search set. The complexity is linear in the sum of the sizes of 'elements' and 'search_set'.

Definition at line 2342 of file ncmesh.cpp.

NCMesh::Element * mfem::NCMesh::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 
)
protected

Definition at line 491 of file ncmesh.cpp.

mfem::Element * mfem::NCMesh::NewMeshElement ( int  geom) const
protected

Definition at line 1583 of file ncmesh.cpp.

NCMesh::Element * mfem::NCMesh::NewQuadrilateral ( Node n0,
Node n1,
Node n2,
Node n3,
int  attr,
int  eattr0,
int  eattr1,
int  eattr2,
int  eattr3 
)
protected

Definition at line 519 of file ncmesh.cpp.

NCMesh::Element * mfem::NCMesh::NewTriangle ( Node n0,
Node n1,
Node n2,
int  attr,
int  eattr0,
int  eattr1,
int  eattr2 
)
protected

Definition at line 546 of file ncmesh.cpp.

NCMesh::Vertex * mfem::NCMesh::NewVertex ( Node v1,
Node v2 
)
protected

Definition at line 570 of file ncmesh.cpp.

bool mfem::NCMesh::NodeSetX1 ( Node node,
Node **  n 
)
inlineprotected

Definition at line 620 of file ncmesh.cpp.

bool mfem::NCMesh::NodeSetX2 ( Node node,
Node **  n 
)
inlineprotected

Definition at line 623 of file ncmesh.cpp.

bool mfem::NCMesh::NodeSetY1 ( Node node,
Node **  n 
)
inlineprotected

Definition at line 626 of file ncmesh.cpp.

bool mfem::NCMesh::NodeSetY2 ( Node node,
Node **  n 
)
inlineprotected

Definition at line 629 of file ncmesh.cpp.

bool mfem::NCMesh::NodeSetZ1 ( Node node,
Node **  n 
)
inlineprotected

Definition at line 632 of file ncmesh.cpp.

bool mfem::NCMesh::NodeSetZ2 ( Node node,
Node **  n 
)
inlineprotected

Definition at line 635 of file ncmesh.cpp.

void mfem::NCMesh::OnMeshUpdated ( Mesh mesh)
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 1671 of file ncmesh.cpp.

NCMesh::Node * mfem::NCMesh::PeekAltParents ( Node v1,
Node v2 
)
protected

Definition at line 424 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 3211 of file ncmesh.cpp.

int mfem::NCMesh::PrintElements ( std::ostream &  out,
Element elem,
int &  coarse_id 
) const
protected

Definition at line 3182 of file ncmesh.cpp.

void mfem::NCMesh::PrintMemoryDetail ( ) const

Definition at line 3359 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 3120 of file ncmesh.cpp.

void mfem::NCMesh::RefElementNodes ( Element elem)
protected

Definition at line 306 of file ncmesh.cpp.

void mfem::NCMesh::Refine ( const Array< Refinement > &  refinements)
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 1169 of file ncmesh.cpp.

void mfem::NCMesh::RefineElement ( Element elem,
char  ref_type 
)
protected

Definition at line 756 of file ncmesh.cpp.

void mfem::NCMesh::RegisterFaces ( Element elem,
int *  fattr = NULL 
)
protected

Definition at line 399 of file ncmesh.cpp.

int mfem::NCMesh::ReorderFacePointMat ( Node v0,
Node v1,
Node v2,
Node v3,
Element elem,
DenseMatrix mat 
) const
protected

Definition at line 1795 of file ncmesh.cpp.

void mfem::NCMesh::SetDerefMatrixCodes ( Element parent,
Array< Element * > &  coarse 
)
protected

Definition at line 1451 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 3168 of file ncmesh.cpp.

int mfem::NCMesh::SpaceDimension ( ) const
inline

Definition at line 97 of file ncmesh.hpp.

void mfem::NCMesh::TraverseEdge ( Node v0,
Node v1,
double  t0,
double  t1,
int  flags,
int  level 
)
protected

Definition at line 1951 of file ncmesh.cpp.

void mfem::NCMesh::TraverseFace ( Node v0,
Node v1,
Node v2,
Node v3,
const PointMatrix pm,
int  level 
)
protected

Definition at line 1827 of file ncmesh.cpp.

void mfem::NCMesh::TraverseRefinements ( Element elem,
int  coarse_index,
std::string &  ref_path,
RefPathMap map 
)
protected

Definition at line 2746 of file ncmesh.cpp.

void mfem::NCMesh::UnrefElementNodes ( Element elem)
protected

Definition at line 335 of file ncmesh.cpp.

void mfem::NCMesh::Update ( )
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 187 of file ncmesh.cpp.

void mfem::NCMesh::UpdateElementToVertexTable ( )
inlineprotected

Definition at line 579 of file ncmesh.hpp.

void mfem::NCMesh::UpdateLeafElements ( )
protected

Definition at line 1560 of file ncmesh.cpp.

void mfem::NCMesh::UpdateVertices ( )
protectedvirtual

update Vertex::index and vertex_nodeId

Reimplemented in mfem::ParNCMesh.

Definition at line 1469 of file ncmesh.cpp.

Friends And Related Function Documentation

friend class Mesh
friend

Definition at line 262 of file ncmesh.hpp.

friend class ParNCMesh
friend

Definition at line 722 of file ncmesh.hpp.

Member Data Documentation

Array<Node*> mfem::NCMesh::boundary_edges
protected

subset of all edges, set by BuildEdgeList

Definition at line 438 of file ncmesh.hpp.

Array<Face*> mfem::NCMesh::boundary_faces
protected

subset of all faces, set by BuildFaceList

Definition at line 437 of file ncmesh.hpp.

Array<Element*> mfem::NCMesh::coarse_elements
protected

state of leaf_elements before Refine(), set by MarkCoarseLevel()

Definition at line 671 of file ncmesh.hpp.

Table mfem::NCMesh::derefinements
protected

possible derefinements, see GetDerefinementTable

Definition at line 467 of file ncmesh.hpp.

int mfem::NCMesh::Dim
protected

Definition at line 276 of file ncmesh.hpp.

NCList mfem::NCMesh::edge_list
protected

lazy-initialized list of edges, see GetEdgeList

Definition at line 435 of file ncmesh.hpp.

Table mfem::NCMesh::element_vertex
protected

leaf-element to vertex table, see FindSetNeighbors

Definition at line 440 of file ncmesh.hpp.

NCList mfem::NCMesh::face_list
protected

lazy-initialized list of faces, see GetFaceList

Definition at line 434 of file ncmesh.hpp.

HashTable<Face> mfem::NCMesh::faces
protected

Definition at line 417 of file ncmesh.hpp.

NCMesh::GeomInfo mfem::NCMesh::GI
static

Definition at line 712 of file ncmesh.hpp.

bool mfem::NCMesh::Iso
protected

true if the mesh only contains isotropic refinements

Definition at line 277 of file ncmesh.hpp.

Array<Element*> mfem::NCMesh::leaf_elements
protected

Definition at line 430 of file ncmesh.hpp.

HashTable<Node> mfem::NCMesh::nodes
protected

Definition at line 416 of file ncmesh.hpp.

int mfem::NCMesh::num_vertices
protected

width of the table

Definition at line 441 of file ncmesh.hpp.

NCMesh::PointMatrix mfem::NCMesh::pm_hex_identity
staticprotected

Definition at line 656 of file ncmesh.hpp.

NCMesh::PointMatrix mfem::NCMesh::pm_quad_identity
staticprotected

Definition at line 655 of file ncmesh.hpp.

NCMesh::PointMatrix mfem::NCMesh::pm_tri_identity
staticprotected

Definition at line 654 of file ncmesh.hpp.

Array<ElemRefType> mfem::NCMesh::ref_stack
protected

stack of scheduled refinements (temporary)

Definition at line 465 of file ncmesh.hpp.

Array<Element*> mfem::NCMesh::root_elements
protected

Definition at line 414 of file ncmesh.hpp.

int mfem::NCMesh::spaceDim
protected

dimensions of the elements and the vertex coordinates

Definition at line 276 of file ncmesh.hpp.

CoarseFineTransformations mfem::NCMesh::transforms
protected

storage for data returned by Get[De]RefinementTransforms()

Definition at line 668 of file ncmesh.hpp.

Array<int> mfem::NCMesh::vertex_nodeId
protected

Definition at line 432 of file ncmesh.hpp.


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