libMesh
Loading...
Searching...
No Matches
mesh_tet_interface.h
Go to the documentation of this file.
1// The libMesh Finite Element Library.
2// Copyright (C) 2002-2026 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3
4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public
6// License as published by the Free Software Foundation; either
7// version 2.1 of the License, or (at your option) any later version.
8
9// This library is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12// Lesser General Public License for more details.
13
14// You should have received a copy of the GNU Lesser General Public
15// License along with this library; if not, write to the Free Software
16// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
18
19#ifndef LIBMESH_MESH_TET_INTERFACE_H
20#define LIBMESH_MESH_TET_INTERFACE_H
21
22#include "libmesh/libmesh_config.h"
23
24// Local includes
25#include "libmesh/bounding_box.h"
26#include "libmesh/enum_elem_type.h"
27#include "libmesh/point.h" // used for specifying holes
28
29// C++ includes
30#include <cstddef>
31#include <map>
32#include <memory>
33#include <string>
34#include <vector>
35
36namespace libMesh
37{
38// Forward Declarations
39class UnstructuredMesh;
40class Elem;
41
50{
51public:
52
56 explicit
58
63
69
76
82
88 void attach_hole_list(std::unique_ptr<std::vector<std::unique_ptr<UnstructuredMesh>>> holes);
89
93 virtual void triangulate () = 0;
94
103 void set_verbosity(unsigned int v);
104
105protected:
106
110 unsigned int _verbosity;
111
120
125 NON_TRI3 = 1, // a non-TRI3 element is found
126 MISSING_NEIGHBOR = 2, // an element with a nullptr-neighbor is found
127 EMPTY_MESH = 3, // the mesh is empty
128 MISSING_BACKLINK = 4, // an element neighbor isn't linked back to it
129 BAD_NEIGHBOR_NODES = 5, // an element neighbor isn't linked to expected nodes
130 NON_ORIENTED = 6, // an element neighbor has inconsistent orientation
131 BAD_NEIGHBOR_LINKS = 7, // an element neighbor has other inconsistent links
132 DEGENERATE_ELEMENT = 8, // an element has zero area
133 DEGENERATE_MESH = 9 // the mesh clearly bounds zero volume
134 };
135
148 [[nodiscard]] std::set<SurfaceIntegrity> check_hull_integrity() const;
149
158 [[nodiscard]] std::set<SurfaceIntegrity> improve_hull_integrity();
159
166 void process_hull_integrity_result(const std::set<SurfaceIntegrity> & result) const;
167
173
178 void increase_tet_order();
179
185
191
196
201
206 std::unique_ptr<std::vector<std::unique_ptr<UnstructuredMesh>>> _holes;
207};
208
209
210// ------------------------------------------------------------
211// MeshTetInterface class member functions
212inline
213void
215{
216 this->_verbosity = v;
217}
218
219
220} // namespace libMesh
221
222#endif // LIBMESH_MESH_TET_INTERFACE_H
Defines a Cartesian bounding box by the two corner extremum.
Class MeshTetInterface provides an abstract interface for tetrahedralization of meshes by subclasses.
void process_hull_integrity_result(const std::set< SurfaceIntegrity > &result) const
This function prints an informative message and throws an exception based on the output of the check_...
ElemType _elem_type
The exact type of tetrahedra we intend to construct.
UnstructuredMesh & _mesh
Local reference to the mesh we are working with.
std::unique_ptr< std::vector< std::unique_ptr< UnstructuredMesh > > > _holes
A pointer to a vector of meshes each defining a hole.
Real _desired_volume
The desired volume for the elements in the resulting mesh.
unsigned int _verbosity
verbosity setting
void delete_2D_hull_elements()
Delete original convex hull elements from the Mesh after performing a Delaunay tetrahedralization.
ElemType & elem_type()
Sets and/or gets the desired element type.
virtual void triangulate()=0
This is the main public interface for this function.
bool & smooth_after_generating()
Sets/gets flag which tells whether to do two steps of Laplace mesh smoothing after generating the gri...
Real & desired_volume()
Sets and/or gets the desired tetrahedron volume.
void attach_hole_list(std::unique_ptr< std::vector< std::unique_ptr< UnstructuredMesh > > > holes)
Attaches a vector of Mesh pointers defining holes which will be meshed around.
std::set< SurfaceIntegrity > check_hull_integrity() const
This function checks the integrity of the current set of elements in the Mesh to see if they comprise...
std::set< SurfaceIntegrity > improve_hull_integrity()
This function checks the integrity of the current set of elements in the Mesh, and corrects what it c...
void increase_tet_order()
Converts all linear tet elements to the type requested by _elem_type, if that type differs from TET4.
bool _smooth_after_generating
Flag which tells whether we should smooth the mesh after it is generated.
virtual ~MeshTetInterface()
Default destructor in base class.
SurfaceIntegrity
Enumeration of possible surface mesh integrity issues.
static BoundingBox volume_to_surface_mesh(UnstructuredMesh &mesh)
Remove volume elements from the given mesh, after converting their outer boundary faces to surface el...
void set_verbosity(unsigned int v)
Sets a verbosity level, defaulting to 0 (print nothing), to be set as high as 100 (print everything).
The UnstructuredMesh class is derived from the MeshBase class.
MeshBase & mesh
The libMesh namespace provides an interface to certain functionality in the library.
ElemType
Defines an enum for geometric element types.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real