18 #include "../config/config.hpp"
19 #include "../general/hash.hpp"
20 #include "../linalg/densemat.hpp"
23 #include "../fem/geom.hpp"
73 NCMesh(
const Mesh *mesh, std::istream *vertex_parents = NULL);
256 if (!ret) {
delete this; }
270 {
pos[0] = x,
pos[1] = y, pos[2] = z; }
271 Vertex(
const Vertex& other) { std::memcpy(
this, &other,
sizeof(*
this)); }
281 Edge(
const Edge &other) { std::memcpy(
this, &other,
sizeof(*
this)); }
422 int fattr0,
int fattr1,
int fattr2,
423 int fattr3,
int fattr4,
int fattr5);
427 int eattr0,
int eattr1,
int eattr2,
int eattr3);
430 int attr,
int eattr0,
int eattr1,
int eattr2);
439 Node* mid[4] = NULL )
const;
444 Node* mid12,
Node* mid34,
int level = 0);
537 for (
int i = 0; i <
dim; i++)
547 for (
int i = 0; i <
dim; i++)
557 for (
int i = 0; i <
dim; i++)
606 int& h_level,
int& v_level)
const;
614 void CountObjects(
int &nelem,
int &nvert,
int &nedges)
const;
NCList face_list
lazy-initialized list of faces, see GetFaceList
NCList edge_list
lazy-initialized list of edges, see GetEdgeList
NCMesh(const Mesh *mesh, std::istream *vertex_parents=NULL)
virtual void LimitNCLevel(int max_level)
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)
void FindNeighbors(const Element *elem, Array< Element * > &neighbors, const Array< Element * > *search_set=NULL)
char ref_type
refinement XYZ bit mask (7 = full isotropic)
int index
edge number in the Mesh
Array< Element * > coarse_elements
state of leaf_elements before Refine(), set by MarkCoarseLevel()
int PrintElements(std::ostream &out, Element *elem, int &coarse_id) const
PointMatrix(const Point &p0, const Point &p1, const Point &p2)
FineTransform * GetFineTransforms()
Point(const Point &p0, const Point &p1)
void PrintVertexParents(std::ostream &out) const
I/O: Print the "vertex_parents" section of the mesh file (ver. >= 1.1).
Node * PeekAltParents(Node *v1, Node *v2)
void PrintMemoryDetail() const
int index
element number in the Mesh, -1 if refined
PointMatrix(const Point &p0, const Point &p1, const Point &p2, const Point &p3)
virtual int GetNumGhosts() const
PointMatrix(const Point &p0, const Point &p1, const Point &p2, const Point &p3, const Point &p4, const Point &p5, const Point &p6, const Point &p7)
Lists all edges/faces in the nonconforming mesh.
int attribute
boundary element attribute, -1 if internal edge (2D)
Data type dense matrix using column-major storage.
void RefElementNodes(Element *elem)
char geom
Geometry::Type of the element.
static int find_node(Element *elem, Node *node)
int FaceSplitType(Node *v1, Node *v2, Node *v3, Node *v4, Node *mid[4]=NULL) const
virtual void ElementSharesFace(Element *elem, Face *face)
int index
vertex number in the Mesh
MeshId(int index=-1, Element *element=NULL, int local=-1)
void CountObjects(int &nelem, int &nvert, int &nedges) const
const Point & operator()(int i) const
std::vector< MeshId > conforming
Point & operator()(int i)
Element * parent
parent element, NULL if this is a root element
Vertex * NewVertex(Node *v1, Node *v2)
bool NodeSetY1(Node *node, Node **n)
void ClearCoarseLevel()
Free the internally stored array of coarse leaf elements.
int spaceDim
dimensions of the elements and the vertex coordinates
Array< int > vertex_nodeId
int attribute
boundary element attribute, -1 if internal face
int index
Mesh element number.
int master
master number (in Mesh numbering)
Element * element
NCMesh::Element containing this vertex/edge/face.
const NCList & GetFaceList()
Return the current list of conforming and nonconforming faces.
virtual void OnMeshUpdated(Mesh *mesh)
A parallel extension of the NCMesh class.
Element * NewQuadrilateral(Node *n0, Node *n1, Node *n2, Node *n3, int attr, int eattr0, int eattr1, int eattr2, int eattr3)
void DebugNeighbors(Array< char > &elem_set)
void CollectEdgeVertices(Node *v0, Node *v1, Array< int > &indices)
virtual bool IsGhost(const Element *elem) const
Point(const Point &p0, const Point &p1, const Point &p2, const Point &p3)
Vertex(double x, double y, double z)
int num_vertices
width of the table
Refinement(int index, int type=7)
int index
face number in the Mesh
Table element_vertex
leaf-element to vertex table, see FindSetNeighbors
int local
local number within 'element'
Element * elem[2]
up to 2 elements sharing the face
void GetMatrix(DenseMatrix &point_matrix) const
void CheckAnisoFace(Node *v1, Node *v2, Node *v3, Node *v4, Node *mid12, Node *mid34, int level=0)
void RegisterFaces(Element *elem, int *fattr=NULL)
std::vector< Master > masters
virtual void UpdateVertices()
update Vertex::index and vertex_nodeId
void RegisterElement(Element *e)
Element * CopyHierarchy(Element *elem)
void ReorderFacePointMat(Node *v0, Node *v1, Node *v2, Node *v3, Element *elem, DenseMatrix &mat) const
void RefineElement(Element *elem, char ref_type)
void FaceSplitLevel(Node *v1, Node *v2, Node *v3, Node *v4, int &h_level, int &v_level) const
Element(int geom, int attr)
virtual void BuildEdgeList()
void LoadCoarseElements(std::istream &input)
I/O: Load the element refinement hierarchy from a mesh file.
Identifies a vertex/edge/face in both Mesh and NCMesh.
void CollectLeafElements(Element *elem)
virtual void ElementSharesEdge(Element *elem, Edge *edge)
int Size() const
Returns the number of TYPE I elements.
A class for non-conforming AMR on higher-order hexahedral, quadrilateral or triangular meshes...
bool NodeSetX1(Node *node, Node **n)
virtual void GetBoundaryClosure(const Array< int > &bdr_attr_is_ess, Array< int > &bdr_vertices, Array< int > &bdr_edges)
static GeomInfo GI[Geometry::NumGeom]
void DeleteHierarchy(Element *elem)
int slaves_end
slave faces
void TraverseEdge(Node *v0, Node *v1, double t0, double t1, int level)
bool Iso
true if the mesh only contains isotropic refinements
Point(double x, double y, double z)
double * Data() const
Returns vector of the elements.
void DerefineElement(Element *elem)
Array< Node * > boundary_edges
subset of all edges, set by BuildEdgeList
void UnrefEdge(HashTable< Node > &nodes)
void FindSetNeighbors(const Array< char > &elem_set, Array< Element * > *neighbors, Array< char > *neighbor_set=NULL)
int SpaceDimension() const
std::vector< Slave > slaves
virtual void BuildFaceList()
void ForceRefinement(Node *v1, Node *v2, Node *v3, Node *v4)
void SetVertexPositions(const Array< mfem::Vertex > &vertices)
I/O: Set positions of all vertices (used by mesh loader).
Element * child[8]
2-8 children (if ref_type != 0)
Array< Element * > leaf_elements
void UpdateLeafElements()
Vertex(const Vertex &other)
bool NodeSetZ1(Node *node, Node **n)
Node * GetMidEdgeVertexSimple(Node *v1, Node *v2)
void BuildElementToVertexTable()
void UnrefElementNodes(Element *elem)
Master(int index, Element *element, int local, int sb, int se)
void CheckIsoFace(Node *v1, Node *v2, Node *v3, Node *v4, Node *e1, Node *e2, Node *e3, Node *e4, Node *midf)
Node * GetMidFaceVertex(Node *e1, Node *e2, Node *e3, Node *e4)
Element(const Element &other)
void CollectFaceVertices(Node *v0, Node *v1, Node *v2, Node *v3, Array< int > &indices)
bool NodeSetZ2(Node *node, Node **n)
void Initialize(const mfem::Element *elem)
bool NodeSetX2(Node *node, Node **n)
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.
Node * node[8]
element corners (if ref_type == 0)
Element * NewTriangle(Node *n0, Node *n1, Node *n2, int attr, int eattr0, int eattr1, int eattr2)
Point(double x, double y)
virtual void AssignLeafIndices()
static int find_hex_face(int a, int b, int c)
Array< ElemRefType > ref_stack
stack of scheduled refinements (temporary)
static void find_face_nodes(const Face *face, Node *node[4])
Array< Element * > root_elements
long MemoryUsage() const
Return total number of bytes allocated.
Node * GetMidEdgeVertex(Node *v1, Node *v2)
int EdgeSplitLevel(Node *v1, Node *v2) const
Element * GetSingleElement() const
void PrintCoarseElements(std::ostream &out) const
I/O: Print the "coarse_elements" section of the mesh file (ver. >= 1.1).
const NCList & GetEdgeList()
Return the current list of conforming and nonconforming edges.
void TraverseFace(Node *v0, Node *v1, Node *v2, Node *v3, const PointMatrix &pm, int level)
void UpdateElementToVertexTable()
void CountSplits(Element *elem, int splits[3]) const
void ForgetElement(Element *e)
char ref_type
bit mask of X,Y,Z refinements (bits 0,1,2 respectively)
ElemRefType(Element *elem, int type)
bool NodeSetY2(Node *node, Node **n)
void LoadVertexParents(std::istream &input)
int CountElements(Element *elem) const
Abstract data type element.
Point & operator=(const Point &src)
Array< Face * > boundary_faces
subset of all faces, set by BuildFaceList
int rank
processor number (ParNCMesh)
DenseMatrix point_matrix
position within the master
virtual void Refine(const Array< Refinement > &refinements)
int GetEdgeMaster(int v1, int v2) const
void UnrefVertex(HashTable< Node > &nodes)