#include <mesh_tetgen_interface.h>
Public Member Functions | |
TetGenMeshInterface (UnstructuredMesh &mesh) | |
~TetGenMeshInterface () | |
void | set_switches (const std::string &) |
void | triangulate_pointset () |
void | pointset_convexhull () |
void | triangulate_conformingDelaunayMesh (double quality_constraint=0., double volume_constraint=0.) |
void | triangulate_conformingDelaunayMesh_carvehole (const std::vector< Point > &holes, double quality_constraint=0., double volume_constraint=0.) |
Protected Member Functions | |
void | fill_pointlist (TetGenWrapper &wrapper) |
void | assign_nodes_to_elem (unsigned *node_labels, Elem *elem) |
unsigned | check_hull_integrity () |
void | process_hull_integrity_result (unsigned result) |
void | delete_2D_hull_elements () |
Protected Attributes | |
UnstructuredMesh & | _mesh |
std::vector< unsigned > | _sequential_to_libmesh_node_map |
MeshSerializer | _serializer |
std::string | _switches |
Class TetGenMeshInterface
provides an interface for tetrahedralization of meshes using the TetGen library. For information about TetGen cf. TetGen home page.
Definition at line 54 of file mesh_tetgen_interface.h.
|
explicit |
Constructor. Takes a reference to the mesh.
Definition at line 38 of file mesh_tetgen_interface.C.
|
inline |
|
protected |
Assigns the node IDs contained in the 'node_labels' array to 'elem'.
Definition at line 372 of file mesh_tetgen_interface.C.
References _mesh, _sequential_to_libmesh_node_map, libMesh::Elem::n_nodes(), libMesh::MeshBase::node_ptr(), and libMesh::Elem::set_node().
Referenced by pointset_convexhull(), triangulate_conformingDelaunayMesh_carvehole(), and triangulate_pointset().
|
protected |
This function checks the integrity of the current set of elements in the Mesh to see if they comprise a convex hull, that is:
Definition at line 389 of file mesh_tetgen_interface.C.
References _mesh, libMesh::MeshBase::element_ptr_range(), libMesh::MeshBase::n_elem(), and libMesh::TRI3.
Referenced by triangulate_conformingDelaunayMesh_carvehole().
|
protected |
Delete original convex hull elements from the Mesh after performing a Delaunay tetrahedralization.
Definition at line 444 of file mesh_tetgen_interface.C.
References _mesh, libMesh::MeshBase::delete_elem(), libMesh::MeshBase::element_ptr_range(), libMesh::MeshBase::get_boundary_info(), libMesh::BoundaryInfo::regenerate_id_sets(), and libMesh::TRI3.
Referenced by triangulate_conformingDelaunayMesh_carvehole().
|
protected |
This function copies nodes from the _mesh into TetGen's pointlist. Takes some pains to ensure that non-sequential node numberings (which can happen with e.g. DistributedMesh) are handled.
Definition at line 347 of file mesh_tetgen_interface.C.
References _mesh, _sequential_to_libmesh_node_map, libMesh::TetGenWrapper::allocate_pointlist(), libMesh::MeshBase::n_nodes(), libMesh::MeshBase::node_ptr_range(), and libMesh::TetGenWrapper::set_node().
Referenced by pointset_convexhull(), triangulate_conformingDelaunayMesh_carvehole(), and triangulate_pointset().
void libMesh::TetGenMeshInterface::pointset_convexhull | ( | ) |
Method invokes TetGen library to compute a Delaunay tetrahedralization from the nodes point set. Stores only 2D hull surface elements.
Definition at line 113 of file mesh_tetgen_interface.C.
References _mesh, _switches, libMesh::MeshBase::add_elem(), assign_nodes_to_elem(), libMesh::MeshBase::delete_elem(), libMesh::MeshBase::element_ptr_range(), fill_pointlist(), libMesh::MeshBase::get_boundary_info(), libMesh::TetGenWrapper::get_numberoftrifaces(), libMesh::TetGenWrapper::get_triface_node(), libMesh::Elem::n_nodes(), libMesh::BoundaryInfo::regenerate_id_sets(), libMesh::TetGenWrapper::run_tetgen(), and libMesh::TetGenWrapper::set_switches().
|
protected |
This function prints an informative message and crashes based on the output of the check_hull_integrity() function. It is a separate function so that you can check hull integrity without crashing if you desire.
Definition at line 425 of file mesh_tetgen_interface.C.
References libMesh::err.
Referenced by triangulate_conformingDelaunayMesh_carvehole().
void libMesh::TetGenMeshInterface::set_switches | ( | const std::string & | switches | ) |
Method to set switches to tetgen, allowing for different behaviours
Definition at line 45 of file mesh_tetgen_interface.C.
References _switches.
void libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh | ( | double | quality_constraint = 0. , |
double | volume_constraint = 0. |
||
) |
Method invokes TetGen library to compute a Delaunay tetrahedralization from the nodes point set. Boundary constraints are taken from elements array.
Definition at line 165 of file mesh_tetgen_interface.C.
References triangulate_conformingDelaunayMesh_carvehole().
void libMesh::TetGenMeshInterface::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. Boundary constraints are taken from elements array. Include carve-out functionality.
Definition at line 175 of file mesh_tetgen_interface.C.
References _mesh, _sequential_to_libmesh_node_map, _switches, libMesh::MeshBase::add_elem(), libMesh::MeshBase::add_point(), libMesh::TetGenWrapper::allocate_facet_polygonlist(), libMesh::TetGenWrapper::allocate_facetlist(), libMesh::TetGenWrapper::allocate_polygon_vertexlist(), assign_nodes_to_elem(), libMesh::Utility::binary_find(), check_hull_integrity(), delete_2D_hull_elements(), libMesh::MeshBase::element_ptr_range(), fill_pointlist(), libMesh::TetGenWrapper::get_element_node(), libMesh::TetGenWrapper::get_numberofpoints(), libMesh::TetGenWrapper::get_numberoftetrahedra(), libMesh::TetGenWrapper::get_output_node(), libMesh::DofObject::id(), libMesh::MeshBase::n_elem(), libMesh::MeshBase::n_nodes(), libMesh::Elem::n_nodes(), process_hull_integrity_result(), libMesh::TetGenWrapper::run_tetgen(), libMesh::TetGenWrapper::set_hole(), libMesh::TetGenWrapper::set_switches(), and libMesh::TetGenWrapper::set_vertex().
Referenced by triangulate_conformingDelaunayMesh().
void libMesh::TetGenMeshInterface::triangulate_pointset | ( | ) |
Method invokes TetGen library to compute a Delaunay tetrahedralization from the nodes point set.
Definition at line 59 of file mesh_tetgen_interface.C.
References _mesh, _switches, libMesh::MeshBase::add_elem(), assign_nodes_to_elem(), fill_pointlist(), libMesh::TetGenWrapper::get_element_node(), libMesh::TetGenWrapper::get_numberoftetrahedra(), libMesh::Elem::n_nodes(), libMesh::TetGenWrapper::run_tetgen(), and libMesh::TetGenWrapper::set_switches().
|
protected |
Local reference to the mesh we are working with.
Definition at line 151 of file mesh_tetgen_interface.h.
Referenced by assign_nodes_to_elem(), check_hull_integrity(), delete_2D_hull_elements(), fill_pointlist(), pointset_convexhull(), triangulate_conformingDelaunayMesh_carvehole(), and triangulate_pointset().
|
protected |
We should not assume libmesh nodes are numbered sequentially... This is not the default behavior of DistributedMesh, for example, unless you specify node IDs explicitly. So this array allows us to keep a mapping between the sequential numbering in tetgen_data.pointlist.
Definition at line 160 of file mesh_tetgen_interface.h.
Referenced by assign_nodes_to_elem(), fill_pointlist(), and triangulate_conformingDelaunayMesh_carvehole().
|
protected |
Tetgen only operates on serial meshes.
Definition at line 165 of file mesh_tetgen_interface.h.
|
protected |
Parameter controlling the behaviour of tetgen. By default quiet.
Definition at line 171 of file mesh_tetgen_interface.h.
Referenced by pointset_convexhull(), set_switches(), triangulate_conformingDelaunayMesh_carvehole(), and triangulate_pointset().