libMesh
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
libMesh::ElemCutter Class Reference

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
 

Detailed Description

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.

Author
Benjamin S. Kirk
Date
2013 Subdivides a single element using a mesh generator.

Definition at line 60 of file elem_cutter.h.

Constructor & Destructor Documentation

◆ ElemCutter()

libMesh::ElemCutter::ElemCutter ( )

Constructor.

Initializes pointer data without requiring a full ReplicatedMesh in this header file.

◆ ~ElemCutter()

libMesh::ElemCutter::~ElemCutter ( )

Destructor.

Member Function Documentation

◆ cut_1D()

void libMesh::ElemCutter::cut_1D ( const Elem elem,
const std::vector< Real > &  vertex_distance_func 
)
protected

cutting algorithm in 1D.

◆ cut_2D()

void libMesh::ElemCutter::cut_2D ( const Elem elem,
const std::vector< Real > &  vertex_distance_func 
)
protected

cutting algorithm in 2D.

◆ cut_3D()

void libMesh::ElemCutter::cut_3D ( const Elem elem,
const std::vector< Real > &  vertex_distance_func 
)
protected

cutting algorithm in 3D.

◆ find_intersection_points()

void libMesh::ElemCutter::find_intersection_points ( const Elem elem,
const std::vector< Real > &  vertex_distance_func 
)
protected

Finds the points where the cutting surface intersects the element edges.

◆ inside_elements()

const std::vector<Elem const *>& libMesh::ElemCutter::inside_elements ( ) const
Returns
A list of general element pieces considered inside the cutting surface. These are subelements whose geometric union defines the spatial domain of the inside portion of the cut element.

Definition at line 116 of file elem_cutter.h.

References _inside_elem.

117  { return _inside_elem; }
std::vector< Elem const * > _inside_elem
Definition: elem_cutter.h:154

◆ is_cut()

bool libMesh::ElemCutter::is_cut ( const Elem elem,
const std::vector< Real > &  vertex_distance_func 
) const
Returns
true if the element is cut by the interface defined implicitly by the vertex values of the signed vertex_distance_func.

◆ is_inside()

bool libMesh::ElemCutter::is_inside ( const Elem elem,
const std::vector< Real > &  vertex_distance_func 
) const
Returns
true if the element is completely inside the interface defined implicitly by the vertex values of the signed vertex_distance_func.

◆ is_outside()

bool libMesh::ElemCutter::is_outside ( const Elem elem,
const std::vector< Real > &  vertex_distance_func 
) const
Returns
true if the element is completely outside the interface defined implicitly by the vertex values of the signed vertex_distance_func.

◆ 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.

◆ outside_elements()

const std::vector<Elem const *>& libMesh::ElemCutter::outside_elements ( ) const
Returns
A list of general element pieces considered outside the cutting surface. These are subelements whose geometric union defines the spatial domain of the outside portion of the cut element.

Definition at line 124 of file elem_cutter.h.

References _outside_elem.

125  { return _outside_elem; }
std::vector< Elem const * > _outside_elem
Definition: elem_cutter.h:155

Member Data Documentation

◆ _comm_self

Parallel::Communicator libMesh::ElemCutter::_comm_self
protected

Definition at line 157 of file elem_cutter.h.

◆ _inside_elem

std::vector<Elem const *> libMesh::ElemCutter::_inside_elem
protected

Definition at line 154 of file elem_cutter.h.

Referenced by inside_elements().

◆ _inside_mesh_2D

std::unique_ptr<ReplicatedMesh> libMesh::ElemCutter::_inside_mesh_2D
protected

Definition at line 159 of file elem_cutter.h.

◆ _inside_mesh_3D

std::unique_ptr<ReplicatedMesh> libMesh::ElemCutter::_inside_mesh_3D
protected

Definition at line 165 of file elem_cutter.h.

◆ _intersection_pts

std::vector<Point> libMesh::ElemCutter::_intersection_pts
protected

Definition at line 171 of file elem_cutter.h.

◆ _outside_elem

std::vector<Elem const *> libMesh::ElemCutter::_outside_elem
protected

Definition at line 155 of file elem_cutter.h.

Referenced by outside_elements().

◆ _outside_mesh_2D

std::unique_ptr<ReplicatedMesh> libMesh::ElemCutter::_outside_mesh_2D
protected

Definition at line 162 of file elem_cutter.h.

◆ _outside_mesh_3D

std::unique_ptr<ReplicatedMesh> libMesh::ElemCutter::_outside_mesh_3D
protected

Definition at line 168 of file elem_cutter.h.

◆ _tetgen_inside

std::unique_ptr<TetGenMeshInterface> libMesh::ElemCutter::_tetgen_inside
protected

Definition at line 166 of file elem_cutter.h.

◆ _tetgen_outside

std::unique_ptr<TetGenMeshInterface> libMesh::ElemCutter::_tetgen_outside
protected

Definition at line 169 of file elem_cutter.h.

◆ _triangle_inside

std::unique_ptr<TriangleInterface> libMesh::ElemCutter::_triangle_inside
protected

Definition at line 160 of file elem_cutter.h.

◆ _triangle_outside

std::unique_ptr<TriangleInterface> libMesh::ElemCutter::_triangle_outside
protected

Definition at line 163 of file elem_cutter.h.


The documentation for this class was generated from the following file: