Subdivides a single element using a mesh generator. More...
#include <elem_cutter.h>
Public Member Functions | |
ElemCutter () | |
~ElemCutter () | |
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) |
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) |
void | cut_1D (const Elem &elem, const std::vector< Real > &vertex_distance_func) |
void | cut_2D (const Elem &elem, const std::vector< Real > &vertex_distance_func) |
void | cut_3D (const Elem &elem, const std::vector< Real > &vertex_distance_func) |
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 |
Subdivides a single element using a mesh generator.
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 60 of file elem_cutter.h.
libMesh::ElemCutter::ElemCutter | ( | ) |
Constructor. Initializes pointer data without requiring a full ReplicatedMesh
in this header file.
Definition at line 38 of file elem_cutter.C.
libMesh::ElemCutter::~ElemCutter | ( | ) |
|
protected |
|
protected |
cutting algorithm in 2D.
Definition at line 217 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::Elem::n_vertices(), and libMesh::Elem::point().
Referenced by operator()().
|
protected |
cutting algorithm in 3D.
Definition at line 297 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::Elem::n_vertices(), libMesh::Quality::name(), libMesh::Elem::point(), and libMesh::Elem::volume().
Referenced by operator()().
|
protected |
Finds the points where the cutting surface intersects the element edges.
Definition at line 154 of file elem_cutter.C.
References _intersection_pts, libMesh::Elem::build_edge_ptr(), libMesh::Elem::get_node_index(), libMesh::Elem::is_vertex(), libMesh::Elem::n_edges(), and libMesh::Real.
Referenced by operator()().
|
inline |
Definition at line 116 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 88 of file elem_cutter.C.
References std::max(), std::min(), and 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 58 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 73 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 109 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(), and libMesh::Elem::n_vertices().
|
inline |
Definition at line 124 of file elem_cutter.h.
References _outside_elem.
|
protected |
Definition at line 157 of file elem_cutter.h.
|
protected |
Definition at line 154 of file elem_cutter.h.
Referenced by cut_2D(), cut_3D(), inside_elements(), and operator()().
|
protected |
Definition at line 159 of file elem_cutter.h.
Referenced by cut_2D().
|
protected |
Definition at line 165 of file elem_cutter.h.
Referenced by cut_3D().
|
protected |
Definition at line 171 of file elem_cutter.h.
Referenced by cut_2D(), cut_3D(), and find_intersection_points().
|
protected |
Definition at line 155 of file elem_cutter.h.
Referenced by cut_2D(), cut_3D(), operator()(), and outside_elements().
|
protected |
Definition at line 162 of file elem_cutter.h.
Referenced by cut_2D().
|
protected |
Definition at line 168 of file elem_cutter.h.
Referenced by cut_3D().
|
protected |
Definition at line 166 of file elem_cutter.h.
Referenced by cut_3D().
|
protected |
Definition at line 169 of file elem_cutter.h.
Referenced by cut_3D().
|
protected |
Definition at line 160 of file elem_cutter.h.
Referenced by cut_2D().
|
protected |
Definition at line 163 of file elem_cutter.h.
Referenced by cut_2D().