|
libMesh
|
Class NetGenMeshInterface provides an interface for tetrahedralization of meshes using the NetGen library.
More...
#include <mesh_netgen_interface.h>
Public Member Functions | |
| NetGenMeshInterface (UnstructuredMesh &mesh) | |
| Constructor. More... | |
| virtual | ~NetGenMeshInterface () override=default |
| Empty destructor. More... | |
| virtual void | triangulate () override |
| Method invokes NetGen library to compute a tetrahedralization. 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... | |
| 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 | |
| MeshSerializer | _serializer |
| Tetgen only operates on serial meshes. More... | |
| 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 NetGenMeshInterface provides an interface for tetrahedralization of meshes using the NetGen library.
For information about TetGen cf. NetGen github repository.
Definition at line 52 of file mesh_netgen_interface.h.
|
protectedinherited |
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 containing the triangulated surface which is to be tetrahedralized.
Definition at line 75 of file mesh_netgen_interface.C.
|
overridevirtualdefault |
Empty destructor.
|
inherited |
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().
|
protectedinherited |
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 libMesh::MeshTetInterface::_mesh, libMesh::MeshTetInterface::_verbosity, libMesh::MeshBase::active_local_element_stored_range(), libMesh::MeshTetInterface::BAD_NEIGHBOR_LINKS, libMesh::MeshTetInterface::BAD_NEIGHBOR_NODES, libMesh::ParallelObject::comm(), libMesh::MeshTools::create_bounding_box(), libMesh::MeshTetInterface::DEGENERATE_ELEMENT, libMesh::MeshTetInterface::DEGENERATE_MESH, libMesh::MeshTetInterface::EMPTY_MESH, libMesh::Elem::get_info(), libMesh::DofObject::id(), int, libMesh::Elem::local_node(), libMesh::BoundingBox::max(), libMesh::BoundingBox::min(), libMesh::MeshTetInterface::MISSING_BACKLINK, libMesh::MeshTetInterface::MISSING_NEIGHBOR, libMesh::MeshBase::n_elem(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_ptr(), libMesh::MeshTetInterface::NON_ORIENTED, libMesh::MeshTetInterface::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 libMesh::MeshTetInterface::improve_hull_integrity().
|
protectedinherited |
Delete original convex hull elements from the Mesh after performing a Delaunay tetrahedralization.
Definition at line 685 of file mesh_tet_interface.C.
References libMesh::MeshTetInterface::_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().
|
inlineinherited |
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 libMesh::MeshTetInterface::_desired_volume.
Referenced by main(), and MeshTetTest::testSphereShell().
|
inlineinherited |
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 libMesh::MeshTetInterface::_elem_type.
|
protectedinherited |
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 libMesh::MeshTetInterface::_mesh, libMesh::MeshTetInterface::BAD_NEIGHBOR_LINKS, libMesh::MeshTetInterface::check_hull_integrity(), libMesh::ParallelObject::comm(), libMesh::TypeVector< T >::cross(), libMesh::MeshBase::elem_ptr(), libMesh::MeshBase::elem_ref(), libMesh::MeshTetInterface::EMPTY_MESH, libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::flip(), libMesh::MeshBase::get_boundary_info(), libMesh::DofObject::id(), libMesh::libmesh_assert(), libMesh::Elem::local_node(), libMesh::MeshTetInterface::MISSING_BACKLINK, libMesh::MeshTetInterface::MISSING_NEIGHBOR, libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_ptr(), libMesh::Elem::node_ref_range(), libMesh::MeshTetInterface::NON_ORIENTED, libMesh::MeshTetInterface::NON_TRI3, libMesh::Elem::point(), libMesh::Real, libMesh::Elem::side_index_range(), and libMesh::Elem::which_neighbor_am_i().
Referenced by triangulate(), and libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole().
|
protectedinherited |
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 triangulate(), and libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole().
|
inlineinherited |
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 libMesh::MeshTetInterface::_verbosity.
Referenced by MeshTetTest::testNetGen().
|
inlineinherited |
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 libMesh::MeshTetInterface::_smooth_after_generating.
|
overridevirtual |
Method invokes NetGen library to compute a tetrahedralization.
Implements libMesh::MeshTetInterface.
Definition at line 83 of file mesh_netgen_interface.C.
References libMesh::MeshTetInterface::_desired_volume, libMesh::MeshTetInterface::_holes, libMesh::MeshTetInterface::_mesh, libMesh::MeshBase::add_elem(), libMesh::MeshBase::add_point(), libMesh::BoundaryInfo::add_side(), libMesh::MeshCommunication::broadcast(), libMesh::Elem::build_with_id(), libMesh::MeshBase::clear(), libMesh::BoundingBox::contains(), libMesh::MeshBase::delete_elem(), libMesh::MeshBase::get_boundary_info(), libMesh::DofObject::id(), libMesh::MeshTetInterface::improve_hull_integrity(), libMesh::DofObject::invalid_id, libMesh::libmesh_assert(), libMesh::libmesh_ignore(), libMesh::make_range(), libMesh::MeshTools::n_elem(), libMesh::MeshBase::n_elem(), libMesh::MeshBase::n_nodes(), libMesh::n_threads(), libMesh::MeshBase::node_ptr(), libMesh::Utility::pow(), libMesh::MeshBase::prepare_for_use(), libMesh::MeshTetInterface::process_hull_integrity_result(), libMesh::ParallelObject::processor_id(), libMesh::TET4, libMesh::TRI3, libMesh::TRI6, libMesh::TRI7, and libMesh::MeshTetInterface::volume_to_surface_mesh().
Referenced by main().
|
staticprotectedinherited |
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 triangulate().
|
protectedinherited |
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 libMesh::MeshTetInterface::desired_volume(), triangulate(), and libMesh::TetGenMeshInterface::triangulate_pointset().
|
protectedinherited |
The exact type of tetrahedra we intend to construct.
Definition at line 189 of file mesh_tet_interface.h.
Referenced by libMesh::MeshTetInterface::elem_type().
|
protectedinherited |
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 triangulate().
|
protectedinherited |
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(), libMesh::MeshTetInterface::check_hull_integrity(), libMesh::MeshTetInterface::delete_2D_hull_elements(), libMesh::TetGenMeshInterface::fill_pointlist(), libMesh::MeshTetInterface::improve_hull_integrity(), libMesh::TetGenMeshInterface::pointset_convexhull(), triangulate(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), and libMesh::TetGenMeshInterface::triangulate_pointset().
|
protected |
Tetgen only operates on serial meshes.
Definition at line 78 of file mesh_netgen_interface.h.
|
protectedinherited |
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(), libMesh::MeshTetInterface::smooth_after_generating(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), and libMesh::TetGenMeshInterface::triangulate_pointset().
|
protectedinherited |
verbosity setting
Definition at line 110 of file mesh_tet_interface.h.
Referenced by libMesh::MeshTetInterface::check_hull_integrity(), and libMesh::MeshTetInterface::set_verbosity().
1.8.14