15 #include "../config/config.hpp"
16 #include "../general/stable3d.hpp"
17 #include "../general/globals.hpp"
23 #include "../fem/eltrans.hpp"
24 #include "../fem/coefficient.hpp"
25 #include "../general/zstr.hpp"
33 class GeometricFactors;
34 class FaceGeometricFactors;
37 class FiniteElementSpace;
171 #ifdef MFEM_USE_MEMALLOC
222 void ReadMFEMMesh(std::istream &input,
bool mfem_v11,
int &curved);
227 void ReadVTKMesh(std::istream &input,
int &curved,
int &read_gf,
228 bool &finalize_topo);
229 void ReadNURBSMesh(std::istream &input,
int &curved,
int &read_gf);
230 void ReadInlineMesh(std::istream &input,
bool generate_edges =
false);
233 #ifdef MFEM_USE_NETCDF
234 void ReadCubit(
const char *filename,
int &curved,
int &read_gf);
269 int *edge1,
int *edge2,
int *middle)
275 int *edge1,
int *edge2,
int *middle)
276 {
Bisection(i, v_to_v, edge1, edge2, middle); }
310 bool update_nodes =
true);
327 double threshold,
int nc_limit = 0,
331 const int *fine,
int nfine,
int op);
392 int v0,
int v1,
int v2);
395 int v0,
int v1,
int v2,
int v3);
410 void InitMesh(
int _Dim,
int _spaceDim,
int NVert,
int NElem,
int NBdrElem);
415 void Loader(std::istream &input,
int generate_edges = 0,
416 std::string parse_tag =
"");
422 std::string section_delimiter =
"")
const;
430 double sx,
double sy,
double sz,
bool sfc_ordering);
439 bool generate_edges,
bool sfc_ordering);
442 void Make1D(
int n,
double sx = 1.0);
452 void Swap(
Mesh& other,
bool non_geometry);
466 explicit Mesh(
const Mesh &mesh,
bool copy_nodes =
true);
480 int *element_attributes,
int num_elements,
482 int *boundary_attributes,
int num_boundary_elements,
483 int dimension,
int space_dimension= -1);
487 Mesh(
int _Dim,
int NVert,
int NElem,
int NBdrElem = 0,
int _spaceDim = -1)
493 InitMesh(_Dim, _spaceDim, NVert, NElem, NBdrElem);
506 void AddTri(
const int *vi,
int attr = 1);
508 void AddQuad(
const int *vi,
int attr = 1);
509 void AddTet(
const int *vi,
int attr = 1);
510 void AddWedge(
const int *vi,
int attr = 1);
511 void AddHex(
const int *vi,
int attr = 1);
525 bool fix_orientation =
true);
528 bool fix_orientation =
true);
531 bool fix_orientation =
true);
534 bool fix_orientation =
true);
537 bool fix_orientation =
true);
540 void FinalizeMesh(
int refine = 0,
bool fix_orientation =
true);
569 virtual void Finalize(
bool refine =
false,
bool fix_orientation =
false);
573 #ifdef MFEM_USE_GECKO
585 int iterations = 1,
int window = 2,
586 int period = 1,
int seed = 0);
607 double sx = 1.0,
double sy = 1.0,
double sz = 1.0,
608 bool sfc_ordering =
true)
610 Make3D(nx, ny, nz, type, sx, sy, sz, sfc_ordering);
620 double sx = 1.0,
double sy = 1.0,
bool sfc_ordering =
true)
622 Make2D(nx, ny, type, sx, sy, generate_edges, sfc_ordering);
627 explicit Mesh(
int n,
double sx = 1.0)
636 explicit Mesh(
const char *filename,
int generate_edges = 0,
int refine = 1,
637 bool fix_orientation =
true);
642 explicit Mesh(std::istream &input,
int generate_edges = 0,
int refine = 1,
643 bool fix_orientation =
true);
646 Mesh(
Mesh *mesh_array[],
int num_pieces);
659 Mesh(
Mesh *orig_mesh,
int ref_factor,
int ref_type);
667 virtual void Load(std::istream &input,
int generate_edges = 0,
668 int refine = 1,
bool fix_orientation =
true)
670 Loader(input, generate_edges);
716 virtual long ReduceInt(
int value)
const {
return value; }
770 bool zerocopy =
false);
787 return faces[i]->GetGeometryType();
792 return elements[i]->GetGeometryType();
797 return boundary[i]->GetGeometryType();
860 faces[i]->GetVertices(vert);
976 if (
faces_info[FaceNo].Elem2No < 0) {
return NULL; }
988 void GetFaceInfos (
int Face,
int *Inf1,
int *Inf2)
const;
1048 void GetNode(
int i,
double *coord)
const;
1049 void SetNode(
int i,
const double *coord);
1092 virtual void SetCurvature(
int order,
bool discont =
false,
int space_dim = -1,
1117 int nonconforming = -1,
int nc_limit = 0);
1122 int nonconforming = -1,
int nc_limit = 0);
1126 int nonconforming = -1,
int nc_limit = 0);
1130 double eps = 0.0,
int nonconforming = -1);
1135 int nonconforming = -1,
int nc_limit = 0);
1140 int nonconforming = -1,
int nc_limit = 0);
1148 int nc_limit = 0,
int op = 1);
1152 int nc_limit = 0,
int op = 1);
1165 void EnsureNCMesh(
bool simplices_nonconforming =
false);
1198 void PrintVTK(std::ostream &
out,
int ref,
int field_data=0);
1204 bool high_order_output=
false,
1205 int compression_level=0);
1209 bool high_order_output=
false,
1210 int compression_level=0);
1219 std::ostream &
out,
int elem_attr = 0)
const;
1223 int interior_faces = 0);
1258 double &kappa_min,
double &kappa_max,
1325 std::ostream &
operator<<(std::ostream &
out,
const Mesh &mesh);
1444 Mesh *
Extrude1D(Mesh *mesh,
const int ny,
const double sy,
1445 const bool closed =
false);
1448 Mesh *
Extrude2D(Mesh *mesh,
const int nz,
const double sz);
1454 a = c; c =
b; b = t;
Abstract class for Finite Elements.
void AddHex(const int *vi, int attr=1)
const IntegrationRule * IntRule
void Loader(std::istream &input, int generate_edges=0, std::string parse_tag="")
std::ostream & operator<<(std::ostream &out, const Mesh &mesh)
void GetFaceEdges(int i, Array< int > &, Array< int > &) const
void PrintSurfaces(const Table &Aface_face, std::ostream &out) const
Print set of disjoint surfaces:
void GetPointMatrix(int i, DenseMatrix &pointmat) const
static const int vtk_quadratic_hex[27]
virtual void Print(std::ostream &out=mfem::out) const
int * CartesianPartitioning(int nxyz[])
Class for an integration rule - an Array of IntegrationPoint.
const DenseMatrix * PointMatrix
int GetBdrAttribute(int i) const
Return the attribute of boundary element i.
const double * GetVertex(int i) const
Return pointer to vertex i's coordinates.
void ScaleElements(double sf)
Class for grid function - Vector with associated FE space.
Table * GetEdgeVertexTable() const
Returns the edge-to-vertex Table (3D)
void GetBdrElementEdges(int i, Array< int > &edges, Array< int > &cor) const
Return the indices and the orientations of all edges of bdr element i.
void ReadVTKMesh(std::istream &input, int &curved, int &read_gf, bool &finalize_topo)
void FreeElement(Element *E)
int CheckElementOrientation(bool fix_it=true)
Check the orientation of the elements.
static bool remove_unused_vertices
void SetVertices(const Vector &vert_coord)
static const int vtk_quadratic_tet[10]
void GetEdgeVertices(int i, Array< int > &vert) const
Returns the indices of the vertices of edge i.
void Make2D(int nx, int ny, Element::Type type, double sx, double sy, bool generate_edges, bool sfc_ordering)
bool FaceIsTrueInterior(int FaceNo) const
Vector J
Jacobians of the element transformations at all quadrature points.
Vector X
Mapped (physical) coordinates of all quadrature points.
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the vector coefficient in the element described by T at the point ip, storing the result in ...
void UniformRefinement3D_base(Array< int > *f2qf=NULL, DSTable *v_to_v_p=NULL, bool update_nodes=true)
void PrintVTU(std::ostream &out, int ref=1, VTKFormat format=VTKFormat::ASCII, bool high_order_output=false, int compression_level=0)
long GetGlobalNE() const
Return the total (global) number of elements.
static void PrintElementsByGeometry(int dim, const Array< int > &num_elems_by_geom, std::ostream &out)
Auxiliary method used by PrintCharacteristics().
void AddHexAsTets(const int *vi, int attr=1)
void AddHexAsWedges(const int *vi, int attr=1)
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the vector coefficient in the element described by T at the point ip, storing the result in ...
Array< Element * > boundary
Geometry::Constants< Geometry::SQUARE > quad_t
int * GeneratePartitioning(int nparts, int part_method=1)
CoarseFineTransformations CoarseFineTr
int GetNumGeometries(int dim) const
Return the number of geometries of the given dimension present in the mesh.
void MoveVertices(const Vector &displacements)
int GetNBE() const
Returns number of boundary elements.
IsoparametricTransformation Transformation
void GetLocalPtToSegTransformation(IsoparametricTransformation &, int)
Used in GetFaceElementTransformations (...)
void GetCharacteristics(double &h_min, double &h_max, double &kappa_min, double &kappa_max, Vector *Vh=NULL, Vector *Vk=NULL)
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 ...
static FiniteElement * GetTransformationFEforElementType(Element::Type)
void NewNodes(GridFunction &nodes, bool make_owner=false)
Replace the internal node GridFunction with the given GridFunction.
virtual void UniformRefinement2D()
Refine a mixed 2D mesh uniformly.
void SwapNodes(GridFunction *&nodes, int &own_nodes_)
void GetElementFaces(int i, Array< int > &, Array< int > &) const
Return the indices and the orientations of all faces of element i.
Element::Type GetElementType(int i) const
Returns the type of element i.
void AddBdrElement(Element *elem)
void GetBoundingBox(Vector &min, Vector &max, int ref=2)
Returns the minimum and maximum corners of the mesh bounding box.
void ReadNetgen2DMesh(std::istream &input, int &curved)
void ShiftRight(int &a, int &b, int &c)
Element::Type GetBdrElementType(int i) const
Returns the type of boundary element i.
int EulerNumber2D() const
Equals 1 - num_holes.
Vector detJ
Determinants of the Jacobians at all quadrature points.
void AddTri(const int *vi, int attr=1)
void GetGeometries(int dim, Array< Geometry::Type > &el_geoms) const
Return all element geometries of the given dimension present in the mesh.
void GetFaceVertices(int i, Array< int > &vert) const
Returns the indices of the vertices of face i.
Data type dense matrix using column-major storage.
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...
Mesh * Extrude1D(Mesh *mesh, const int ny, const double sy, const bool closed)
Extrude a 1D mesh.
void Transform(void(*f)(const Vector &, Vector &))
int GetBdrElementEdgeIndex(int i) const
void AverageVertices(const int *indexes, int n, int result)
Averages the vertices with given indexes and saves the result in vertices[result].
int GetNE() const
Returns number of elements.
const Element * GetFace(int i) const
void FinalizeWedgeMesh(int generate_edges=0, int refine=0, bool fix_orientation=true)
Finalize the construction of a wedge Mesh.
Element * GetElement(int i)
void GenerateBoundaryElements()
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)
Geometry::Type GetFaceBaseGeometry(int i) const
Structure for storing mesh geometric factors: coordinates, Jacobians, and determinants of the Jacobia...
void SetMeshGen()
Determine the mesh generator bitmask meshgen, see MeshGenerator().
static int GetQuadOrientation(const int *base, const int *test)
Returns the orientation of "test" relative to "base".
void GetVertices(Vector &vert_coord) const
void ReadNetgen3DMesh(std::istream &input)
void AddBdrSegment(const int *vi, int attr=1)
void ReadInlineMesh(std::istream &input, bool generate_edges=false)
FaceElementTransformations * GetInteriorFaceTransformations(int FaceNo)
void RemoveInternalBoundaries()
void DebugDump(std::ostream &out) const
Output an NCMesh-compatible debug dump.
Mesh * Extrude2D(Mesh *mesh, const int nz, const double sz)
Extrude a 2D mesh.
FaceElementTransformations * GetFaceElementTransformations(int FaceNo, int mask=31)
Geometry::Type GetElementBaseGeometry(int i) const
virtual long ReduceInt(int value) const
Utility function: sum integers from all processors (Allreduce).
void FinalizeHexMesh(int generate_edges=0, int refine=0, bool fix_orientation=true)
Finalize the construction of a hexahedral Mesh.
void GetVertexToVertexTable(DSTable &) const
void RedRefinement(int i, const DSTable &v_to_v, int *edge1, int *edge2, int *middle)
void MarkTriMeshForRefinement()
void ReadCubit(const char *filename, int &curved, int &read_gf)
bool HasGeometry(Geometry::Type geom) const
Return true iff the given geom is encountered in the mesh. Geometries of dimensions lower than Dimens...
void InitRefinementTransforms()
IsoparametricTransformation FaceTransformation
void UniformRefinement2D_base(bool update_nodes=true)
Array< FaceGeometricFactors * > face_geom_factors
Optional face geometric factors.
Array< NCFaceInfo > nc_faces_info
Element * ReadElement(std::istream &)
void KnotInsert(Array< KnotVector * > &kv)
A parallel extension of the NCMesh class.
Element * NewElement(int geom)
FaceElementTransformations FaceElemTr
void GetEdgeTransformation(int i, IsoparametricTransformation *EdTr)
const GridFunction * GetNodes() const
Element::Type GetFaceElementType(int Face) const
Structure for storing face geometric factors: coordinates, Jacobians, determinants of the Jacobians...
ElementTransformation * GetBdrElementTransformation(int i)
Returns the transformation defining the i-th boundary element.
void AddVertex(const double *)
Mesh(int _Dim, int NVert, int NElem, int NBdrElem=0, int _spaceDim=-1)
Init constructor: begin the construction of a Mesh object.
void PrintTopo(std::ostream &out, const Array< int > &e_to_k) const
int GetNumFaces() const
Return the number of faces (3D), edges (2D) or vertices (1D).
Geometry::Constants< Geometry::SEGMENT > seg_t
void AddElement(Element *elem)
The parameter elem should be allocated using the NewElement() method.
void GetElementJacobian(int i, DenseMatrix &J)
void MesquiteSmooth(const int mesquite_option=0)
bool Nonconforming() const
Vector J
Jacobians of the element transformations at all quadrature points.
const GeometricFactors * GetGeometricFactors(const IntegrationRule &ir, const int flags)
Return the mesh geometric factors corresponding to the given integration rule.
void MoveNodes(const Vector &displacements)
void GetEdgeOrdering(DSTable &v_to_v, Array< int > &order)
void GetElementData(int geom, Array< int > &elem_vtx, Array< int > &attr) const
NCFaceInfo(bool slave, int master, const DenseMatrix *pm)
void FinalizeTriMesh(int generate_edges=0, int refine=0, bool fix_orientation=true)
Finalize the construction of a triangular Mesh.
void AddSegment(const int *vi, int attr=1)
void FinalizeTetMesh(int generate_edges=0, int refine=0, bool fix_orientation=true)
Finalize the construction of a tetrahedral Mesh.
void AddBdrQuadAsTriangles(const int *vi, int attr=1)
void Make3D(int nx, int ny, int nz, Element::Type type, double sx, double sy, double sz, bool sfc_ordering)
void AddSegmentFaceElement(int lf, int gf, int el, int v0, int v1)
virtual void SetAttributes()
void EnsureNCMesh(bool simplices_nonconforming=false)
GeometryList(Mesh &mesh, int dim)
Construct a GeometryList of all geometries of dimension dim in mesh.
Vector detJ
Determinants of the Jacobians at all quadrature points.
int FindCoarseElement(int i)
GeometryList(Mesh &mesh)
Construct a GeometryList of all element geometries in mesh.
void GetFaceTransformation(int i, IsoparametricTransformation *FTr)
Returns the transformation defining the given face element in a user-defined variable.
void GetLocalSegToTriTransformation(IsoparametricTransformation &loc, int i)
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
void AddQuadFaceElement(int lf, int gf, int el, int v0, int v1, int v2, int v3)
void LoadPatchTopo(std::istream &input, Array< int > &edge_to_knot)
Read NURBS patch/macro-element mesh.
STable3D * GetElementToFaceTable(int ret_ftbl=0)
virtual void SetCurvature(int order, bool discont=false, int space_dim=-1, int ordering=1)
int MeshGenerator()
Get the mesh generator/type.
virtual void PrintInfo(std::ostream &out=mfem::out)
In serial, this method calls PrintCharacteristics(). In parallel, additional information about the pa...
Type
Constants for the classes derived from Element.
void GetBdrPointMatrix(int i, DenseMatrix &pointmat) const
void CheckDisplacements(const Vector &displacements, double &tmax)
Geometry::Constants< Geometry::TETRAHEDRON > tet_t
void ReadLineMesh(std::istream &input)
virtual void Load(std::istream &input, int generate_edges=0, int refine=1, bool fix_orientation=true)
void SetNodesOwner(bool nodes_owner)
Set the mesh nodes ownership flag.
void SetLayer(const int l)
int GetElementToEdgeTable(Table &, Array< int > &)
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...
void GetHilbertElementOrdering(Array< int > &ordering)
void RandomRefinement(double prob, bool aniso=false, int nonconforming=-1, int nc_limit=0)
Refine each element with given probability. Uses GeneralRefinement.
const Element * GetElement(int i) const
Mesh(int n, double sx=1.0)
void GetLocalQuadToHexTransformation(IsoparametricTransformation &loc, int i)
Used in GetFaceElementTransformations (...)
void GetElementCenter(int i, Vector ¢er)
IsoparametricTransformation BdrTransformation
void GetGeckoElementOrdering(Array< int > &ordering, int iterations=1, int window=2, int period=1, int seed=0)
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 ...
IsoparametricTransformation Transformation2
void SetNodalFESpace(FiniteElementSpace *nfes)
Element * GetBdrElement(int i)
Vector normal
Normals at all quadrature points.
A class for non-conforming AMR on higher-order hexahedral, prismatic, quadrilateral or triangular mes...
FaceElementTransformations * GetBdrFaceTransformations(int BdrElemNo)
Geometry::Constants< Geometry::PRISM > pri_t
virtual void ReorientTetMesh()
virtual void LocalRefinement(const Array< int > &marked_el, int type=3)
This function is not public anymore. Use GeneralRefinement instead.
Data type tetrahedron element.
virtual void MarkTetMeshForRefinement(DSTable &v_to_v)
List of mesh geometries stored as Array<Geometry::Type>.
double GetElementSize(int i, int type=0)
Get the size of the i-th element relative to the perfect reference element.
int CheckBdrElementOrientation(bool fix_it=true)
Check the orientation of the boundary elements.
int SpaceDimension() const
void GetBdrElementFace(int i, int *, int *) const
Return the index and the orientation of the face of bdr element i. (3D)
void CheckPartitioning(int *partitioning)
void PrintElementsWithPartitioning(int *partitioning, std::ostream &out, int interior_faces=0)
bool FaceIsInterior(int FaceNo) const
Return true if the given face is interior.
void ReadMFEMMesh(std::istream &input, bool mfem_v11, int &curved)
void GetLocalQuadToWdgTransformation(IsoparametricTransformation &loc, int i)
Used in GetFaceElementTransformations (...)
void AddPointFaceElement(int lf, int gf, int el)
Used in GenerateFaces()
GeometricFactors(const Mesh *mesh, const IntegrationRule &ir, int flags)
void GetFaceElements(int Face, int *Elem1, int *Elem2) const
void Make1D(int n, double sx=1.0)
Creates a 1D mesh for the interval [0,sx] divided into n equal intervals.
const Element *const * GetElementsArray() const
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
virtual void NonconformingRefinement(const Array< Refinement > &refinements, int nc_limit=0)
This function is not public anymore. Use GeneralRefinement instead.
void PrintVTK(std::ostream &out)
virtual ~Mesh()
Destroys Mesh.
void FinalizeMesh(int refine=0, bool fix_orientation=true)
Finalize the construction of any type of Mesh.
Mesh(int nx, int ny, Element::Type type, bool generate_edges=false, double sx=1.0, double sy=1.0, bool sfc_ordering=true)
void GetFaceInfos(int Face, int *Inf1, int *Inf2) const
Geometry::Constants< Geometry::CUBE > hex_t
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Geometry::Type geom_buf[Geometry::NumGeom]
void RemoveUnusedVertices()
Remove unused vertices and rebuild mesh connectivity.
void ApplyLocalSlaveTransformation(IsoparametricTransformation &transf, const FaceInfo &fi)
static void PrintElement(const Element *, std::ostream &)
virtual void NURBSUniformRefinement()
Refine NURBS mesh.
const IntegrationRule * IntRule
Vector X
Mapped (physical) coordinates of all quadrature points.
void FinalizeTopology(bool generate_bdr=true)
Finalize the construction of the secondary topology (connectivity) data of a Mesh.
static void GetElementArrayEdgeTable(const Array< Element * > &elem_array, const DSTable &v_to_v, Table &el_to_edge)
GridFunction * GetNodes()
Return a pointer to the internal node GridFunction (may be NULL).
void SetSize(int nsize)
Change logical size of the array, keep existing entries.
void PrepareNodeReorder(DSTable **old_v_to_v, Table **old_elem_vert)
bool IsSlaveFace(const FaceInfo &fi) const
void AddQuad(const int *vi, int attr=1)
void ReadGmshMesh(std::istream &input)
void AddWedge(const int *vi, int attr=1)
virtual void PrintXG(std::ostream &out=mfem::out) const
Print the mesh to the given stream using Netgen/Truegrid format.
void RefineAtVertex(const Vertex &vert, double eps=0.0, int nonconforming=-1)
Refine elements sharing the specified vertex. Uses GeneralRefinement.
Array< Element * > elements
const Table & ElementToElementTable()
double GetLength(int i, int j) const
Return the length of the segment from node i to node j.
const CoarseFineTransformations & GetRefinementTransforms()
bool RefineByError(const Array< double > &elem_error, double threshold, int nonconforming=-1, int nc_limit=0)
Operation GetLastOperation() const
Return type of last modification of the mesh.
void AddBdrTriangle(const int *vi, int attr=1)
Table * GetFaceToElementTable() const
void GetLocalTriToTetTransformation(IsoparametricTransformation &loc, int i)
Used in GetFaceElementTransformations (...)
int EulerNumber() const
Equals 1 + num_holes - num_loops.
NURBSExtension * NURBSext
Optional NURBS mesh extension.
int GetNV() const
Returns number of vertices. Vertices are only at the corners of elements, where you would expect them...
void AddBdrQuad(const int *vi, int attr=1)
void GetNode(int i, double *coord) const
const Table & ElementToFaceTable() const
Class for integration point with weight.
void Swap(Mesh &other, bool non_geometry)
Element * ReadElementWithoutAttr(std::istream &)
FaceGeometricFactors(const Mesh *mesh, const IntegrationRule &ir, int flags, FaceType type)
void GetElementEdges(int i, Array< int > &edges, Array< int > &cor) const
Return the indices and the orientations of all edges of element i.
static const int vtk_quadratic_wedge[18]
void AddTriangle(const int *vi, int attr=1)
bool OwnsNodes() const
Return the mesh nodes ownership flag.
void GetElementTransformation(int i, IsoparametricTransformation *ElTr)
void GetLocalSegToQuadTransformation(IsoparametricTransformation &loc, int i)
const FiniteElementSpace * GetNodalFESpace() const
void FinalizeQuadMesh(int generate_edges=0, int refine=0, bool fix_orientation=true)
Finalize the construction of a quadrilateral Mesh.
void GetBdrElementData(int geom, Array< int > &bdr_elem_vtx, Array< int > &bdr_attr) const
virtual void Finalize(bool refine=false, bool fix_orientation=false)
Finalize the construction of a general Mesh.
bool DerefineByError(Array< double > &elem_error, double threshold, int nc_limit=0, int op=1)
NodeExtrudeCoefficient(const int dim, const int _n, const double _s)
void ReorderElements(const Array< int > &ordering, bool reorder_vertices=true)
void DegreeElevate(int rel_degree, int degree=16)
virtual ~NodeExtrudeCoefficient()
Array< FaceInfo > faces_info
STable3D * GetFacesTable()
NCMesh * ncmesh
Optional non-conforming mesh extension.
Geometry::Type GetBdrElementBaseGeometry(int i) const
virtual void UniformRefinement3D()
Refine a mixed 3D mesh uniformly.
static void PrintElementWithoutAttr(const Element *, std::ostream &)
virtual bool NonconformingDerefinement(Array< double > &elem_error, double threshold, int nc_limit=0, int op=1)
NC version of GeneralDerefinement.
Geometry::Type GetFaceGeometryType(int Face) const
void Clear()
Clear the contents of the Mesh.
int GetNEdges() const
Return the number of edges.
Geometry::Constants< Geometry::TRIANGLE > tri_t
double AggregateError(const Array< double > &elem_error, const int *fine, int nfine, int op)
Derefinement helper.
double * GetVertex(int i)
Return pointer to vertex i's coordinates.
int GetNFaces() const
Return the number of faces in a 3D mesh.
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 coordin...
void SetAttribute(int i, int attr)
Set the attribute of element i.
void ReadTrueGridMesh(std::istream &input)
int GetNFbyType(FaceType type) const
Returns the number of faces according to the requested type.
static int GetTriOrientation(const int *base, const int *test)
Returns the orientation of "test" relative to "base".
void SetNode(int i, const double *coord)
void GetLocalTriToWdgTransformation(IsoparametricTransformation &loc, int i)
Used in GetFaceElementTransformations (...)
void GetElementColoring(Array< int > &colors, int el0=0)
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 ...
void DeleteGeometricFactors()
Destroy all GeometricFactors stored by the Mesh.
IsoparametricTransformation EdgeTransformation
void AddTet(const int *vi, int attr=1)
MemAlloc< Tetrahedron, 1024 > TetMemory
Table * GetFaceEdgeTable() const
Returns the face-to-edge Table (3D)
void DoNodeReorder(DSTable *old_v_to_v, Table *old_elem_vert)
void SetNodes(const Vector &node_coord)
void SetNodalGridFunction(GridFunction *nodes, bool make_owner=false)
void ReadNURBSMesh(std::istream &input, int &curved, int &read_gf)
void ScaleSubdomains(double sf)
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
void InitFromNCMesh(const NCMesh &ncmesh)
Initialize vertices/elements/boundary/tables from a nonconforming mesh.
void Bisection(int i, const DSTable &, int *, int *, int *)
Bisect a triangle: element with index i is bisected.
void GeneralRefinement(const Array< Refinement > &refinements, int nonconforming=-1, int nc_limit=0)
Class for parallel meshes.
Abstract data type element.
int GetAttribute(int i) const
Return the attribute of element i.
void AddTriangleFaceElement(int lf, int gf, int el, int v0, int v1, int v2)
const Table & ElementToEdgeTable() const
Array< GeometricFactors * > geom_factors
Optional geometric factors.
void BdrBisection(int i, const HashTable< Hashed2 > &)
Bisect a boundary triangle: boundary element with index i is bisected.
void GetBdrElementVertices(int i, Array< int > &v) const
Returns the indices of the vertices of boundary element i.
void GenerateNCFaceInfo()
void GetElementVertices(int i, Array< int > &v) const
Returns the indices of the vertices of element i.
double GetElementVolume(int i)
Array< int > attributes
A list of all unique element attributes used by the Mesh.
void InitMesh(int _Dim, int _spaceDim, int NVert, int NElem, int NBdrElem)
Begin construction of a mesh.
Table * GetVertexToElementTable()
The returned Table must be destroyed by the caller.
const Element * GetBdrElement(int i) const
void GetElementData(const Array< Element * > &elem_array, int geom, Array< int > &elem_vtx, Array< int > &attr) const
void UpdateNodes()
Update the nodes of a curved mesh after refinement.
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.
void GreenRefinement(int i, const DSTable &v_to_v, int *edge1, int *edge2, int *middle)
void Printer(std::ostream &out=mfem::out, std::string section_delimiter="") const
Class used to extrude the nodes of a mesh.