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... | |
Protected Member Functions | |
unsigned | check_hull_integrity () |
This function checks the integrity of the current set of elements in the Mesh to see if they comprise a hull, that is: More... | |
void | process_hull_integrity_result (unsigned result) |
This function prints an informative message and crashes 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... | |
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 57 of file mesh_netgen_interface.h.
|
explicit |
Constructor.
Takes a reference to the mesh containing the triangulated surface which is to be tetrahedralized.
Definition at line 69 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 125 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 hull, that is:
Definition at line 338 of file mesh_tet_interface.C.
References libMesh::MeshTetInterface::_mesh, libMesh::MeshBase::n_elem(), libMesh::Elem::neighbor_ptr_range(), libMesh::TRI3, and libMesh::Elem::type().
Referenced by triangulate(), and libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole().
|
protectedinherited |
Delete original convex hull elements from the Mesh after performing a Delaunay tetrahedralization.
Definition at line 390 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 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 372 of file mesh_tet_interface.C.
References libMesh::err.
Referenced by libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole().
|
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 77 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::MeshCommunication::broadcast(), libMesh::Elem::build_with_id(), libMesh::MeshTetInterface::check_hull_integrity(), libMesh::BoundingBox::contains(), libMesh::MeshBase::delete_elem(), libMesh::MeshBase::get_boundary_info(), libMesh::DofObject::id(), libMesh::libmesh_assert(), libMesh::libmesh_ignore(), libMesh::make_range(), libMesh::MeshTools::n_elem(), libMesh::MeshBase::n_nodes(), libMesh::MeshBase::node_ptr(), libMesh::Utility::pow(), libMesh::MeshBase::prepare_for_use(), 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 131 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 138 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 149 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 160 of file mesh_tet_interface.h.
Referenced by triangulate().
|
protectedinherited |
Local reference to the mesh we are working with.
Definition at line 154 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::TetGenMeshInterface::pointset_convexhull(), triangulate(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), and libMesh::TetGenMeshInterface::triangulate_pointset().
|
protected |
Tetgen only operates on serial meshes.
Definition at line 83 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 144 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().