|
libMesh
|
Class MeshTetInterface provides an abstract interface for tetrahedralization of meshes by subclasses.
More...
#include <mesh_tet_interface.h>
Public Member Functions | |
| MeshTetInterface (UnstructuredMesh &mesh) | |
| Constructor. More... | |
| virtual | ~MeshTetInterface () |
| Default destructor in base class. More... | |
| Real & | desired_volume () |
| Sets and/or gets the desired tetrahedron volume. More... | |
| bool & | smooth_after_generating () |
| Sets/gets flag which tells whether to do two steps of Laplace mesh smoothing after generating the grid. More... | |
| ElemType & | elem_type () |
| Sets and/or gets the desired element type. More... | |
| 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. More... | |
| virtual void | triangulate ()=0 |
| This is the main public interface for this function. More... | |
| void | set_verbosity (unsigned int v) |
| Sets a verbosity level, defaulting to 0 (print nothing), to be set as high as 100 (print everything). More... | |
Protected Types | |
| enum | SurfaceIntegrity { NON_TRI3 = 1, MISSING_NEIGHBOR = 2, EMPTY_MESH = 3, MISSING_BACKLINK = 4, BAD_NEIGHBOR_NODES = 5, NON_ORIENTED = 6, BAD_NEIGHBOR_LINKS = 7, DEGENERATE_ELEMENT = 8, DEGENERATE_MESH = 9 } |
| Enumeration of possible surface mesh integrity issues. More... | |
Protected Member Functions | |
| 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 a topological manifold that (if it's also geometrically valid) would define valid boundary for a tetrahedralized volume. More... | |
| std::set< SurfaceIntegrity > | improve_hull_integrity () |
| This function checks the integrity of the current set of elements in the Mesh, and corrects what it can. More... | |
| 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_hull_integrity() function. More... | |
| void | delete_2D_hull_elements () |
| Delete original convex hull elements from the Mesh after performing a Delaunay tetrahedralization. More... | |
Static Protected Member Functions | |
| static BoundingBox | volume_to_surface_mesh (UnstructuredMesh &mesh) |
| Remove volume elements from the given mesh, after converting their outer boundary faces to surface elements. More... | |
Protected Attributes | |
| unsigned int | _verbosity |
| verbosity setting More... | |
| Real | _desired_volume |
| The desired volume for the elements in the resulting mesh. More... | |
| bool | _smooth_after_generating |
| Flag which tells whether we should smooth the mesh after it is generated. More... | |
| ElemType | _elem_type |
| The exact type of tetrahedra we intend to construct. More... | |
| UnstructuredMesh & | _mesh |
| Local reference to the mesh we are working with. More... | |
| std::unique_ptr< std::vector< std::unique_ptr< UnstructuredMesh > > > | _holes |
| A pointer to a vector of meshes each defining a hole. More... | |
Class MeshTetInterface provides an abstract interface for tetrahedralization of meshes by subclasses.
Definition at line 49 of file mesh_tet_interface.h.
|
protected |
Enumeration of possible surface mesh integrity issues.
| Enumerator | |
|---|---|
| NON_TRI3 | |
| MISSING_NEIGHBOR | |
| EMPTY_MESH | |
| MISSING_BACKLINK | |
| BAD_NEIGHBOR_NODES | |
| NON_ORIENTED | |
| BAD_NEIGHBOR_LINKS | |
| DEGENERATE_ELEMENT | |
| DEGENERATE_MESH | |
Definition at line 124 of file mesh_tet_interface.h.
|
explicit |
Constructor.
Takes a reference to the mesh.
Definition at line 117 of file mesh_tet_interface.C.
|
virtualdefault |
Default destructor in base class.
| void libMesh::MeshTetInterface::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.
We use unique_ptr here because we expect that we may need to modify these meshes internally.
Definition at line 128 of file mesh_tet_interface.C.
Referenced by MeshTetTest::testHole(), and MeshTetTest::testSphereShell().
|
protected |
This function checks the integrity of the current set of elements in the Mesh to see if they comprise a topological manifold that (if it's also geometrically valid) would define valid boundary for a tetrahedralized volume.
Named check_hull_integrity() for backward compatibility, but now accepts non-convex manifolds.
enums describing problems found, or an empty set if no problems are found. Definition at line 341 of file mesh_tet_interface.C.
References _mesh, _verbosity, libMesh::MeshBase::active_local_element_stored_range(), BAD_NEIGHBOR_LINKS, BAD_NEIGHBOR_NODES, libMesh::ParallelObject::comm(), libMesh::MeshTools::create_bounding_box(), DEGENERATE_ELEMENT, DEGENERATE_MESH, EMPTY_MESH, libMesh::Elem::get_info(), libMesh::DofObject::id(), int, libMesh::Elem::local_node(), libMesh::BoundingBox::max(), libMesh::BoundingBox::min(), MISSING_BACKLINK, MISSING_NEIGHBOR, libMesh::MeshBase::n_elem(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_ptr(), NON_ORIENTED, NON_TRI3, libMesh::Threads::parallel_reduce(), libMesh::Real, TIMPI::Communicator::set_union(), libMesh::Elem::side_index_range(), libMesh::TOLERANCE, libMesh::TRI3, libMesh::Elem::type(), libMesh::Elem::volume(), and libMesh::Elem::which_neighbor_am_i().
Referenced by improve_hull_integrity().
|
protected |
Delete original convex hull elements from the Mesh after performing a Delaunay tetrahedralization.
Definition at line 685 of file mesh_tet_interface.C.
References _mesh, libMesh::MeshBase::delete_elem(), libMesh::MeshBase::get_boundary_info(), libMesh::BoundaryInfo::regenerate_id_sets(), libMesh::TRI3, and libMesh::Elem::type().
Referenced by libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole().
|
inline |
Sets and/or gets the desired tetrahedron volume.
Set to zero to disable volume constraint.
Definition at line 68 of file mesh_tet_interface.h.
References _desired_volume.
Referenced by main(), and MeshTetTest::testSphereShell().
|
inline |
Sets and/or gets the desired element type.
This should be a Tet type.
Definition at line 81 of file mesh_tet_interface.h.
References _elem_type.
|
protected |
This function checks the integrity of the current set of elements in the Mesh, and corrects what it can.
check_hull_integrity() if there are problems it can't fix, or an empty set otherwise. Definition at line 488 of file mesh_tet_interface.C.
References _mesh, BAD_NEIGHBOR_LINKS, check_hull_integrity(), libMesh::ParallelObject::comm(), libMesh::TypeVector< T >::cross(), libMesh::MeshBase::elem_ptr(), libMesh::MeshBase::elem_ref(), EMPTY_MESH, libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::flip(), libMesh::MeshBase::get_boundary_info(), libMesh::DofObject::id(), libMesh::libmesh_assert(), libMesh::Elem::local_node(), MISSING_BACKLINK, MISSING_NEIGHBOR, libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_ptr(), libMesh::Elem::node_ref_range(), NON_ORIENTED, NON_TRI3, libMesh::Elem::point(), libMesh::Real, libMesh::Elem::side_index_range(), and libMesh::Elem::which_neighbor_am_i().
Referenced by libMesh::NetGenMeshInterface::triangulate(), and libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole().
|
protected |
This function prints an informative message and throws an exception based on the output of the check_hull_integrity() function.
It is a separate function so that you can check hull integrity without exiting or catching an exception if desired.
Definition at line 634 of file mesh_tet_interface.C.
Referenced by libMesh::NetGenMeshInterface::triangulate(), and libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole().
|
inline |
Sets a verbosity level, defaulting to 0 (print nothing), to be set as high as 100 (print everything).
For verbosity >= 50, print all detected surface mesh integrity issues as they're found. Subclasses may add other output at other verbosity levels.
Definition at line 208 of file mesh_tet_interface.h.
References _verbosity.
Referenced by MeshTetTest::testNetGen().
|
inline |
Sets/gets flag which tells whether to do two steps of Laplace mesh smoothing after generating the grid.
False by default (for compatibility with old TetGenMeshInterface behavior).
Definition at line 75 of file mesh_tet_interface.h.
References _smooth_after_generating.
|
pure virtual |
This is the main public interface for this function.
Implemented in libMesh::TetGenMeshInterface, and libMesh::NetGenMeshInterface.
Referenced by MeshTetTest::testTetInterfaceBase().
|
staticprotected |
Remove volume elements from the given mesh, after converting their outer boundary faces to surface elements.
Returns the bounding box of the mesh; this is useful for detecting misplaced holes later.
Definition at line 134 of file mesh_tet_interface.C.
References libMesh::MeshBase::add_elem(), libMesh::MeshTools::Modification::all_tri(), libMesh::Elem::build_side_ptr(), libMesh::MeshBase::delete_elem(), libMesh::Elem::dim(), libMesh::Elem::flip(), libMesh::MeshBase::get_boundary_info(), libMesh::DofObject::id(), libMesh::MeshBase::is_prepared(), libMesh::MeshBase::is_replicated(), libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::low_order_key(), libMesh::make_range(), libMesh::MeshBase::max_elem_id(), mesh, libMesh::Elem::n_sides(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_ref_range(), libMesh::MeshBase::parallel_max_unique_id(), libMesh::MeshBase::prepare_for_use(), libMesh::Real, libMesh::remote_elem, libMesh::DofObject::set_id(), libMesh::Elem::set_interior_parent(), libMesh::Elem::set_neighbor(), libMesh::DofObject::set_unique_id(), libMesh::Elem::side_index_range(), libMesh::Elem::side_ptr(), libMesh::BoundingBox::union_with(), and libMesh::MeshTools::valid_is_prepared().
Referenced by libMesh::NetGenMeshInterface::triangulate().
|
protected |
The desired volume for the elements in the resulting mesh.
Unlimited (indicated by 0) by default
Definition at line 178 of file mesh_tet_interface.h.
Referenced by desired_volume(), libMesh::NetGenMeshInterface::triangulate(), and libMesh::TetGenMeshInterface::triangulate_pointset().
|
protected |
The exact type of tetrahedra we intend to construct.
Definition at line 189 of file mesh_tet_interface.h.
Referenced by elem_type().
|
protected |
A pointer to a vector of meshes each defining a hole.
If this is nullptr, there are no holes!
Definition at line 200 of file mesh_tet_interface.h.
Referenced by libMesh::NetGenMeshInterface::triangulate().
|
protected |
Local reference to the mesh we are working with.
Definition at line 194 of file mesh_tet_interface.h.
Referenced by libMesh::TetGenMeshInterface::assign_nodes_to_elem(), check_hull_integrity(), delete_2D_hull_elements(), libMesh::TetGenMeshInterface::fill_pointlist(), improve_hull_integrity(), libMesh::TetGenMeshInterface::pointset_convexhull(), libMesh::NetGenMeshInterface::triangulate(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), and libMesh::TetGenMeshInterface::triangulate_pointset().
|
protected |
Flag which tells whether we should smooth the mesh after it is generated.
False by default.
Definition at line 184 of file mesh_tet_interface.h.
Referenced by libMesh::TetGenMeshInterface::pointset_convexhull(), smooth_after_generating(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), and libMesh::TetGenMeshInterface::triangulate_pointset().
|
protected |
verbosity setting
Definition at line 110 of file mesh_tet_interface.h.
Referenced by check_hull_integrity(), and set_verbosity().
1.8.14