Wildmeshing Toolkit
|
#include <SimplexCollection.hpp>
Public Member Functions | |
SimplexCollection (const Mesh &mesh, std::vector< Simplex > &&simplices={}) | |
const std::vector< Simplex > & | simplex_vector () const |
Return const reference to the simplex vector. More... | |
std::vector< Simplex > | simplex_vector (const PrimitiveType &ptype) const |
Return vector of all simplices of the requested type. More... | |
const Mesh & | mesh () const |
std::vector< Tuple > | simplex_vector_tuples (PrimitiveType ptype) const |
Return vector of all simplices of the requested type, as tuples. More... | |
void | add (const Simplex &simplex) |
Add simplex to the collection. More... | |
void | add (const SimplexCollection &simplex_collection) |
void | add (const PrimitiveType ptype, const std::vector< Tuple > &tuple_vec) |
void | add (const PrimitiveType ptype, const Tuple &tuple) |
void | sort_and_clean () |
Sort simplex vector and remove duplicates. More... | |
void | sort () |
bool | contains (const Simplex &simplex) const |
Check if simplex is contained in collection. More... | |
auto | begin () |
auto | end () |
auto | begin () const |
auto | end () const |
auto | cbegin () const |
auto | cend () const |
bool | operator== (const SimplexCollection &other) const |
size_t | size () const |
void | reserve (const size_t new_cap) |
Static Public Member Functions | |
static SimplexCollection | get_union (const SimplexCollection &collection_a, const SimplexCollection &collection_b) |
Get union of two simplex collections. More... | |
static SimplexCollection | get_intersection (const SimplexCollection &collection_a, const SimplexCollection &collection_b) |
Get intersection of two simplex collections. More... | |
static bool | are_simplex_collections_equal (const SimplexCollection &collection_a, const SimplexCollection &collection_b) |
Check if the two simplex collections are equal. More... | |
Protected Attributes | |
const Mesh & | m_mesh |
std::vector< Simplex > | m_simplices |
internal::SimplexLessFunctor | m_simplex_is_less |
internal::SimplexEqualFunctor | m_simplex_is_equal |
Definition at line 10 of file SimplexCollection.hpp.
|
inline |
Definition at line 13 of file SimplexCollection.hpp.
void wmtk::simplex::SimplexCollection::add | ( | const PrimitiveType | ptype, |
const std::vector< Tuple > & | tuple_vec | ||
) |
Definition at line 54 of file SimplexCollection.cpp.
References m_simplices, and mesh().
void wmtk::simplex::SimplexCollection::add | ( | const PrimitiveType | ptype, |
const Tuple & | tuple | ||
) |
Definition at line 63 of file SimplexCollection.cpp.
References m_simplices, and mesh().
void wmtk::simplex::SimplexCollection::add | ( | const Simplex & | simplex | ) |
Add simplex to the collection.
There is no sorting or any check if the vertex already exists
Definition at line 43 of file SimplexCollection.cpp.
References m_simplices.
Referenced by wmtk::simplex::closed_star(), wmtk::TriMesh::TriMeshOperationExecutor::collapse_edge_precompute(), wmtk::simplex::edges(), wmtk::simplex::faces(), wmtk::TriMesh::TriMeshOperationExecutor::get_collapse_simplices_to_delete(), wmtk::invariants::Invariant::get_top_dimension_cofaces(), wmtk::simplex::k_ring(), wmtk::simplex::link_single_dimension_slow(), wmtk::simplex::link_slow(), wmtk::simplex::open_star_slow(), wmtk::TriMesh::TriMeshOperationExecutor::split_edge_precompute(), TEST_CASE(), wmtk::simplex::top_dimension_cofaces_tuples(), and wmtk::simplex::vertices().
void wmtk::simplex::SimplexCollection::add | ( | const SimplexCollection & | simplex_collection | ) |
Definition at line 48 of file SimplexCollection.cpp.
References m_simplices.
|
static |
Check if the two simplex collections are equal.
The collections must be cleaned and sorted.
Definition at line 159 of file SimplexCollection.cpp.
References get_union(), and m_simplices.
Referenced by operator==().
|
inline |
Definition at line 91 of file SimplexCollection.hpp.
References m_simplices.
Referenced by wmtk::function::utils::get_simplex_attributes().
|
inline |
Definition at line 93 of file SimplexCollection.hpp.
References m_simplices.
|
inline |
Definition at line 95 of file SimplexCollection.hpp.
References m_simplices.
|
inline |
Definition at line 96 of file SimplexCollection.hpp.
References m_simplices.
bool wmtk::simplex::SimplexCollection::contains | ( | const Simplex & | simplex | ) | const |
Check if simplex is contained in collection.
Collection musst be sorted! Peform sort_and_clean
before calling this function.
Definition at line 113 of file SimplexCollection.cpp.
References m_simplex_is_less, and m_simplices.
Referenced by wmtk::simplex::open_star_slow(), and TEST_CASE().
|
inline |
Definition at line 92 of file SimplexCollection.hpp.
References m_simplices.
Referenced by wmtk::function::utils::get_simplex_attributes().
|
inline |
Definition at line 94 of file SimplexCollection.hpp.
References m_simplices.
|
static |
Get intersection of two simplex collections.
The collections must be sorted!
Definition at line 139 of file SimplexCollection.cpp.
References m_mesh, m_simplex_is_less, m_simplices, and wmtk::components::set_intersection().
Referenced by wmtk::operations::composite::TetEdgeSwap::execute(), wmtk::simplex::link_single_dimension_slow(), and wmtk::simplex::link_slow().
|
static |
Get union of two simplex collections.
The collections must be sorted!
Definition at line 119 of file SimplexCollection.cpp.
References m_mesh, m_simplex_is_less, and m_simplices.
Referenced by are_simplex_collections_equal().
const Mesh & wmtk::simplex::SimplexCollection::mesh | ( | ) | const |
Definition at line 23 of file SimplexCollection.cpp.
References m_mesh.
Referenced by add(), wmtk::simplex::RawSimplexCollection::add(), wmtk::simplex::edges(), wmtk::simplex::faces(), wmtk::simplex::faces_single_dimension(), wmtk::simplex::top_dimension_cofaces(), and wmtk::simplex::vertices().
bool wmtk::simplex::SimplexCollection::operator== | ( | const SimplexCollection & | other | ) | const |
Definition at line 170 of file SimplexCollection.cpp.
References are_simplex_collections_equal().
void wmtk::simplex::SimplexCollection::reserve | ( | const size_t | new_cap | ) |
Definition at line 175 of file SimplexCollection.cpp.
References m_simplices.
Referenced by wmtk::simplex::closed_star(), and wmtk::TriMesh::TriMeshOperationExecutor::collapse_edge_precompute().
|
inline |
Return const reference to the simplex vector.
Definition at line 25 of file SimplexCollection.hpp.
References m_simplices.
Referenced by wmtk::simplex::RawSimplexCollection::add(), wmtk::invariants::TetMeshSubstructureTopologyPreservingInvariant::before(), wmtk::invariants::ValenceImprovementInvariant::before(), wmtk::simplex::FacesIterable::begin(), wmtk::simplex::closed_star(), wmtk::mesh_utils::compute_vertex_normal(), wmtk::simplex::FacesIterable::end(), wmtk::operations::TetWildTangentialLaplacianSmoothing::execute(), wmtk::invariants::Invariant::get_top_dimension_cofaces(), wmtk::function::EdgeValenceEnergy::get_value(), wmtk::TetMesh::is_boundary_vertex(), wmtk::invariants::MinIncidentValenceInvariant::is_greater_min_valence(), wmtk::simplex::k_ring(), wmtk::simplex::link_single_dimension_slow(), wmtk::simplex::link_slow(), wmtk::simplex::open_star_slow(), wmtk::operations::VertexLaplacianSmooth::operator()(), wmtk::Scheduler::run_operation_on_all_coloring(), wmtk::components::TagIntersection::simplex_is_in_intersection(), wmtk::TriMesh::TriMeshOperationExecutor::split_edge_precompute(), and TEST_CASE().
std::vector< Simplex > wmtk::simplex::SimplexCollection::simplex_vector | ( | const PrimitiveType & | ptype | ) | const |
Return vector of all simplices of the requested type.
Definition at line 8 of file SimplexCollection.cpp.
References m_simplices.
std::vector< Tuple > wmtk::simplex::SimplexCollection::simplex_vector_tuples | ( | PrimitiveType | ptype | ) | const |
Return vector of all simplices of the requested type, as tuples.
Definition at line 28 of file SimplexCollection.cpp.
References m_simplices.
Referenced by wmtk::invariants::Invariant::get_top_dimension_cofaces(), and TEST_CASE().
|
inline |
Definition at line 100 of file SimplexCollection.hpp.
References m_simplices.
Referenced by wmtk::components::AABBWrapper::AABBWrapper(), wmtk::function::utils::get_simplex_attributes(), and wmtk::components::tetwild_simplification().
void wmtk::simplex::SimplexCollection::sort | ( | ) |
Definition at line 107 of file SimplexCollection.cpp.
References m_simplex_is_less, and m_simplices.
Referenced by wmtk::simplex::cofaces_single_dimension(), wmtk::simplex::link(), and wmtk::simplex::link_single_dimension().
void wmtk::simplex::SimplexCollection::sort_and_clean | ( | ) |
Sort simplex vector and remove duplicates.
Definition at line 68 of file SimplexCollection.cpp.
References m_simplex_is_equal, m_simplex_is_less, and m_simplices.
Referenced by wmtk::simplex::boundary(), wmtk::simplex::closed_star(), wmtk::simplex::cofaces_single_dimension(), wmtk::simplex::faces(), wmtk::invariants::Invariant::get_top_dimension_cofaces(), wmtk::simplex::k_ring(), wmtk::simplex::link(), wmtk::simplex::link_single_dimension(), wmtk::simplex::link_single_dimension_slow(), wmtk::simplex::link_slow(), wmtk::simplex::open_star(), wmtk::simplex::open_star_slow(), wmtk::TriMesh::TriMeshOperationExecutor::split_edge_precompute(), TEST_CASE(), and wmtk::simplex::top_dimension_cofaces().
|
protected |
Definition at line 106 of file SimplexCollection.hpp.
Referenced by get_intersection(), get_union(), and mesh().
|
protected |
Definition at line 111 of file SimplexCollection.hpp.
Referenced by sort_and_clean().
|
protected |
Definition at line 110 of file SimplexCollection.hpp.
Referenced by contains(), get_intersection(), get_union(), sort(), and sort_and_clean().
|
protected |
Definition at line 107 of file SimplexCollection.hpp.
Referenced by add(), are_simplex_collections_equal(), begin(), cbegin(), cend(), contains(), end(), get_intersection(), get_union(), reserve(), simplex_vector(), simplex_vector_tuples(), size(), sort(), and sort_and_clean().