libMesh
mesh_tet_interface.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2023 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 
36 namespace libMesh
37 {
38 // Forward Declarations
39 class UnstructuredMesh;
40 class Elem;
41 
50 {
51 public:
52 
56  explicit
58 
62  virtual ~MeshTetInterface();
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 
95 protected:
96 
105 
118  unsigned check_hull_integrity();
119 
126  void process_hull_integrity_result(unsigned result);
127 
133 
139 
145 
150 
155 
160  std::unique_ptr<std::vector<std::unique_ptr<UnstructuredMesh>>> _holes;
161 };
162 
163 } // namespace libMesh
164 
165 #endif // LIBMESH_MESH_TET_INTERFACE_H
ElemType
Defines an enum for geometric element types.
ElemType _elem_type
The exact type of tetrahedra we intend to construct.
std::unique_ptr< std::vector< std::unique_ptr< UnstructuredMesh > > > _holes
A pointer to a vector of meshes each defining a hole.
Real & desired_volume()
Sets and/or gets the desired tetrahedron volume.
unsigned check_hull_integrity()
This function checks the integrity of the current set of elements in the Mesh to see if they comprise...
MeshBase & mesh
The libMesh namespace provides an interface to certain functionality in the library.
MeshTetInterface(UnstructuredMesh &mesh)
Constructor.
ElemType & elem_type()
Sets and/or gets the desired element type.
The UnstructuredMesh class is derived from the MeshBase class.
virtual ~MeshTetInterface()
Default destructor in base class.
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 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.
Defines a Cartesian bounding box by the two corner extremum.
Definition: bounding_box.h:40
Real _desired_volume
The desired volume for the elements in the resulting mesh.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void process_hull_integrity_result(unsigned result)
This function prints an informative message and crashes based on the output of the check_hull_integri...
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...
UnstructuredMesh & _mesh
Local reference to the mesh we are working with.
void delete_2D_hull_elements()
Delete original convex hull elements from the Mesh after performing a Delaunay tetrahedralization.
bool _smooth_after_generating
Flag which tells whether we should smooth the mesh after it is generated.
Class MeshTetInterface provides an abstract interface for tetrahedralization of meshes by subclasses...