libMesh
|
This class implements cutting a single element into a collection of subelements. More...
#include <elem_cutter.h>
Public Member Functions | |
ElemCutter () | |
Constructor. More... | |
~ElemCutter () | |
Destructor. More... | |
bool | is_inside (const Elem &elem, const std::vector< Real > &vertex_distance_func) const |
bool | is_outside (const Elem &elem, const std::vector< Real > &vertex_distance_func) const |
bool | is_cut (const Elem &elem, const std::vector< Real > &vertex_distance_func) const |
void | operator() (const Elem &elem_in, const std::vector< Real > &vertex_distance_func) |
This function implements cutting an element by a signed distance function. More... | |
const std::vector< Elem const * > & | inside_elements () const |
const std::vector< Elem const * > & | outside_elements () const |
Protected Member Functions | |
void | find_intersection_points (const Elem &elem, const std::vector< Real > &vertex_distance_func) |
Finds the points where the cutting surface intersects the element edges. More... | |
void | cut_1D (const Elem &elem, const std::vector< Real > &vertex_distance_func) |
cutting algorithm in 1D. More... | |
void | cut_2D (const Elem &elem, const std::vector< Real > &vertex_distance_func) |
cutting algorithm in 2D. More... | |
void | cut_3D (const Elem &elem, const std::vector< Real > &vertex_distance_func) |
cutting algorithm in 3D. More... | |
Protected Attributes | |
std::vector< Elem const * > | _inside_elem |
std::vector< Elem const * > | _outside_elem |
Parallel::Communicator | _comm_self |
std::unique_ptr< ReplicatedMesh > | _inside_mesh_2D |
std::unique_ptr< TriangleInterface > | _triangle_inside |
std::unique_ptr< ReplicatedMesh > | _outside_mesh_2D |
std::unique_ptr< TriangleInterface > | _triangle_outside |
std::unique_ptr< ReplicatedMesh > | _inside_mesh_3D |
std::unique_ptr< TetGenMeshInterface > | _tetgen_inside |
std::unique_ptr< ReplicatedMesh > | _outside_mesh_3D |
std::unique_ptr< TetGenMeshInterface > | _tetgen_outside |
std::vector< Point > | _intersection_pts |
This class implements cutting a single element into a collection of subelements.
This class depends on libmesh's Triangle and Tetgen interfaces, the former of which is only defined if libmesh is configured with –disable-strict-lgpl.
Definition at line 61 of file elem_cutter.h.
libMesh::ElemCutter::ElemCutter | ( | ) |
Constructor.
Initializes pointer data without requiring a full ReplicatedMesh
in this header file.
Definition at line 40 of file elem_cutter.C.
|
default |
Destructor.
|
protected |
|
protected |
cutting algorithm in 2D.
Definition at line 220 of file elem_cutter.C.
References _inside_elem, _inside_mesh_2D, _intersection_pts, _outside_elem, _outside_mesh_2D, _triangle_inside, _triangle_outside, libMesh::err, libMesh::libmesh_assert(), libMesh::make_range(), libMesh::Elem::n_vertices(), and libMesh::Elem::point().
Referenced by operator()().
|
protected |
cutting algorithm in 3D.
Definition at line 300 of file elem_cutter.C.
References _inside_elem, _inside_mesh_3D, _intersection_pts, _outside_elem, _outside_mesh_3D, _tetgen_inside, _tetgen_outside, libMesh::err, libMesh::libmesh_assert(), libMesh::make_range(), libMesh::Elem::n_vertices(), libMesh::Quality::name(), and libMesh::Elem::point().
Referenced by operator()().
|
protected |
Finds the points where the cutting surface intersects the element edges.
Definition at line 155 of file elem_cutter.C.
References _intersection_pts, libMesh::Elem::build_edge_ptr(), libMesh::Elem::edge_index_range(), libMesh::Elem::get_node_index(), libMesh::Elem::is_vertex(), libMesh::libmesh_assert(), and libMesh::Real.
Referenced by operator()().
|
inline |
Definition at line 117 of file elem_cutter.h.
References _inside_elem.
bool libMesh::ElemCutter::is_cut | ( | const Elem & | elem, |
const std::vector< Real > & | vertex_distance_func | ||
) | const |
true
if the element is cut by the interface defined implicitly by the vertex values of the signed vertex_distance_func
. Definition at line 89 of file elem_cutter.C.
References libMesh::Real.
Referenced by operator()().
bool libMesh::ElemCutter::is_inside | ( | const Elem & | elem, |
const std::vector< Real > & | vertex_distance_func | ||
) | const |
true
if the element is completely inside the interface defined implicitly by the vertex values of the signed vertex_distance_func
. Definition at line 59 of file elem_cutter.C.
Referenced by operator()().
bool libMesh::ElemCutter::is_outside | ( | const Elem & | elem, |
const std::vector< Real > & | vertex_distance_func | ||
) | const |
true
if the element is completely outside the interface defined implicitly by the vertex values of the signed vertex_distance_func
. Definition at line 74 of file elem_cutter.C.
Referenced by operator()().
void libMesh::ElemCutter::operator() | ( | const Elem & | elem_in, |
const std::vector< Real > & | vertex_distance_func | ||
) |
This function implements cutting an element by a signed distance function.
The input array vertex_distance_func
contains the vertex values of a signed distance function, from which the cutting interface is inferred from the 0 level set. If all vertex values are positive, the element is outside the cutting surface and is not cut. Likewise if all vertex values are negative, the element is inside the cutting surface and is not cut.
Definition at line 110 of file elem_cutter.C.
References _inside_elem, _outside_elem, cut_1D(), cut_2D(), cut_3D(), libMesh::Elem::dim(), find_intersection_points(), is_cut(), is_inside(), is_outside(), libMesh::libmesh_assert(), and libMesh::Elem::n_vertices().
|
inline |
Definition at line 125 of file elem_cutter.h.
References _outside_elem.
|
protected |
Definition at line 158 of file elem_cutter.h.
|
protected |
Definition at line 155 of file elem_cutter.h.
Referenced by cut_2D(), cut_3D(), inside_elements(), and operator()().
|
protected |
Definition at line 160 of file elem_cutter.h.
Referenced by cut_2D().
|
protected |
Definition at line 166 of file elem_cutter.h.
Referenced by cut_3D().
|
protected |
Definition at line 172 of file elem_cutter.h.
Referenced by cut_2D(), cut_3D(), and find_intersection_points().
|
protected |
Definition at line 156 of file elem_cutter.h.
Referenced by cut_2D(), cut_3D(), operator()(), and outside_elements().
|
protected |
Definition at line 163 of file elem_cutter.h.
Referenced by cut_2D().
|
protected |
Definition at line 169 of file elem_cutter.h.
Referenced by cut_3D().
|
protected |
Definition at line 167 of file elem_cutter.h.
Referenced by cut_3D().
|
protected |
Definition at line 170 of file elem_cutter.h.
Referenced by cut_3D().
|
protected |
Definition at line 161 of file elem_cutter.h.
Referenced by cut_2D().
|
protected |
Definition at line 164 of file elem_cutter.h.
Referenced by cut_2D().