Wildmeshing Toolkit
|
#include <IdSimplexCollection.hpp>
Public Member Functions | |
IdSimplexCollection (const Mesh &mesh, std::vector< IdSimplex > &&simplices={}) | |
const std::vector< IdSimplex > & | simplex_vector () const |
Return const reference to the simplex vector. More... | |
std::vector< IdSimplex > | 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 IdSimplex &simplex) |
Add simplex to the collection. More... | |
void | add (const IdSimplexCollection &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 IdSimplex &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 IdSimplexCollection &other) const |
size_t | size () const |
void | reserve (const size_t new_cap) |
Static Public Member Functions | |
static IdSimplexCollection | get_union (const IdSimplexCollection &collection_a, const IdSimplexCollection &collection_b) |
Get union of two simplex collections. More... | |
static IdSimplexCollection | get_intersection (const IdSimplexCollection &collection_a, const IdSimplexCollection &collection_b) |
Get intersection of two simplex collections. More... | |
static bool | are_simplex_collections_equal (const IdSimplexCollection &collection_a, const IdSimplexCollection &collection_b) |
Check if the two simplex collections are equal. More... | |
Protected Attributes | |
const Mesh & | m_mesh |
std::vector< IdSimplex > | m_simplices |
Definition at line 8 of file IdSimplexCollection.hpp.
|
inline |
Definition at line 11 of file IdSimplexCollection.hpp.
void wmtk::simplex::IdSimplexCollection::add | ( | const IdSimplex & | simplex | ) |
Add simplex to the collection.
There is no sorting or any check if the vertex already exists
Definition at line 43 of file IdSimplexCollection.cpp.
References m_simplices.
Referenced by wmtk::operations::Operation::apply_attribute_transfer(), wmtk::TetMesh::TetMeshOperationExecutor::collapse_edge(), wmtk::simplex::link_condition(), wmtk::simplex::link_condition_closed_tetmesh(), and wmtk::simplex::link_condition_closed_trimesh().
void wmtk::simplex::IdSimplexCollection::add | ( | const IdSimplexCollection & | simplex_collection | ) |
Definition at line 48 of file IdSimplexCollection.cpp.
References m_simplices.
void wmtk::simplex::IdSimplexCollection::add | ( | const PrimitiveType | ptype, |
const std::vector< Tuple > & | tuple_vec | ||
) |
Definition at line 54 of file IdSimplexCollection.cpp.
References m_simplices, and mesh().
void wmtk::simplex::IdSimplexCollection::add | ( | const PrimitiveType | ptype, |
const Tuple & | tuple | ||
) |
Definition at line 63 of file IdSimplexCollection.cpp.
References m_simplices, and mesh().
|
static |
Check if the two simplex collections are equal.
The collections must be cleaned and sorted.
Definition at line 120 of file IdSimplexCollection.cpp.
References m_simplices, and size().
Referenced by wmtk::simplex::link_condition(), wmtk::simplex::link_condition_closed_tetmesh(), wmtk::simplex::link_condition_closed_trimesh(), and operator==().
|
inline |
Definition at line 87 of file IdSimplexCollection.hpp.
References m_simplices.
|
inline |
Definition at line 89 of file IdSimplexCollection.hpp.
References m_simplices.
|
inline |
Definition at line 91 of file IdSimplexCollection.hpp.
References m_simplices.
|
inline |
Definition at line 92 of file IdSimplexCollection.hpp.
References m_simplices.
bool wmtk::simplex::IdSimplexCollection::contains | ( | const IdSimplex & | simplex | ) | const |
Check if simplex is contained in collection.
Collection musst be sorted! Peform sort_and_clean
before calling this function.
Definition at line 81 of file IdSimplexCollection.cpp.
References m_simplices.
|
inline |
Definition at line 88 of file IdSimplexCollection.hpp.
References m_simplices.
|
inline |
Definition at line 90 of file IdSimplexCollection.hpp.
References m_simplices.
|
static |
Get intersection of two simplex collections.
The collections must be sorted!
Definition at line 101 of file IdSimplexCollection.cpp.
References m_mesh, m_simplices, and wmtk::components::set_intersection().
Referenced by wmtk::simplex::link_condition(), wmtk::simplex::link_condition_closed_tetmesh(), and wmtk::simplex::link_condition_closed_trimesh().
|
static |
Get union of two simplex collections.
The collections must be sorted!
Definition at line 87 of file IdSimplexCollection.cpp.
References m_mesh, and m_simplices.
const Mesh & wmtk::simplex::IdSimplexCollection::mesh | ( | ) | const |
Definition at line 23 of file IdSimplexCollection.cpp.
References m_mesh.
Referenced by add().
bool wmtk::simplex::IdSimplexCollection::operator== | ( | const IdSimplexCollection & | other | ) | const |
Definition at line 139 of file IdSimplexCollection.cpp.
References are_simplex_collections_equal().
void wmtk::simplex::IdSimplexCollection::reserve | ( | const size_t | new_cap | ) |
Definition at line 144 of file IdSimplexCollection.cpp.
References m_simplices.
Referenced by wmtk::operations::Operation::apply_attribute_transfer(), wmtk::TetMesh::TetMeshOperationExecutor::collapse_edge(), wmtk::simplex::link_condition_closed_tetmesh(), and wmtk::simplex::link_condition_closed_trimesh().
|
inline |
Return const reference to the simplex vector.
Definition at line 21 of file IdSimplexCollection.hpp.
References m_simplices.
Referenced by wmtk::operations::Operation::apply_attribute_transfer().
std::vector< IdSimplex > wmtk::simplex::IdSimplexCollection::simplex_vector | ( | const PrimitiveType & | ptype | ) | const |
Return vector of all simplices of the requested type.
Definition at line 8 of file IdSimplexCollection.cpp.
References m_simplices.
std::vector< Tuple > wmtk::simplex::IdSimplexCollection::simplex_vector_tuples | ( | PrimitiveType | ptype | ) | const |
Return vector of all simplices of the requested type, as tuples.
Definition at line 28 of file IdSimplexCollection.cpp.
References wmtk::Mesh::get_tuple_from_id_simplex(), m_mesh, and m_simplices.
|
inline |
Definition at line 96 of file IdSimplexCollection.hpp.
References m_simplices.
Referenced by are_simplex_collections_equal().
void wmtk::simplex::IdSimplexCollection::sort | ( | ) |
Definition at line 75 of file IdSimplexCollection.cpp.
References m_simplices.
void wmtk::simplex::IdSimplexCollection::sort_and_clean | ( | ) |
Sort simplex vector and remove duplicates.
Definition at line 68 of file IdSimplexCollection.cpp.
References m_simplices.
Referenced by wmtk::operations::Operation::apply_attribute_transfer(), wmtk::simplex::link_condition(), wmtk::simplex::link_condition_closed_tetmesh(), and wmtk::simplex::link_condition_closed_trimesh().
|
protected |
Definition at line 102 of file IdSimplexCollection.hpp.
Referenced by get_intersection(), get_union(), mesh(), and simplex_vector_tuples().
|
protected |
Definition at line 103 of file IdSimplexCollection.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().