libMesh
Loading...
Searching...
No Matches
mesh_tetgen_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_TETGEN_INTERFACE_H
20#define LIBMESH_MESH_TETGEN_INTERFACE_H
21
22#include "libmesh/libmesh_config.h"
23#ifdef LIBMESH_HAVE_TETGEN
24
25
26// Local includes
27#include "libmesh/mesh_serializer.h"
28#include "libmesh/mesh_tet_interface.h"
29#include "libmesh/point.h" // used for specifying holes
30
31// C++ includes
32#include <cstddef>
33#include <map>
34#include <string>
35#include <vector>
36
37namespace libMesh
38{
39// Forward Declarations
40class UnstructuredMesh;
41class TetGenWrapper;
42class Elem;
43
56{
57public:
58
62 explicit
64
68 virtual ~TetGenMeshInterface() override = default;
69
73 void set_switches(std::string new_switches);
74
78 virtual void triangulate () override;
79
85
90 void pointset_convexhull ();
91
97 void triangulate_conformingDelaunayMesh (double quality_constraint=0.,
98 double volume_constraint=0.);
99
105 void triangulate_conformingDelaunayMesh_carvehole (const std::vector<Point> & holes,
106 double quality_constraint=0.,
107 double volume_constraint=0.);
108
109
110
111protected:
118 void fill_pointlist(TetGenWrapper & wrapper);
119
124 void assign_nodes_to_elem(unsigned * node_labels, Elem * elem);
125
133 std::vector<unsigned> _sequential_to_libmesh_node_map;
134
139
144 std::string _switches;
145};
146
147} // namespace libMesh
148
149#endif // LIBMESH_HAVE_TETGEN
150
151#endif // LIBMESH_MESH_TETGEN_INTERFACE_H
This is the base class from which all geometric element types are derived.
Definition elem.h:96
Temporarily serialize a DistributedMesh for non-distributed-mesh capable code paths.
Class MeshTetInterface provides an abstract interface for tetrahedralization of meshes by subclasses.
Class TetGenMeshInterface provides an interface for tetrahedralization of meshes using the TetGen lib...
std::vector< unsigned > _sequential_to_libmesh_node_map
We should not assume libmesh nodes are numbered sequentially... This is not the default behavior of D...
void triangulate_pointset()
Method invokes TetGen library to compute a Delaunay tetrahedralization from the nodes point set.
virtual ~TetGenMeshInterface() override=default
Empty destructor.
void triangulate_conformingDelaunayMesh_carvehole(const std::vector< Point > &holes, double quality_constraint=0., double volume_constraint=0.)
Method invokes TetGen library to compute a Delaunay tetrahedralization from the nodes point set.
virtual void triangulate() override
Method invokes TetGen library to compute a Delaunay tetrahedralization.
void pointset_convexhull()
Method invokes TetGen library to compute a Delaunay tetrahedralization from the nodes point set.
void set_switches(std::string new_switches)
Method to set switches to tetgen, allowing for different behaviours.
void triangulate_conformingDelaunayMesh(double quality_constraint=0., double volume_constraint=0.)
Method invokes TetGen library to compute a Delaunay tetrahedralization from the nodes point set.
void fill_pointlist(TetGenWrapper &wrapper)
This function copies nodes from the _mesh into TetGen's pointlist.
void assign_nodes_to_elem(unsigned *node_labels, Elem *elem)
Assigns the node IDs contained in the 'node_labels' array to 'elem'.
std::string _switches
Parameter controlling the behaviour of tetgen.
MeshSerializer _serializer
Tetgen only operates on serial meshes.
The TetGenWrapper provides an interface for basic access to TetGen data structures and methods.
The UnstructuredMesh class is derived from the MeshBase class.
MeshBase & mesh
The libMesh namespace provides an interface to certain functionality in the library.