Wildmeshing Toolkit
wmtk::TetMesh::TetMeshOperationExecutor Class Reference

#include <TetMeshOperationExecutor.hpp>

Inheritance diagram for wmtk::TetMesh::TetMeshOperationExecutor:
[legend]
Collaboration diagram for wmtk::TetMesh::TetMeshOperationExecutor:
[legend]

Public Member Functions

 TetMeshOperationExecutor (TetMesh &m, const Tuple &operating_tuple)
 
void delete_simplices ()
 
void update_cell_hash ()
 
void update_ear_connectivity (const int64_t ear_tid, const int64_t new_tid, const int64_t old_tid, const int64_t common_fid)
 
void split_edge ()
 split edge v1-v2 More...
 
void collapse_edge ()
 split edge v1-v2 More...
 
std::vector< int64_t > request_simplex_indices (const PrimitiveType type, int64_t count)
 
std::tuple< std::vector< Tuple >, std::vector< Tuple > > get_incident_tets_and_faces (Tuple t)
 Get the incident tets and faces for an edge tuple. More...
 
- Public Member Functions inherited from wmtk::operations::tet_mesh::EdgeOperationData
 EdgeOperationData ()=default
 
 EdgeOperationData (EdgeOperationData &&)=default
 
EdgeOperationDataoperator= (EdgeOperationData &&)=default
 
const std::array< int64_t, 2 > & incident_vids () const
 
int64_t operating_edge_id () const
 
std::vector< std::array< Tuple, 2 > > ear_edges (const TetMesh &m) const
 
std::vector< std::array< Tuple, 2 > > ear_faces (const TetMesh &m) const
 
std::array< Tuple, 2 > input_endpoints (const TetMesh &m) const
 
std::vector< Tuplecollapse_merged_ear_edges (const TetMesh &m) const
 
std::vector< Tuplecollapse_merged_ear_faces (const TetMesh &m) const
 
std::vector< Tuplesplit_new_rib_edges (const TetMesh &) const
 
std::vector< Tuplesplit_new_rib_faces (const TetMesh &) const
 
std::vector< Tupleinput_tets (const TetMesh &) const
 
std::vector< Tupleinput_faces (const TetMesh &) const
 
std::array< Tuple, 2 > split_output_edges (const TetMesh &) const
 
std::vector< std::array< Tuple, 2 > > split_output_faces (const TetMesh &) const
 
std::vector< std::array< Tuple, 2 > > split_output_tets (const TetMesh &) const
 
std::vector< IncidentTetDataincident_tet_datas () const
 
std::vector< IncidentFaceDataincident_face_datas () const
 
std::vector< simplex::Simplexnew_vertices (const Mesh &) const
 
std::array< int64_t, 2 > new_spine_eids () const
 
- Public Member Functions inherited from wmtk::operations::EdgeOperationData
 EdgeOperationData ()
 
 ~EdgeOperationData ()
 
 EdgeOperationData (EdgeOperationData &&)
 
EdgeOperationDataoperator= (EdgeOperationData &&)
 
void set_split ()
 
void set_collapse ()
 
const internal::SplitAlternateFacetDataconst_split_facet_data () const
 Returns facet data held if the edge operation was a split - throws if data does not exist. More...
 
const internal::CollapseAlternateFacetDataconst_collapse_facet_data () const
 Returns facet data held if the edge operation was a collapse- throws if data does not exist. More...
 

Static Public Member Functions

static const std::array< std::vector< int64_t >, 4 > get_split_simplices_to_delete (const Tuple &tuple, const TetMesh &m)
 gather all simplices that are deleted in a split More...
 
static const std::array< std::vector< int64_t >, 4 > get_collapse_simplices_to_delete (const Tuple &tuple, const TetMesh &m)
 gather all simplices that are deleted in a collapse More...
 

Public Attributes

std::array< attribute::Accessor< char >, 4 > flag_accessors
 
attribute::Accessor< int64_t, TetMesh > & tt_accessor
 
attribute::Accessor< int64_t, TetMesh > & tf_accessor
 
attribute::Accessor< int64_t, TetMesh > & te_accessor
 
attribute::Accessor< int64_t, TetMesh > & tv_accessor
 
attribute::Accessor< int64_t, TetMesh > & vt_accessor
 
attribute::Accessor< int64_t, TetMesh > & et_accessor
 
attribute::Accessor< int64_t, TetMesh > & ft_accessor
 
TetMeshm_mesh
 
- Public Attributes inherited from wmtk::operations::tet_mesh::EdgeOperationData
std::array< std::vector< int64_t >, 4 > simplex_ids_to_delete
 
std::array< std::vector< Tuple >, 4 > simplex_tuples_to_delete
 
std::vector< int64_t > cell_ids_to_update_hash
 
bool is_collapse = false
 
- Public Attributes inherited from wmtk::operations::EdgeOperationData
Tuple m_operating_tuple
 
Tuple m_output_tuple
 
std::array< int64_t, 2 > m_spine_vids
 
std::vector< std::vector< Tuple > > split_boundary_complex
 
std::vector< std::vector< std::tuple< int64_t, std::vector< Tuple > > > > global_ids_to_potential_tuples
 
std::vector< std::vector< int64_t > > global_ids_to_update
 
std::variant< std::unique_ptr< internal::SplitAlternateFacetData >, std::unique_ptr< internal::CollapseAlternateFacetData > > m_op_data
 

Additional Inherited Members

- Protected Member Functions inherited from wmtk::operations::EdgeOperationData
internal::SplitAlternateFacetDatasplit_facet_data ()
 Returns facet data held if the edge operation was a split - throws if data does not exist. More...
 
internal::CollapseAlternateFacetDatacollapse_facet_data ()
 Returns facet data held if the edge operation was a collapse- throws if data does not exist. More...
 
- Static Protected Member Functions inherited from wmtk::operations::EdgeOperationData
static Tuple tuple_from_id (const Mesh &m, const PrimitiveType type, const int64_t gid)
 
static simplex::Simplex simplex_from_id (const Mesh &m, const PrimitiveType type, const int64_t gid)
 
static std::vector< int64_t > request_simplex_indices (Mesh &mesh, const PrimitiveType type, int64_t count)
 
- Protected Attributes inherited from wmtk::operations::tet_mesh::EdgeOperationData
std::array< int64_t, 2 > m_spine_vids
 
int64_t m_operating_edge_id
 
int64_t m_operating_face_id
 
int64_t m_operating_tet_id
 
int64_t m_split_new_vid = -1
 
std::array< int64_t, 2 > m_split_new_spine_eids
 
std::vector< IncidentTetDatam_incident_tet_datas
 
std::vector< IncidentFaceDatam_incident_face_datas
 

Detailed Description

Definition at line 7 of file TetMeshOperationExecutor.hpp.

Constructor & Destructor Documentation

◆ TetMeshOperationExecutor()

wmtk::TetMesh::TetMeshOperationExecutor::TetMeshOperationExecutor ( TetMesh m,
const Tuple operating_tuple 
)

Definition at line 95 of file TetMeshOperationExecutor.cpp.

References wmtk::Edge, wmtk::Mesh::get_flag_accessor(), wmtk::Tetrahedron, wmtk::Triangle, and wmtk::Vertex.

Here is the call graph for this function:

Member Function Documentation

◆ collapse_edge()

void wmtk::TetMesh::TetMeshOperationExecutor::collapse_edge ( )

split edge v1-v2

//  5 --------- 4 ---------- 6
     \  \      / \\        /
      \      \/   \ \     /
       \     /    \\  \  /
        \   /       \  \\ 3
          1 --------- 2/      tuple edge 1-2

input: tuple(v1, v1-v2, v1-v2-v4, v1-v2-v4-v3)

If tet 2-3-4-6 exists, return Tuple(v2, v2-v4, v2-v4-v3 v2-v4-v3-v6), otherwise return Tuple(v2, v2-v4, v2-v4-v3, v2-v4-v3-v5). Must exist a valid return (check by link condition user level? should return a invalid tuple if no ears?).

Definition at line 774 of file TetMeshOperationExecutor.cpp.

References wmtk::simplex::IdSimplexCollection::add(), wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::e01, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::e02, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::e03, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::e12, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::e13, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::e23, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::ears, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::local_operating_tuple, wmtk::simplex::IdSimplexCollection::reserve(), wmtk::Tetrahedron, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::tid, wmtk::simplex::top_dimension_cofaces_iterable(), wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::v0, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::v1, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::v2, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::v3, and wmtk::simplex::Simplex::vertex().

Referenced by wmtk::operations::utils::MultiMeshEdgeCollapseFunctor::operator()().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ delete_simplices()

void wmtk::TetMesh::TetMeshOperationExecutor::delete_simplices ( )

◆ get_collapse_simplices_to_delete()

const std::array< std::vector< int64_t >, 4 > wmtk::TetMesh::TetMeshOperationExecutor::get_collapse_simplices_to_delete ( const Tuple tuple,
const TetMesh m 
)
static

gather all simplices that are deleted in a collapse

For interior case: The deleted simplices are the one ring tets of the edge AND the one ring faces of the edge AND the edges and faces where one of the endpoint is the tuple vertex and are contained in the deleted faces and the tuple vertex. This is the intersection of the open star of the tuple vertex and the close star of the edge.

For boundary case: Same as above.

Returns
a pair of vector of ids (int64_t) and tuples(tuple)

Definition at line 211 of file TetMeshOperationExecutor.cpp.

References wmtk::get_primitive_type_id(), wmtk::simplex::half_closed_star_iterable(), and wmtk::TetMesh::id().

Here is the call graph for this function:

◆ get_incident_tets_and_faces()

std::tuple< std::vector< Tuple >, std::vector< Tuple > > wmtk::TetMesh::TetMeshOperationExecutor::get_incident_tets_and_faces ( Tuple  t)

Get the incident tets and faces for an edge tuple.

Parameters
edgetuple t (should be m_operating tuple in the operation class)
Returns
std::array<std::vector<Tuple>, 2> array[0] for incident_tets, array[1] for incident_faces. incident_tets.size() == incident_faces.size() if cycle case; incident_tets.size() + 1 == incident_faces.size() if boundary case. incident_tets[i] has face incident_face[(i+incident_faces.size()-1) % incident_faces.size()] and incident_face[i]. The face and tet iterating direction follows the input tuple.

Definition at line 22 of file TetMeshOperationExecutor.cpp.

References wmtk::TetMesh::id_tet(), wmtk::TetMesh::is_boundary_face(), m_mesh, wmtk::TetMesh::switch_face(), and wmtk::TetMesh::switch_tetrahedron().

Here is the call graph for this function:

◆ get_split_simplices_to_delete()

const std::array< std::vector< int64_t >, 4 > wmtk::TetMesh::TetMeshOperationExecutor::get_split_simplices_to_delete ( const Tuple tuple,
const TetMesh m 
)
static

gather all simplices that are deleted in a split

The deleted simplices are the one ring tets AND the one ring faces of the edge AND the edge itself. That is, the open star of the edge.

Definition at line 197 of file TetMeshOperationExecutor.cpp.

References wmtk::simplex::Simplex::edge(), wmtk::get_primitive_type_id(), wmtk::TetMesh::id(), and wmtk::simplex::open_star().

Here is the call graph for this function:

◆ request_simplex_indices()

std::vector< int64_t > wmtk::TetMesh::TetMeshOperationExecutor::request_simplex_indices ( const PrimitiveType  type,
int64_t  count 
)

Definition at line 1082 of file TetMeshOperationExecutor.cpp.

◆ split_edge()

void wmtk::TetMesh::TetMeshOperationExecutor::split_edge ( )

split edge v1-v2

       v4
       /\\
ear1  /| \ \   ear2
     / |  \  \
    /  |   \   \
   /   |    \    \
  /    |     \     \
 /     |      \     _\ v3
/______|_______\_ -

v1 v_new v2

input: tuple(v1, v1-v2, v1-v2-v4, v1-v2-v4-v3) (vertex, edge, face, tet)

This function will return the tuple that has: the same vertex as the input, a new edge along the input edge, a new face on the input face, and a new tet with is half of the input tet. In the illustration it will return Tuple(v_new, v_new-v2, v_new-v2-v4, v_new-v2-v4-v3)

Definition at line 243 of file TetMeshOperationExecutor.cpp.

References wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::e01, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::e02, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::e03, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::e12, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::e13, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::e23, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::ears, wmtk::Edge, wmtk::simplex::Simplex::edge(), wmtk::operations::tet_mesh::EdgeOperationData::FaceSplitData::eid_rib, wmtk::operations::tet_mesh::EdgeOperationData::FaceSplitData::eid_spine_new, wmtk::operations::tet_mesh::EdgeOperationData::FaceSplitData::eid_spine_old, wmtk::simplex::Simplex::face(), wmtk::operations::tet_mesh::EdgeOperationData::FaceSplitData::fid_new, wmtk::operations::tet_mesh::EdgeOperationData::FaceSplitData::fid_old, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::incident_face_data_idx, wmtk::utils::TupleInspector::local_eid(), wmtk::utils::TupleInspector::local_fid(), wmtk::operations::tet_mesh::EdgeOperationData::FaceSplitData::local_operating_tuple, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::local_operating_tuple, wmtk::utils::TupleInspector::local_vid(), wmtk::logger(), wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::new_face_data, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::new_face_id, wmtk::Mesh::request_simplex_indices(), wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::rib_f, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::split_t, wmtk::Tetrahedron, wmtk::simplex::Simplex::tetrahedron(), wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::tid, wmtk::Triangle, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::v0, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::v1, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::v2, wmtk::operations::tet_mesh::EdgeOperationData::IncidentTetData::v3, wmtk::Vertex, and wmtk::simplex::Simplex::vertex().

Referenced by wmtk::operations::utils::MultiMeshEdgeSplitFunctor::operator()().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_cell_hash()

void wmtk::TetMesh::TetMeshOperationExecutor::update_cell_hash ( )

Definition at line 194 of file TetMeshOperationExecutor.cpp.

◆ update_ear_connectivity()

void wmtk::TetMesh::TetMeshOperationExecutor::update_ear_connectivity ( const int64_t  ear_tid,
const int64_t  new_tid,
const int64_t  old_tid,
const int64_t  common_fid 
)

Definition at line 222 of file TetMeshOperationExecutor.cpp.

Member Data Documentation

◆ et_accessor

attribute::Accessor<int64_t,TetMesh>& wmtk::TetMesh::TetMeshOperationExecutor::et_accessor

Definition at line 20 of file TetMeshOperationExecutor.hpp.

◆ flag_accessors

std::array<attribute::Accessor<char>, 4> wmtk::TetMesh::TetMeshOperationExecutor::flag_accessors

Definition at line 14 of file TetMeshOperationExecutor.hpp.

Referenced by delete_simplices().

◆ ft_accessor

attribute::Accessor<int64_t,TetMesh>& wmtk::TetMesh::TetMeshOperationExecutor::ft_accessor

Definition at line 21 of file TetMeshOperationExecutor.hpp.

◆ m_mesh

TetMesh& wmtk::TetMesh::TetMeshOperationExecutor::m_mesh

Definition at line 108 of file TetMeshOperationExecutor.hpp.

Referenced by get_incident_tets_and_faces().

◆ te_accessor

attribute::Accessor<int64_t,TetMesh>& wmtk::TetMesh::TetMeshOperationExecutor::te_accessor

Definition at line 17 of file TetMeshOperationExecutor.hpp.

◆ tf_accessor

attribute::Accessor<int64_t,TetMesh>& wmtk::TetMesh::TetMeshOperationExecutor::tf_accessor

Definition at line 16 of file TetMeshOperationExecutor.hpp.

◆ tt_accessor

attribute::Accessor<int64_t,TetMesh>& wmtk::TetMesh::TetMeshOperationExecutor::tt_accessor

Definition at line 15 of file TetMeshOperationExecutor.hpp.

◆ tv_accessor

attribute::Accessor<int64_t,TetMesh>& wmtk::TetMesh::TetMeshOperationExecutor::tv_accessor

Definition at line 18 of file TetMeshOperationExecutor.hpp.

◆ vt_accessor

attribute::Accessor<int64_t,TetMesh>& wmtk::TetMesh::TetMeshOperationExecutor::vt_accessor

Definition at line 19 of file TetMeshOperationExecutor.hpp.


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