MFEM
v4.2.0
Finite element discretization library
|
#include <mesh.hpp>
Classes | |
struct | FaceInfo |
class | GeometryList |
List of mesh geometries stored as Array<Geometry::Type>. More... | |
struct | NCFaceInfo |
Public Types | |
enum | Operation { NONE, REFINE, DEREFINE, REBALANCE } |
typedef Geometry::Constants < Geometry::SEGMENT > | seg_t |
typedef Geometry::Constants < Geometry::TRIANGLE > | tri_t |
typedef Geometry::Constants < Geometry::SQUARE > | quad_t |
typedef Geometry::Constants < Geometry::TETRAHEDRON > | tet_t |
typedef Geometry::Constants < Geometry::CUBE > | hex_t |
typedef Geometry::Constants < Geometry::PRISM > | pri_t |
Public Member Functions | |
Mesh () | |
Mesh (const Mesh &mesh, bool copy_nodes=true) | |
Mesh (double *vertices, int num_vertices, int *element_indices, Geometry::Type element_type, int *element_attributes, int num_elements, int *boundary_indices, Geometry::Type boundary_type, int *boundary_attributes, int num_boundary_elements, int dimension, int space_dimension=-1) | |
Construct a Mesh from the given primary data. More... | |
Mesh (int _Dim, int NVert, int NElem, int NBdrElem=0, int _spaceDim=-1) | |
Init constructor: begin the construction of a Mesh object. More... | |
void | FinalizeTopology (bool generate_bdr=true) |
Finalize the construction of the secondary topology (connectivity) data of a Mesh. More... | |
virtual void | Finalize (bool refine=false, bool fix_orientation=false) |
Finalize the construction of a general Mesh. More... | |
virtual void | SetAttributes () |
double | GetGeckoElementOrdering (Array< int > &ordering, int iterations=4, int window=4, int period=2, int seed=0, bool verbose=false, double time_limit=0) |
void | GetHilbertElementOrdering (Array< int > &ordering) |
void | ReorderElements (const Array< int > &ordering, bool reorder_vertices=true) |
Mesh (int nx, int ny, int nz, Element::Type type, bool generate_edges=false, double sx=1.0, double sy=1.0, double sz=1.0, bool sfc_ordering=true) | |
Mesh (int nx, int ny, Element::Type type, bool generate_edges=false, double sx=1.0, double sy=1.0, bool sfc_ordering=true) | |
Mesh (int n, double sx=1.0) | |
Mesh (const char *filename, int generate_edges=0, int refine=1, bool fix_orientation=true) | |
Mesh (std::istream &input, int generate_edges=0, int refine=1, bool fix_orientation=true) | |
Mesh (Mesh *mesh_array[], int num_pieces) | |
Create a disjoint mesh from the given mesh array. More... | |
Mesh (Mesh *orig_mesh, int ref_factor, int ref_type) | |
Create a uniformly refined (by any factor) version of orig_mesh. More... | |
virtual void | Load (std::istream &input, int generate_edges=0, int refine=1, bool fix_orientation=true) |
void | Clear () |
Clear the contents of the Mesh. More... | |
int | MeshGenerator () |
Get the mesh generator/type. More... | |
int | GetNV () const |
Returns number of vertices. Vertices are only at the corners of elements, where you would expect them in the lowest-order mesh. More... | |
int | GetNE () const |
Returns number of elements. More... | |
int | GetNBE () const |
Returns number of boundary elements. More... | |
int | GetNEdges () const |
Return the number of edges. More... | |
int | GetNFaces () const |
Return the number of faces in a 3D mesh. More... | |
int | GetNumFaces () const |
Return the number of faces (3D), edges (2D) or vertices (1D). More... | |
int | GetNFbyType (FaceType type) const |
Returns the number of faces according to the requested type. More... | |
virtual long | ReduceInt (int value) const |
Utility function: sum integers from all processors (Allreduce). More... | |
long | GetGlobalNE () const |
Return the total (global) number of elements. More... | |
const GeometricFactors * | GetGeometricFactors (const IntegrationRule &ir, const int flags) |
Return the mesh geometric factors corresponding to the given integration rule. More... | |
const FaceGeometricFactors * | GetFaceGeometricFactors (const IntegrationRule &ir, const int flags, FaceType type) |
Return the mesh geometric factors for the faces corresponding to the given integration rule. More... | |
void | DeleteGeometricFactors () |
Destroy all GeometricFactors stored by the Mesh. More... | |
int | EulerNumber () const |
Equals 1 + num_holes - num_loops. More... | |
int | EulerNumber2D () const |
Equals 1 - num_holes. More... | |
int | Dimension () const |
int | SpaceDimension () const |
const double * | GetVertex (int i) const |
Return pointer to vertex i's coordinates. More... | |
double * | GetVertex (int i) |
Return pointer to vertex i's coordinates. More... | |
void | GetElementData (int geom, Array< int > &elem_vtx, Array< int > &attr) const |
void | GetBdrElementData (int geom, Array< int > &bdr_elem_vtx, Array< int > &bdr_attr) const |
void | ChangeVertexDataOwnership (double *vertices, int len_vertices, bool zerocopy=false) |
Set the internal Vertex array to point to the given vertices array without assuming ownership of the pointer. More... | |
const Element *const * | GetElementsArray () const |
const Element * | GetElement (int i) const |
Element * | GetElement (int i) |
const Element * | GetBdrElement (int i) const |
Element * | GetBdrElement (int i) |
const Element * | GetFace (int i) const |
Geometry::Type | GetFaceBaseGeometry (int i) const |
Geometry::Type | GetElementBaseGeometry (int i) const |
Geometry::Type | GetBdrElementBaseGeometry (int i) const |
bool | HasGeometry (Geometry::Type geom) const |
Return true iff the given geom is encountered in the mesh. Geometries of dimensions lower than Dimension() are counted as well. More... | |
int | GetNumGeometries (int dim) const |
Return the number of geometries of the given dimension present in the mesh. More... | |
void | GetGeometries (int dim, Array< Geometry::Type > &el_geoms) const |
Return all element geometries of the given dimension present in the mesh. More... | |
void | GetElementVertices (int i, Array< int > &v) const |
Returns the indices of the vertices of element i. More... | |
void | GetBdrElementVertices (int i, Array< int > &v) const |
Returns the indices of the vertices of boundary element i. More... | |
void | GetElementEdges (int i, Array< int > &edges, Array< int > &cor) const |
Return the indices and the orientations of all edges of element i. More... | |
void | GetBdrElementEdges (int i, Array< int > &edges, Array< int > &cor) const |
Return the indices and the orientations of all edges of bdr element i. More... | |
void | GetFaceEdges (int i, Array< int > &, Array< int > &) const |
void | GetFaceVertices (int i, Array< int > &vert) const |
Returns the indices of the vertices of face i. More... | |
void | GetEdgeVertices (int i, Array< int > &vert) const |
Returns the indices of the vertices of edge i. More... | |
Table * | GetFaceEdgeTable () const |
Returns the face-to-edge Table (3D) More... | |
Table * | GetEdgeVertexTable () const |
Returns the edge-to-vertex Table (3D) More... | |
void | GetElementFaces (int i, Array< int > &, Array< int > &) const |
Return the indices and the orientations of all faces of element i. More... | |
void | GetBdrElementFace (int i, int *, int *) const |
Return the index and the orientation of the face of bdr element i. (3D) More... | |
int | GetBdrElementEdgeIndex (int i) const |
void | GetBdrElementAdjacentElement (int bdr_el, int &el, int &info) const |
For the given boundary element, bdr_el, return its adjacent element and its info, i.e. 64*local_bdr_index+bdr_orientation. More... | |
Element::Type | GetElementType (int i) const |
Returns the type of element i. More... | |
Element::Type | GetBdrElementType (int i) const |
Returns the type of boundary element i. More... | |
void | GetPointMatrix (int i, DenseMatrix &pointmat) const |
void | GetBdrPointMatrix (int i, DenseMatrix &pointmat) const |
void | GetElementTransformation (int i, IsoparametricTransformation *ElTr) |
ElementTransformation * | GetElementTransformation (int i) |
Returns the transformation defining the i-th element. More... | |
void | GetElementTransformation (int i, const Vector &nodes, IsoparametricTransformation *ElTr) |
ElementTransformation * | GetBdrElementTransformation (int i) |
Returns the transformation defining the i-th boundary element. More... | |
void | GetBdrElementTransformation (int i, IsoparametricTransformation *ElTr) |
void | GetFaceTransformation (int i, IsoparametricTransformation *FTr) |
Returns the transformation defining the given face element in a user-defined variable. More... | |
void | GetLocalFaceTransformation (int face_type, int elem_type, IsoparametricTransformation &Transf, int info) |
A helper method that constructs a transformation from the reference space of a face to the reference space of an element. More... | |
ElementTransformation * | GetFaceTransformation (int FaceNo) |
Returns the transformation defining the given face element. More... | |
void | GetEdgeTransformation (int i, IsoparametricTransformation *EdTr) |
ElementTransformation * | GetEdgeTransformation (int EdgeNo) |
Returns the transformation defining the given face element. More... | |
FaceElementTransformations * | GetFaceElementTransformations (int FaceNo, int mask=31) |
FaceElementTransformations * | GetInteriorFaceTransformations (int FaceNo) |
FaceElementTransformations * | GetBdrFaceTransformations (int BdrElemNo) |
bool | FaceIsInterior (int FaceNo) const |
Return true if the given face is interior. More... | |
void | GetFaceElements (int Face, int *Elem1, int *Elem2) const |
void | GetFaceInfos (int Face, int *Inf1, int *Inf2) const |
Geometry::Type | GetFaceGeometryType (int Face) const |
Element::Type | GetFaceElementType (int Face) const |
int | CheckElementOrientation (bool fix_it=true) |
Check the orientation of the elements. More... | |
int | CheckBdrElementOrientation (bool fix_it=true) |
Check the orientation of the boundary elements. More... | |
int | GetAttribute (int i) const |
Return the attribute of element i. More... | |
void | SetAttribute (int i, int attr) |
Set the attribute of element i. More... | |
int | GetBdrAttribute (int i) const |
Return the attribute of boundary element i. More... | |
const Table & | ElementToElementTable () |
const Table & | ElementToFaceTable () const |
const Table & | ElementToEdgeTable () const |
Table * | GetVertexToElementTable () |
The returned Table must be destroyed by the caller. More... | |
Table * | GetFaceToElementTable () const |
virtual void | ReorientTetMesh () |
int * | CartesianPartitioning (int nxyz[]) |
int * | GeneratePartitioning (int nparts, int part_method=1) |
void | CheckPartitioning (int *partitioning) |
void | CheckDisplacements (const Vector &displacements, double &tmax) |
void | MoveVertices (const Vector &displacements) |
void | GetVertices (Vector &vert_coord) const |
void | SetVertices (const Vector &vert_coord) |
void | GetNode (int i, double *coord) const |
void | SetNode (int i, const double *coord) |
void | MoveNodes (const Vector &displacements) |
void | GetNodes (Vector &node_coord) const |
void | SetNodes (const Vector &node_coord) |
GridFunction * | GetNodes () |
Return a pointer to the internal node GridFunction (may be NULL). More... | |
const GridFunction * | GetNodes () const |
bool | OwnsNodes () const |
Return the mesh nodes ownership flag. More... | |
void | SetNodesOwner (bool nodes_owner) |
Set the mesh nodes ownership flag. More... | |
void | NewNodes (GridFunction &nodes, bool make_owner=false) |
Replace the internal node GridFunction with the given GridFunction. More... | |
void | SwapNodes (GridFunction *&nodes, int &own_nodes_) |
void | GetNodes (GridFunction &nodes) const |
Return the mesh nodes/vertices projected on the given GridFunction. More... | |
void | SetNodalFESpace (FiniteElementSpace *nfes) |
void | SetNodalGridFunction (GridFunction *nodes, bool make_owner=false) |
const FiniteElementSpace * | GetNodalFESpace () const |
void | EnsureNodes () |
virtual void | SetCurvature (int order, bool discont=false, int space_dim=-1, int ordering=1) |
void | UniformRefinement (int ref_algo=0) |
Refine all mesh elements. More... | |
void | GeneralRefinement (const Array< Refinement > &refinements, int nonconforming=-1, int nc_limit=0) |
void | GeneralRefinement (const Array< int > &el_to_refine, int nonconforming=-1, int nc_limit=0) |
void | RandomRefinement (double prob, bool aniso=false, int nonconforming=-1, int nc_limit=0) |
Refine each element with given probability. Uses GeneralRefinement. More... | |
void | RefineAtVertex (const Vertex &vert, double eps=0.0, int nonconforming=-1) |
Refine elements sharing the specified vertex. Uses GeneralRefinement. More... | |
bool | RefineByError (const Array< double > &elem_error, double threshold, int nonconforming=-1, int nc_limit=0) |
bool | RefineByError (const Vector &elem_error, double threshold, int nonconforming=-1, int nc_limit=0) |
bool | DerefineByError (Array< double > &elem_error, double threshold, int nc_limit=0, int op=1) |
bool | DerefineByError (const Vector &elem_error, double threshold, int nc_limit=0, int op=1) |
Same as DerefineByError for an error vector. More... | |
void | EnsureNCMesh (bool simplices_nonconforming=false) |
bool | Conforming () const |
bool | Nonconforming () const |
const CoarseFineTransformations & | GetRefinementTransforms () |
Operation | GetLastOperation () const |
Return type of last modification of the mesh. More... | |
long | GetSequence () const |
virtual void | PrintXG (std::ostream &out=mfem::out) const |
Print the mesh to the given stream using Netgen/Truegrid format. More... | |
virtual void | Print (std::ostream &out=mfem::out) const |
virtual void | Print (adios2stream &out) const |
Print the mesh to the given stream using the adios2 bp format. More... | |
void | PrintVTK (std::ostream &out) |
void | PrintVTK (std::ostream &out, int ref, int field_data=0) |
void | PrintVTU (std::ostream &out, int ref=1, VTKFormat format=VTKFormat::ASCII, bool high_order_output=false, int compression_level=0, bool bdr_elements=false) |
virtual void | PrintVTU (std::string fname, VTKFormat format=VTKFormat::ASCII, bool high_order_output=false, int compression_level=0, bool bdr=false) |
void | PrintBdrVTU (std::string fname, VTKFormat format=VTKFormat::ASCII, bool high_order_output=false, int compression_level=0) |
void | GetElementColoring (Array< int > &colors, int el0=0) |
void | PrintWithPartitioning (int *partitioning, std::ostream &out, int elem_attr=0) const |
Prints the mesh with boundary elements given by the boundary of the subdomains, so that the boundary of subdomain i has boundary attribute i+1. More... | |
void | PrintElementsWithPartitioning (int *partitioning, std::ostream &out, int interior_faces=0) |
void | PrintSurfaces (const Table &Aface_face, std::ostream &out) const |
Print set of disjoint surfaces: More... | |
void | ScaleSubdomains (double sf) |
void | ScaleElements (double sf) |
void | Transform (void(*f)(const Vector &, Vector &)) |
void | Transform (VectorCoefficient &deformation) |
void | RemoveUnusedVertices () |
Remove unused vertices and rebuild mesh connectivity. More... | |
void | RemoveInternalBoundaries () |
double | GetElementSize (int i, int type=0) |
Get the size of the i-th element relative to the perfect reference element. More... | |
double | GetElementSize (int i, const Vector &dir) |
double | GetElementVolume (int i) |
void | GetElementCenter (int i, Vector ¢er) |
void | GetBoundingBox (Vector &min, Vector &max, int ref=2) |
Returns the minimum and maximum corners of the mesh bounding box. More... | |
void | GetCharacteristics (double &h_min, double &h_max, double &kappa_min, double &kappa_max, Vector *Vh=NULL, Vector *Vk=NULL) |
void | PrintCharacteristics (Vector *Vh=NULL, Vector *Vk=NULL, std::ostream &out=mfem::out) |
Compute and print mesh characteristics such as number of vertices, number of elements, number of boundary elements, minimal and maximal element sizes, minimal and maximal element aspect ratios, etc. More... | |
virtual void | PrintInfo (std::ostream &out=mfem::out) |
In serial, this method calls PrintCharacteristics(). In parallel, additional information about the parallel decomposition is also printed. More... | |
void | MesquiteSmooth (const int mesquite_option=0) |
virtual int | FindPoints (DenseMatrix &point_mat, Array< int > &elem_ids, Array< IntegrationPoint > &ips, bool warn=true, InverseElementTransformation *inv_trans=NULL) |
Find the ids of the elements that contain the given points, and their corresponding reference coordinates. More... | |
virtual | ~Mesh () |
Destroys Mesh. More... | |
void | DebugDump (std::ostream &out) const |
Output an NCMesh-compatible debug dump. More... | |
Methods for Mesh construction. | |
These methods are intended to be used with the init constructor. | |
Element * | NewElement (int geom) |
int | AddVertex (double x, double y=0.0, double z=0.0) |
int | AddVertex (const double *coords) |
void | AddVertexParents (int i, int p1, int p2) |
Mark vertex i as non-conforming, with parent vertices p1 and p2. More... | |
int | AddSegment (int v1, int v2, int attr=1) |
int | AddSegment (const int *vi, int attr=1) |
int | AddTriangle (int v1, int v2, int v3, int attr=1) |
int | AddTriangle (const int *vi, int attr=1) |
int | AddTri (const int *vi, int attr=1) |
int | AddQuad (int v1, int v2, int v3, int v4, int attr=1) |
int | AddQuad (const int *vi, int attr=1) |
int | AddTet (int v1, int v2, int v3, int v4, int attr=1) |
int | AddTet (const int *vi, int attr=1) |
int | AddWedge (int v1, int v2, int v3, int v4, int v5, int v6, int attr=1) |
int | AddWedge (const int *vi, int attr=1) |
int | AddHex (int v1, int v2, int v3, int v4, int v5, int v6, int v7, int v8, int attr=1) |
int | AddHex (const int *vi, int attr=1) |
void | AddHexAsTets (const int *vi, int attr=1) |
void | AddHexAsWedges (const int *vi, int attr=1) |
int | AddElement (Element *elem) |
The parameter elem should be allocated using the NewElement() method. More... | |
int | AddBdrElement (Element *elem) |
int | AddBdrSegment (int v1, int v2, int attr=1) |
int | AddBdrSegment (const int *vi, int attr=1) |
int | AddBdrTriangle (int v1, int v2, int v3, int attr=1) |
int | AddBdrTriangle (const int *vi, int attr=1) |
int | AddBdrQuad (int v1, int v2, int v3, int v4, int attr=1) |
int | AddBdrQuad (const int *vi, int attr=1) |
void | AddBdrQuadAsTriangles (const int *vi, int attr=1) |
void | GenerateBoundaryElements () |
void | FinalizeTriMesh (int generate_edges=0, int refine=0, bool fix_orientation=true) |
Finalize the construction of a triangular Mesh. More... | |
void | FinalizeQuadMesh (int generate_edges=0, int refine=0, bool fix_orientation=true) |
Finalize the construction of a quadrilateral Mesh. More... | |
void | FinalizeTetMesh (int generate_edges=0, int refine=0, bool fix_orientation=true) |
Finalize the construction of a tetrahedral Mesh. More... | |
void | FinalizeWedgeMesh (int generate_edges=0, int refine=0, bool fix_orientation=true) |
Finalize the construction of a wedge Mesh. More... | |
void | FinalizeHexMesh (int generate_edges=0, int refine=0, bool fix_orientation=true) |
Finalize the construction of a hexahedral Mesh. More... | |
void | FinalizeMesh (int refine=0, bool fix_orientation=true) |
Finalize the construction of any type of Mesh. More... | |
NURBS mesh refinement methods | |
void | KnotInsert (Array< KnotVector * > &kv) |
void | KnotInsert (Array< Vector * > &kv) |
void | DegreeElevate (int rel_degree, int degree=16) |
Static Public Member Functions | |
static FiniteElement * | GetTransformationFEforElementType (Element::Type) |
static void | PrintElementsByGeometry (int dim, const Array< int > &num_elems_by_geom, std::ostream &out) |
Auxiliary method used by PrintCharacteristics(). More... | |
Public Attributes | |
Array< int > | attributes |
A list of all unique element attributes used by the Mesh. More... | |
Array< int > | bdr_attributes |
A list of all unique boundary attributes used by the Mesh. More... | |
NURBSExtension * | NURBSext |
Optional NURBS mesh extension. More... | |
NCMesh * | ncmesh |
Optional non-conforming mesh extension. More... | |
Array< GeometricFactors * > | geom_factors |
Optional geometric factors. More... | |
Array< FaceGeometricFactors * > | face_geom_factors |
Optional face geometric factors. More... | |
Array< Triple< int, int, int > > | tmp_vertex_parents |
Used during initialization only. More... | |
Static Public Attributes | |
static bool | remove_unused_vertices = true |
Protected Member Functions | |
void | Init () |
void | InitTables () |
void | SetEmpty () |
void | DestroyTables () |
void | DeleteTables () |
void | DestroyPointers () |
void | Destroy () |
void | ResetLazyData () |
Element * | ReadElementWithoutAttr (std::istream &) |
Element * | ReadElement (std::istream &) |
void | ReadMFEMMesh (std::istream &input, bool mfem_v11, int &curved) |
void | ReadLineMesh (std::istream &input) |
void | ReadNetgen2DMesh (std::istream &input, int &curved) |
void | ReadNetgen3DMesh (std::istream &input) |
void | ReadTrueGridMesh (std::istream &input) |
void | ReadVTKMesh (std::istream &input, int &curved, int &read_gf, bool &finalize_topo) |
void | ReadNURBSMesh (std::istream &input, int &curved, int &read_gf) |
void | ReadInlineMesh (std::istream &input, bool generate_edges=false) |
void | ReadGmshMesh (std::istream &input, int &curved, int &read_gf) |
void | ReadCubit (const char *filename, int &curved, int &read_gf) |
void | SetMeshGen () |
Determine the mesh generator bitmask meshgen, see MeshGenerator(). More... | |
double | GetLength (int i, int j) const |
Return the length of the segment from node i to node j. More... | |
void | GetElementJacobian (int i, DenseMatrix &J) |
void | MarkForRefinement () |
void | MarkTriMeshForRefinement () |
void | GetEdgeOrdering (DSTable &v_to_v, Array< int > &order) |
virtual void | MarkTetMeshForRefinement (DSTable &v_to_v) |
void | PrepareNodeReorder (DSTable **old_v_to_v, Table **old_elem_vert) |
void | DoNodeReorder (DSTable *old_v_to_v, Table *old_elem_vert) |
STable3D * | GetFacesTable () |
STable3D * | GetElementToFaceTable (int ret_ftbl=0) |
void | RedRefinement (int i, const DSTable &v_to_v, int *edge1, int *edge2, int *middle) |
void | GreenRefinement (int i, const DSTable &v_to_v, int *edge1, int *edge2, int *middle) |
void | Bisection (int i, const DSTable &, int *, int *, int *) |
Bisect a triangle: element with index i is bisected. More... | |
void | Bisection (int i, HashTable< Hashed2 > &) |
Bisect a tetrahedron: element with index i is bisected. More... | |
void | BdrBisection (int i, const HashTable< Hashed2 > &) |
Bisect a boundary triangle: boundary element with index i is bisected. More... | |
void | UniformRefinement (int i, const DSTable &, int *, int *, int *) |
void | AverageVertices (const int *indexes, int n, int result) |
Averages the vertices with given indexes and saves the result in vertices[result]. More... | |
void | InitRefinementTransforms () |
int | FindCoarseElement (int i) |
void | UpdateNodes () |
Update the nodes of a curved mesh after refinement. More... | |
void | UniformRefinement2D_base (bool update_nodes=true) |
virtual void | UniformRefinement2D () |
Refine a mixed 2D mesh uniformly. More... | |
void | UniformRefinement3D_base (Array< int > *f2qf=NULL, DSTable *v_to_v_p=NULL, bool update_nodes=true) |
virtual void | UniformRefinement3D () |
Refine a mixed 3D mesh uniformly. More... | |
virtual void | NURBSUniformRefinement () |
Refine NURBS mesh. More... | |
virtual void | LocalRefinement (const Array< int > &marked_el, int type=3) |
This function is not public anymore. Use GeneralRefinement instead. More... | |
virtual void | NonconformingRefinement (const Array< Refinement > &refinements, int nc_limit=0) |
This function is not public anymore. Use GeneralRefinement instead. More... | |
virtual bool | NonconformingDerefinement (Array< double > &elem_error, double threshold, int nc_limit=0, int op=1) |
NC version of GeneralDerefinement. More... | |
double | AggregateError (const Array< double > &elem_error, const int *fine, int nfine, int op) |
Derefinement helper. More... | |
void | LoadPatchTopo (std::istream &input, Array< int > &edge_to_knot) |
Read NURBS patch/macro-element mesh. More... | |
void | UpdateNURBS () |
void | PrintTopo (std::ostream &out, const Array< int > &e_to_k) const |
void | GetLocalPtToSegTransformation (IsoparametricTransformation &, int) |
Used in GetFaceElementTransformations (...) More... | |
void | GetLocalSegToTriTransformation (IsoparametricTransformation &loc, int i) |
void | GetLocalSegToQuadTransformation (IsoparametricTransformation &loc, int i) |
void | GetLocalTriToTetTransformation (IsoparametricTransformation &loc, int i) |
Used in GetFaceElementTransformations (...) More... | |
void | GetLocalTriToWdgTransformation (IsoparametricTransformation &loc, int i) |
Used in GetFaceElementTransformations (...) More... | |
void | GetLocalQuadToHexTransformation (IsoparametricTransformation &loc, int i) |
Used in GetFaceElementTransformations (...) More... | |
void | GetLocalQuadToWdgTransformation (IsoparametricTransformation &loc, int i) |
Used in GetFaceElementTransformations (...) More... | |
void | ApplyLocalSlaveTransformation (FaceElementTransformations &FT, const FaceInfo &fi, bool is_ghost) |
bool | IsSlaveFace (const FaceInfo &fi) const |
void | GetVertexToVertexTable (DSTable &) const |
int | GetElementToEdgeTable (Table &, Array< int > &) |
void | AddPointFaceElement (int lf, int gf, int el) |
Used in GenerateFaces() More... | |
void | AddSegmentFaceElement (int lf, int gf, int el, int v0, int v1) |
void | AddTriangleFaceElement (int lf, int gf, int el, int v0, int v1, int v2) |
void | AddQuadFaceElement (int lf, int gf, int el, int v0, int v1, int v2, int v3) |
bool | FaceIsTrueInterior (int FaceNo) const |
void | FreeElement (Element *E) |
void | GenerateFaces () |
void | GenerateNCFaceInfo () |
void | InitMesh (int _Dim, int _spaceDim, int NVert, int NElem, int NBdrElem) |
Begin construction of a mesh. More... | |
void | FinalizeCheck () |
void | Loader (std::istream &input, int generate_edges=0, std::string parse_tag="") |
void | Printer (std::ostream &out=mfem::out, std::string section_delimiter="") const |
void | Make3D (int nx, int ny, int nz, Element::Type type, double sx, double sy, double sz, bool sfc_ordering) |
void | Make2D (int nx, int ny, Element::Type type, double sx, double sy, bool generate_edges, bool sfc_ordering) |
void | Make1D (int n, double sx=1.0) |
Creates a 1D mesh for the interval [0,sx] divided into n equal intervals. More... | |
void | InitFromNCMesh (const NCMesh &ncmesh) |
Initialize vertices/elements/boundary/tables from a nonconforming mesh. More... | |
Mesh (const NCMesh &ncmesh) | |
Create from a nonconforming mesh. More... | |
void | Swap (Mesh &other, bool non_geometry) |
void | GetElementData (const Array< Element * > &elem_array, int geom, Array< int > &elem_vtx, Array< int > &attr) const |
Static Protected Member Functions | |
static void | PrintElementWithoutAttr (const Element *, std::ostream &) |
static void | PrintElement (const Element *, std::ostream &) |
static int | GetTriOrientation (const int *base, const int *test) |
Returns the orientation of "test" relative to "base". More... | |
static int | GetQuadOrientation (const int *base, const int *test) |
Returns the orientation of "test" relative to "base". More... | |
static int | GetTetOrientation (const int *base, const int *test) |
Returns the orientation of "test" relative to "base". More... | |
static void | GetElementArrayEdgeTable (const Array< Element * > &elem_array, const DSTable &v_to_v, Table &el_to_edge) |
Protected Attributes | |
int | Dim |
int | spaceDim |
int | NumOfVertices |
int | NumOfElements |
int | NumOfBdrElements |
int | NumOfEdges |
int | NumOfFaces |
int | nbInteriorFaces |
int | nbBoundaryFaces |
int | meshgen |
int | mesh_geoms |
long | sequence |
Array< Element * > | elements |
Array< Vertex > | vertices |
Array< Element * > | boundary |
Array< Element * > | faces |
Array< FaceInfo > | faces_info |
Array< NCFaceInfo > | nc_faces_info |
Table * | el_to_edge |
Table * | el_to_face |
Table * | el_to_el |
Array< int > | be_to_edge |
Table * | bel_to_edge |
Array< int > | be_to_face |
Table * | face_edge |
Table * | edge_vertex |
IsoparametricTransformation | Transformation |
IsoparametricTransformation | Transformation2 |
IsoparametricTransformation | BdrTransformation |
IsoparametricTransformation | FaceTransformation |
IsoparametricTransformation | EdgeTransformation |
FaceElementTransformations | FaceElemTr |
CoarseFineTransformations | CoarseFineTr |
GridFunction * | Nodes |
int | own_nodes |
MemAlloc< Tetrahedron, 1024 > | TetMemory |
Operation | last_operation |
Static Protected Attributes | |
static const int | vtk_quadratic_tet [10] |
static const int | vtk_quadratic_wedge [18] |
static const int | vtk_quadratic_hex [27] |
Friends | |
class | ParMesh |
class | ParNCMesh |
class | NCMesh |
class | NURBSExtension |
class | adios2stream |
class | Tetrahedron |
|
explicitprotected |
|
explicit |
mfem::Mesh::Mesh | ( | double * | vertices, |
int | num_vertices, | ||
int * | element_indices, | ||
Geometry::Type | element_type, | ||
int * | element_attributes, | ||
int | num_elements, | ||
int * | boundary_indices, | ||
Geometry::Type | boundary_type, | ||
int * | boundary_attributes, | ||
int | num_boundary_elements, | ||
int | dimension, | ||
int | space_dimension = -1 |
||
) |
Construct a Mesh from the given primary data.
The array vertices is used as external data, i.e. the Mesh does not copy the data and will not delete the pointer.
The data from the other arrays is copied into the internal Mesh data structures.
This method calls the method FinalizeTopology(). The method Finalize() may be called after this constructor and after optionally setting the Mesh nodes.
|
inline |
|
inline |
Creates mesh for the parallelepiped [0,sx]x[0,sy]x[0,sz], divided into nx*ny*nz hexahedra if type=HEXAHEDRON or into 6*nx*ny*nz tetrahedrons if type=TETRAHEDRON. If sfc_ordering = true (default), elements are ordered along a space-filling curve, instead of row by row and layer by layer. The parameter generate_edges is ignored (for now, it is kept for backward compatibility).
|
inline |
Creates mesh for the rectangle [0,sx]x[0,sy], divided into nx*ny quadrilaterals if type = QUADRILATERAL or into 2*nx*ny triangles if type = TRIANGLE. If generate_edges = 0 (default) edges are not generated, if 1 edges are generated. If scf_ordering = true (default), elements are ordered along a space-filling curve, instead of row by row.
|
inlineexplicit |
|
explicit |
|
explicit |
mfem::Mesh::Mesh | ( | Mesh * | mesh_array[], |
int | num_pieces | ||
) |
mfem::Mesh::Mesh | ( | Mesh * | orig_mesh, |
int | ref_factor, | ||
int | ref_type | ||
) |
Create a uniformly refined (by any factor) version of orig_mesh.
[in] | orig_mesh | The starting coarse mesh. |
[in] | ref_factor | The refinement factor, an integer > 1. |
[in] | ref_type | Specify the positions of the new vertices. The options are BasisType::ClosedUniform or BasisType::GaussLobatto. |
The refinement data which can be accessed with GetRefinementTransforms() is set to reflect the performed refinements.
|
inlinevirtual |
int mfem::Mesh::AddBdrQuad | ( | int | v1, |
int | v2, | ||
int | v3, | ||
int | v4, | ||
int | attr = 1 |
||
) |
int mfem::Mesh::AddBdrQuad | ( | const int * | vi, |
int | attr = 1 |
||
) |
void mfem::Mesh::AddBdrQuadAsTriangles | ( | const int * | vi, |
int | attr = 1 |
||
) |
int mfem::Mesh::AddBdrSegment | ( | int | v1, |
int | v2, | ||
int | attr = 1 |
||
) |
int mfem::Mesh::AddBdrSegment | ( | const int * | vi, |
int | attr = 1 |
||
) |
int mfem::Mesh::AddBdrTriangle | ( | int | v1, |
int | v2, | ||
int | v3, | ||
int | attr = 1 |
||
) |
int mfem::Mesh::AddBdrTriangle | ( | const int * | vi, |
int | attr = 1 |
||
) |
int mfem::Mesh::AddElement | ( | Element * | elem | ) |
The parameter elem should be allocated using the NewElement() method.
int mfem::Mesh::AddHex | ( | int | v1, |
int | v2, | ||
int | v3, | ||
int | v4, | ||
int | v5, | ||
int | v6, | ||
int | v7, | ||
int | v8, | ||
int | attr = 1 |
||
) |
void mfem::Mesh::AddHexAsTets | ( | const int * | vi, |
int | attr = 1 |
||
) |
void mfem::Mesh::AddHexAsWedges | ( | const int * | vi, |
int | attr = 1 |
||
) |
|
protected |
Used in GenerateFaces()
int mfem::Mesh::AddQuad | ( | int | v1, |
int | v2, | ||
int | v3, | ||
int | v4, | ||
int | attr = 1 |
||
) |
|
protected |
int mfem::Mesh::AddSegment | ( | int | v1, |
int | v2, | ||
int | attr = 1 |
||
) |
int mfem::Mesh::AddSegment | ( | const int * | vi, |
int | attr = 1 |
||
) |
|
protected |
int mfem::Mesh::AddTet | ( | int | v1, |
int | v2, | ||
int | v3, | ||
int | v4, | ||
int | attr = 1 |
||
) |
|
inline |
int mfem::Mesh::AddTriangle | ( | int | v1, |
int | v2, | ||
int | v3, | ||
int | attr = 1 |
||
) |
int mfem::Mesh::AddTriangle | ( | const int * | vi, |
int | attr = 1 |
||
) |
|
protected |
int mfem::Mesh::AddVertex | ( | double | x, |
double | y = 0.0 , |
||
double | z = 0.0 |
||
) |
void mfem::Mesh::AddVertexParents | ( | int | i, |
int | p1, | ||
int | p2 | ||
) |
int mfem::Mesh::AddWedge | ( | int | v1, |
int | v2, | ||
int | v3, | ||
int | v4, | ||
int | v5, | ||
int | v6, | ||
int | attr = 1 |
||
) |
|
protected |
|
protected |
|
protected |
|
protected |
void mfem::Mesh::ChangeVertexDataOwnership | ( | double * | vertices, |
int | len_vertices, | ||
bool | zerocopy = false |
||
) |
int mfem::Mesh::CheckBdrElementOrientation | ( | bool | fix_it = true | ) |
void mfem::Mesh::CheckDisplacements | ( | const Vector & | displacements, |
double & | tmax | ||
) |
int mfem::Mesh::CheckElementOrientation | ( | bool | fix_it = true | ) |
|
inline |
void mfem::Mesh::DebugDump | ( | std::ostream & | out | ) | const |
void mfem::Mesh::DegreeElevate | ( | int | rel_degree, |
int | degree = 16 |
||
) |
void mfem::Mesh::DeleteGeometricFactors | ( | ) |
Destroy all GeometricFactors stored by the Mesh.
This method can be used to force recomputation of the GeometricFactors, for example, after the mesh nodes are modified externally.
bool mfem::Mesh::DerefineByError | ( | Array< double > & | elem_error, |
double | threshold, | ||
int | nc_limit = 0 , |
||
int | op = 1 |
||
) |
Derefine the mesh based on an error measure associated with each element. A derefinement is performed if the sum of errors of its fine elements is smaller than 'threshold'. If 'nc_limit' > 0, derefinements that would increase the maximum level of hanging nodes of the mesh are skipped. Returns true if the mesh changed, false otherwise.
bool mfem::Mesh::DerefineByError | ( | const Vector & | elem_error, |
double | threshold, | ||
int | nc_limit = 0 , |
||
int | op = 1 |
||
) |
void mfem::Mesh::EnsureNCMesh | ( | bool | simplices_nonconforming = false | ) |
void mfem::Mesh::EnsureNodes | ( | ) |
|
inline |
|
inline |
|
inline |
Return true if the given face is interior.
|
inlineprotected |
|
virtual |
Finalize the construction of a general Mesh.
This method will:
[in] | refine | If true, prepare the Mesh for conforming refinement of triangular or tetrahedral meshes. |
[in] | fix_orientation | If true, fix the orientation of inverted mesh elements by permuting their vertices. |
Reimplemented in mfem::ParMesh.
void mfem::Mesh::FinalizeHexMesh | ( | int | generate_edges = 0 , |
int | refine = 0 , |
||
bool | fix_orientation = true |
||
) |
void mfem::Mesh::FinalizeMesh | ( | int | refine = 0 , |
bool | fix_orientation = true |
||
) |
Finalize the construction of any type of Mesh.
This method calls FinalizeTopology() and Finalize().
void mfem::Mesh::FinalizeQuadMesh | ( | int | generate_edges = 0 , |
int | refine = 0 , |
||
bool | fix_orientation = true |
||
) |
void mfem::Mesh::FinalizeTetMesh | ( | int | generate_edges = 0 , |
int | refine = 0 , |
||
bool | fix_orientation = true |
||
) |
void mfem::Mesh::FinalizeTopology | ( | bool | generate_bdr = true | ) |
Finalize the construction of the secondary topology (connectivity) data of a Mesh.
This method does not require any actual coordinate data (either vertex coordinates for linear meshes or node coordinates for meshes with nodes) to be available. However, the data generated by this method is generally required by the FiniteElementSpace class.
After calling this method, setting the Mesh vertices or nodes, it may be appropriate to call the method Finalize().
void mfem::Mesh::FinalizeTriMesh | ( | int | generate_edges = 0 , |
int | refine = 0 , |
||
bool | fix_orientation = true |
||
) |
void mfem::Mesh::FinalizeWedgeMesh | ( | int | generate_edges = 0 , |
int | refine = 0 , |
||
bool | fix_orientation = true |
||
) |
|
virtual |
Find the ids of the elements that contain the given points, and their corresponding reference coordinates.
The DenseMatrix point_mat describes the given points - one point for each column; it should have SpaceDimension() rows.
The InverseElementTransformation object, inv_trans, is used to attempt the element transformation inversion. If NULL pointer is given, the method will use a default constructed InverseElementTransformation. Note that the algorithms in the base class InverseElementTransformation can be completely overwritten by deriving custom classes that override the Transform() method.
If no element is found for the i-th point, elem_ids[i] is set to -1.
In the ParMesh implementation, the point_mat is expected to be the same on all ranks. If the i-th point is found by multiple ranks, only one of them will mark that point as found, i.e. set its elem_ids[i] to a non-negative number; the other ranks will set their elem_ids[i] to -2 to indicate that the point was found but assigned to another rank.
Reimplemented in mfem::ParMesh.
void mfem::Mesh::GeneralRefinement | ( | const Array< Refinement > & | refinements, |
int | nonconforming = -1 , |
||
int | nc_limit = 0 |
||
) |
Refine selected mesh elements. Refinement type can be specified for each element. The function can do conforming refinement of triangles and tetrahedra and non-conforming refinement (i.e., with hanging-nodes) of triangles, quadrilaterals and hexahedra. If 'nonconforming' = -1, suitable refinement method is selected automatically (namely, conforming refinement for triangles). Use nonconforming = 0/1 to force the method. For nonconforming refinements, nc_limit optionally specifies the maximum level of hanging nodes (unlimited by default).
void mfem::Mesh::GeneralRefinement | ( | const Array< int > & | el_to_refine, |
int | nonconforming = -1 , |
||
int | nc_limit = 0 |
||
) |
int * mfem::Mesh::GeneratePartitioning | ( | int | nparts, |
int | part_method = 1 |
||
) |
|
inline |
|
inline |
|
inline |
void mfem::Mesh::GetBdrElementAdjacentElement | ( | int | bdr_el, |
int & | el, | ||
int & | info | ||
) | const |
|
inline |
int mfem::Mesh::GetBdrElementEdgeIndex | ( | int | i | ) | const |
void mfem::Mesh::GetBdrElementFace | ( | int | i, |
int * | f, | ||
int * | o | ||
) | const |
ElementTransformation * mfem::Mesh::GetBdrElementTransformation | ( | int | i | ) |
void mfem::Mesh::GetBdrElementTransformation | ( | int | i, |
IsoparametricTransformation * | ElTr | ||
) |
Element::Type mfem::Mesh::GetBdrElementType | ( | int | i | ) | const |
|
inline |
FaceElementTransformations * mfem::Mesh::GetBdrFaceTransformations | ( | int | BdrElemNo | ) |
void mfem::Mesh::GetBdrPointMatrix | ( | int | i, |
DenseMatrix & | pointmat | ||
) | const |
void mfem::Mesh::GetEdgeTransformation | ( | int | i, |
IsoparametricTransformation * | EdTr | ||
) |
ElementTransformation * mfem::Mesh::GetEdgeTransformation | ( | int | EdgeNo | ) |
Table * mfem::Mesh::GetEdgeVertexTable | ( | ) | const |
void mfem::Mesh::GetEdgeVertices | ( | int | i, |
Array< int > & | vert | ||
) | const |
|
inline |
|
inline |
void mfem::Mesh::GetElementCenter | ( | int | i, |
Vector & | center | ||
) |
void mfem::Mesh::GetElementColoring | ( | Array< int > & | colors, |
int | el0 = 0 |
||
) |
|
protected |
|
inline |
double mfem::Mesh::GetElementSize | ( | int | i, |
int | type = 0 |
||
) |
double mfem::Mesh::GetElementSize | ( | int | i, |
const Vector & | dir | ||
) |
Return element to edge table and the indices for the boundary edges. The entries in the table are ordered according to the order of the nodes in the elements. For example, if T is the element to edge table T(i, 0) gives the index of edge in element i that connects vertex 0 to vertex 1, etc. Returns the number of the edges.
|
protected |
void mfem::Mesh::GetElementTransformation | ( | int | i, |
IsoparametricTransformation * | ElTr | ||
) |
ElementTransformation * mfem::Mesh::GetElementTransformation | ( | int | i | ) |
void mfem::Mesh::GetElementTransformation | ( | int | i, |
const Vector & | nodes, | ||
IsoparametricTransformation * | ElTr | ||
) |
Element::Type mfem::Mesh::GetElementType | ( | int | i | ) | const |
|
inline |
|
inline |
Table * mfem::Mesh::GetFaceEdgeTable | ( | ) | const |
void mfem::Mesh::GetFaceElements | ( | int | Face, |
int * | Elem1, | ||
int * | Elem2 | ||
) | const |
FaceElementTransformations * mfem::Mesh::GetFaceElementTransformations | ( | int | FaceNo, |
int | mask = 31 |
||
) |
Returns (a pointer to an object containing) the following data:
1) Elem1No - the index of the first element that contains this face this is the element that has the same outward unit normal vector as the face;
2) Elem2No - the index of the second element that contains this face this element has outward unit normal vector as the face multiplied with -1;
3) Elem1, Elem2 - pointers to the ElementTransformation's of the first and the second element respectively;
4) Face - pointer to the ElementTransformation of the face;
5) Loc1, Loc2 - IntegrationPointTransformation's mapping the face coordinate system to the element coordinate system (both in their reference elements). Used to transform IntegrationPoints from face to element. More formally, let: TL1, TL2 be the transformations represented by Loc1, Loc2, TE1, TE2 - the transformations represented by Elem1, Elem2, TF - the transformation represented by Face, then TF(x) = TE1(TL1(x)) = TE2(TL2(x)) for all x in the reference face.
6) FaceGeom - the base geometry for the face.
The mask specifies which fields in the structure to return: mask & 1 - Elem1, mask & 2 - Elem2 mask & 4 - Loc1, mask & 8 - Loc2, mask & 16 - Face. These mask values are defined in the ConfigMasks enum type as part of the FaceElementTransformations class in fem/eltrans.hpp.
Element::Type mfem::Mesh::GetFaceElementType | ( | int | Face | ) | const |
const FaceGeometricFactors * mfem::Mesh::GetFaceGeometricFactors | ( | const IntegrationRule & | ir, |
const int | flags, | ||
FaceType | type | ||
) |
Geometry::Type mfem::Mesh::GetFaceGeometryType | ( | int | Face | ) | const |
void mfem::Mesh::GetFaceInfos | ( | int | Face, |
int * | Inf1, | ||
int * | Inf2 | ||
) | const |
Table * mfem::Mesh::GetFaceToElementTable | ( | ) | const |
void mfem::Mesh::GetFaceTransformation | ( | int | i, |
IsoparametricTransformation * | FTr | ||
) |
ElementTransformation * mfem::Mesh::GetFaceTransformation | ( | int | FaceNo | ) |
|
inline |
double mfem::Mesh::GetGeckoElementOrdering | ( | Array< int > & | ordering, |
int | iterations = 4 , |
||
int | window = 4 , |
||
int | period = 2 , |
||
int | seed = 0 , |
||
bool | verbose = false , |
||
double | time_limit = 0 |
||
) |
This is our integration with the Gecko library. The method finds an element ordering that will increase memory coherency by putting elements that are in physical proximity closer in memory. It can also be used to obtain a space-filling curve ordering for ParNCMesh partitioning.
[out] | ordering | Output element ordering. |
iterations | Total number of V cycles. The ordering may improve with more iterations. The best iteration is returned at the end. | |
window | Initial window size. This determines the number of permutations tested at each multigrid level and strongly influences the quality of the result, but the cost of increasing 'window' is exponential. | |
period | The window size is incremented every 'period' iterations. | |
seed | Seed for initial random ordering (0 = skip random reorder). | |
verbose | Print the progress of the optimization to mfem::out. | |
time_limit | Optional time limit for the optimization, in seconds. When reached, ordering from the best iteration so far is returned (0 = no limit). |
const GeometricFactors * mfem::Mesh::GetGeometricFactors | ( | const IntegrationRule & | ir, |
const int | flags | ||
) |
void mfem::Mesh::GetGeometries | ( | int | dim, |
Array< Geometry::Type > & | el_geoms | ||
) | const |
|
inline |
void mfem::Mesh::GetHilbertElementOrdering | ( | Array< int > & | ordering | ) |
Return an ordering of the elements that approximately follows the Hilbert curve. The method performs a spatial (Hilbert) sort on the centers of all elements and returns the resulting sequence, which can then be passed to ReorderElements. This is a cheap alternative to GetGeckoElementOrdering.
|
inline |
|
inline |
|
protected |
void mfem::Mesh::GetLocalFaceTransformation | ( | int | face_type, |
int | elem_type, | ||
IsoparametricTransformation & | Transf, | ||
int | info | ||
) |
A helper method that constructs a transformation from the reference space of a face to the reference space of an element.
The local index of the face as a face in the element and its orientation are given by the input parameter info, as info = 64*loc_face_idx + loc_face_orientation.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inline |
|
inline |
|
inline |
|
inline |
int mfem::Mesh::GetNFbyType | ( | FaceType | type | ) | const |
Returns the number of faces according to the requested type.
If type==Boundary returns only the "true" number of boundary faces contrary to GetNBE() that returns "fake" boundary faces associated to visualization for GLVis. Similarly, if type==Interior, the "fake" boundary faces associated to visualization are counted as interior faces.
const FiniteElementSpace * mfem::Mesh::GetNodalFESpace | ( | ) | const |
Return the FiniteElementSpace on which the current mesh nodes are defined or NULL if the mesh does not have nodes.
|
inline |
Return a pointer to the internal node GridFunction (may be NULL).
|
inline |
void mfem::Mesh::GetNodes | ( | GridFunction & | nodes | ) | const |
Return the mesh nodes/vertices projected on the given GridFunction.
int mfem::Mesh::GetNumFaces | ( | ) | const |
int mfem::Mesh::GetNumGeometries | ( | int | dim | ) | const |
|
inline |
void mfem::Mesh::GetPointMatrix | ( | int | i, |
DenseMatrix & | pointmat | ||
) | const |
|
staticprotected |
const CoarseFineTransformations & mfem::Mesh::GetRefinementTransforms | ( | ) |
|
inline |
Return update counter. The counter starts at zero and is incremented each time refinement, derefinement, or rebalancing method is called. It is used for checking proper sequence of Space:: and GridFunction:: Update() calls.
|
staticprotected |
|
static |
|
staticprotected |
|
inline |
|
inline |
Table * mfem::Mesh::GetVertexToElementTable | ( | ) |
|
protected |
|
inlineprotected |
|
inline |
Return true iff the given geom is encountered in the mesh. Geometries of dimensions lower than Dimension() are counted as well.
|
protected |
|
protected |
|
protected |
void mfem::Mesh::KnotInsert | ( | Array< KnotVector * > & | kv | ) |
|
inlinevirtual |
This is similar to the mesh constructor with the same arguments, but here the current mesh is destroyed and another one created based on the data stream again given in MFEM, Netgen, or VTK format. If generate_edges = 0 (default) edges are not generated, if 1 edges are generated.
|
protected |
|
protected |
|
protectedvirtual |
This function is not public anymore. Use GeneralRefinement instead.
Reimplemented in mfem::ParMesh.
|
protected |
|
protected |
Creates mesh for the rectangle [0,sx]x[0,sy], divided into nx*ny quadrilaterals if type = QUADRILATERAL or into 2*nx*ny triangles if type = TRIANGLE. If generate_edges = 0 (default) edges are not generated, if 1 edges are generated. The parameter sfc_ordering controls how the elements (when type=QUADRILATERAL) are ordered: true - use space-filling curve ordering, or false - use lexicographic ordering.
|
protected |
Creates mesh for the parallelepiped [0,sx]x[0,sy]x[0,sz], divided into nx*ny*nz hexahedra if type=HEXAHEDRON or into 6*nx*ny*nz tetrahedrons if type=TETRAHEDRON. The parameter sfc_ordering controls how the elements (when type=HEXAHEDRON) are ordered: true - use space-filling curve ordering, or false - use lexicographic ordering.
|
protectedvirtual |
Reimplemented in mfem::ParMesh.
|
inline |
Get the mesh generator/type.
In parallel, the result takes into account elements on all processors.
void mfem::Mesh::MesquiteSmooth | ( | const int | mesquite_option = 0 | ) |
Definition at line 1144 of file mesquite.cpp.
void mfem::Mesh::MoveNodes | ( | const Vector & | displacements | ) |
void mfem::Mesh::MoveVertices | ( | const Vector & | displacements | ) |
void mfem::Mesh::NewNodes | ( | GridFunction & | nodes, |
bool | make_owner = false |
||
) |
Replace the internal node GridFunction with the given GridFunction.
|
protectedvirtual |
NC version of GeneralDerefinement.
Reimplemented in mfem::ParMesh.
|
protectedvirtual |
This function is not public anymore. Use GeneralRefinement instead.
Reimplemented in mfem::ParMesh.
|
protectedvirtual |
|
inline |
|
inlinevirtual |
Print the mesh to the given stream using the default MFEM mesh format.
Reimplemented in mfem::ParMesh.
|
virtual |
Print the mesh to the given stream using the adios2 bp format.
Reimplemented in mfem::ParMesh.
void mfem::Mesh::PrintBdrVTU | ( | std::string | fname, |
VTKFormat | format = VTKFormat::ASCII , |
||
bool | high_order_output = false , |
||
int | compression_level = 0 |
||
) |
void mfem::Mesh::PrintCharacteristics | ( | Vector * | Vh = NULL , |
Vector * | Vk = NULL , |
||
std::ostream & | out = mfem::out |
||
) |
Compute and print mesh characteristics such as number of vertices, number of elements, number of boundary elements, minimal and maximal element sizes, minimal and maximal element aspect ratios, etc.
If Vh or Vk are not NULL, return the element sizes and aspect ratios for all elements in the given Vectors.
|
staticprotected |
|
static |
Auxiliary method used by PrintCharacteristics().
It is also used in the mesh-explorer
miniapp.
void mfem::Mesh::PrintElementsWithPartitioning | ( | int * | partitioning, |
std::ostream & | out, | ||
int | interior_faces = 0 |
||
) |
|
staticprotected |
|
protected |
|
inlinevirtual |
In serial, this method calls PrintCharacteristics(). In parallel, additional information about the parallel decomposition is also printed.
Reimplemented in mfem::ParMesh.
void mfem::Mesh::PrintSurfaces | ( | const Table & | Aface_face, |
std::ostream & | out | ||
) | const |
|
protected |
void mfem::Mesh::PrintVTK | ( | std::ostream & | out | ) |
Print the mesh in VTK format (linear and quadratic meshes only).
void mfem::Mesh::PrintVTK | ( | std::ostream & | out, |
int | ref, | ||
int | field_data = 0 |
||
) |
Print the mesh in VTK format. The parameter ref > 0 specifies an element subdivision number (useful for high order fields and curved meshes). If the optional field_data is set, we also add a FIELD section in the beginning of the file with additional dataset information.
void mfem::Mesh::PrintVTU | ( | std::ostream & | out, |
int | ref = 1 , |
||
VTKFormat | format = VTKFormat::ASCII , |
||
bool | high_order_output = false , |
||
int | compression_level = 0 , |
||
bool | bdr_elements = false |
||
) |
|
virtual |
Print the mesh in VTU format with file name fname.
Reimplemented in mfem::ParMesh.
void mfem::Mesh::PrintWithPartitioning | ( | int * | partitioning, |
std::ostream & | out, | ||
int | elem_attr = 0 |
||
) | const |
Prints the mesh with boundary elements given by the boundary of the subdomains, so that the boundary of subdomain i has boundary attribute i+1.
|
virtual |
Print the mesh to the given stream using Netgen/Truegrid format.
Reimplemented in mfem::ParMesh.
void mfem::Mesh::RandomRefinement | ( | double | prob, |
bool | aniso = false , |
||
int | nonconforming = -1 , |
||
int | nc_limit = 0 |
||
) |
|
protected |
Definition at line 2085 of file mesh_readers.cpp.
|
protected |
|
protected |
|
protected |
The following mappings convert the Gmsh node orderings for high order elements to MFEM's L2 degree of freedom ordering. To support more options examine Gmsh's ordering and read off the indices in MFEM's order. For example 2nd order Gmsh quadrilaterals use the following ordering:
3–6–2 | | | 7 8 5 | | | 0–4–1
(from https://gmsh.info/doc/texinfo/gmsh.html#Node-ordering)
Whereas MFEM uses a tensor product ordering with the horizontal axis cycling fastest so we would read off:
0 4 1 7 8 5 3 6 2
This corresponds to the quad9 mapping below.
Definition at line 891 of file mesh_readers.cpp.
|
protected |
Definition at line 735 of file mesh_readers.cpp.
|
protected |
Definition at line 117 of file mesh_readers.cpp.
|
protected |
Definition at line 31 of file mesh_readers.cpp.
|
protected |
Definition at line 151 of file mesh_readers.cpp.
|
protected |
Definition at line 213 of file mesh_readers.cpp.
|
protected |
Definition at line 694 of file mesh_readers.cpp.
|
protected |
Definition at line 267 of file mesh_readers.cpp.
|
protected |
Definition at line 376 of file mesh_readers.cpp.
|
inlineprotected |
|
inlinevirtual |
Utility function: sum integers from all processors (Allreduce).
Reimplemented in mfem::ParMesh.
void mfem::Mesh::RefineAtVertex | ( | const Vertex & | vert, |
double | eps = 0.0 , |
||
int | nonconforming = -1 |
||
) |
bool mfem::Mesh::RefineByError | ( | const Array< double > & | elem_error, |
double | threshold, | ||
int | nonconforming = -1 , |
||
int | nc_limit = 0 |
||
) |
bool mfem::Mesh::RefineByError | ( | const Vector & | elem_error, |
double | threshold, | ||
int | nonconforming = -1 , |
||
int | nc_limit = 0 |
||
) |
void mfem::Mesh::RemoveInternalBoundaries | ( | ) |
void mfem::Mesh::RemoveUnusedVertices | ( | ) |
void mfem::Mesh::ReorderElements | ( | const Array< int > & | ordering, |
bool | reorder_vertices = true |
||
) |
|
virtual |
This method modifies a tetrahedral mesh so that Nedelec spaces of order greater than 1 can be defined on the mesh. Specifically, we 1) rotate all tets in the mesh so that the vertices {v0, v1, v2, v3} satisfy: v0 < v1 < min(v2, v3). 2) rotate all boundary triangles so that the vertices {v0, v1, v2} satisfy: v0 < min(v1, v2).
Reimplemented in mfem::ParMesh.
|
inline |
|
virtual |
Reimplemented in mfem::ParMesh.
|
virtual |
Set the curvature of the mesh nodes using the given polynomial degree, 'order', and optionally: discontinuous or continuous FE space, 'discont', new space dimension, 'space_dim' (if != -1), and 'ordering'.
Reimplemented in mfem::ParMesh.
|
protected |
Determine the mesh generator bitmask meshgen, see MeshGenerator().
Also, initializes mesh_geoms.
void mfem::Mesh::SetNodalFESpace | ( | FiniteElementSpace * | nfes | ) |
Replace the internal node GridFunction with a new GridFunction defined on the given FiniteElementSpace. The new node coordinates are projected (derived) from the current nodes/vertices.
void mfem::Mesh::SetNodalGridFunction | ( | GridFunction * | nodes, |
bool | make_owner = false |
||
) |
Replace the internal node GridFunction with the given GridFunction. The given GridFunction is updated with node coordinates projected (derived) from the current nodes/vertices.
|
inline |
|
protected |
void mfem::Mesh::SwapNodes | ( | GridFunction *& | nodes, |
int & | own_nodes_ | ||
) |
Swap the internal node GridFunction pointer and ownership flag members with the given ones.
void mfem::Mesh::Transform | ( | VectorCoefficient & | deformation | ) |
|
protected |
Uniform Refinement. Element with index i is refined uniformly.
void mfem::Mesh::UniformRefinement | ( | int | ref_algo = 0 | ) |
Refine all mesh elements.
[in] | ref_algo | Refinement algorithm. Currently used only for pure tetrahedral meshes. If set to zero (default), a tet mesh will be refined using algorithm A, that produces elements with better quality compared to algorithm B used when the parameter is non-zero. |
For tetrahedral meshes, after using algorithm A, the mesh cannot be refined locally using methods like GeneralRefinement() unless it is re-finalized using Finalize() with the parameter refine set to true. Note that calling Finalize() in this way will generally invalidate any FiniteElementSpaces and GridFunctions defined on the mesh.
|
inlineprotectedvirtual |
Refine a mixed 2D mesh uniformly.
Reimplemented in mfem::ParMesh.
|
protected |
|
inlineprotectedvirtual |
Refine a mixed 3D mesh uniformly.
Reimplemented in mfem::ParMesh.
|
protected |
|
friend |
|
friend |
|
friend |
Array<int> mfem::Mesh::attributes |
Array<int> mfem::Mesh::bdr_attributes |
|
protected |
|
protected |
|
protected |
Array<FaceGeometricFactors*> mfem::Mesh::face_geom_factors |
|
protected |
|
protected |
Array<GeometricFactors*> mfem::Mesh::geom_factors |
|
mutableprotected |
|
protected |
NCMesh* mfem::Mesh::ncmesh |
|
protected |
NURBSExtension* mfem::Mesh::NURBSext |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |