Wildmeshing Toolkit
wmtk::simplex::SimplexCollection Class Reference

#include <SimplexCollection.hpp>

Collaboration diagram for wmtk::simplex::SimplexCollection:
[legend]

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< Simplexsimplex_vector (const PrimitiveType &ptype) const
 Return vector of all simplices of the requested type. More...
 
const Meshmesh () const
 
std::vector< Tuplesimplex_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 Meshm_mesh
 
std::vector< Simplexm_simplices
 
internal::SimplexLessFunctor m_simplex_is_less
 
internal::SimplexEqualFunctor m_simplex_is_equal
 

Detailed Description

Definition at line 10 of file SimplexCollection.hpp.

Constructor & Destructor Documentation

◆ SimplexCollection()

wmtk::simplex::SimplexCollection::SimplexCollection ( const Mesh mesh,
std::vector< Simplex > &&  simplices = {} 
)
inline

Definition at line 13 of file SimplexCollection.hpp.

Member Function Documentation

◆ add() [1/4]

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().

Here is the call graph for this function:

◆ add() [2/4]

void wmtk::simplex::SimplexCollection::add ( const PrimitiveType  ptype,
const Tuple tuple 
)

Definition at line 63 of file SimplexCollection.cpp.

References m_simplices, and mesh().

Here is the call graph for this function:

◆ add() [3/4]

void wmtk::simplex::SimplexCollection::add ( const Simplex simplex)

◆ add() [4/4]

void wmtk::simplex::SimplexCollection::add ( const SimplexCollection simplex_collection)

Definition at line 48 of file SimplexCollection.cpp.

References m_simplices.

◆ are_simplex_collections_equal()

bool wmtk::simplex::SimplexCollection::are_simplex_collections_equal ( const SimplexCollection collection_a,
const SimplexCollection collection_b 
)
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==().

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

◆ begin() [1/2]

auto wmtk::simplex::SimplexCollection::begin ( )
inline

Definition at line 91 of file SimplexCollection.hpp.

References m_simplices.

Referenced by wmtk::function::utils::get_simplex_attributes().

Here is the caller graph for this function:

◆ begin() [2/2]

auto wmtk::simplex::SimplexCollection::begin ( ) const
inline

Definition at line 93 of file SimplexCollection.hpp.

References m_simplices.

◆ cbegin()

auto wmtk::simplex::SimplexCollection::cbegin ( ) const
inline

Definition at line 95 of file SimplexCollection.hpp.

References m_simplices.

◆ cend()

auto wmtk::simplex::SimplexCollection::cend ( ) const
inline

Definition at line 96 of file SimplexCollection.hpp.

References m_simplices.

◆ contains()

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().

Here is the caller graph for this function:

◆ end() [1/2]

auto wmtk::simplex::SimplexCollection::end ( )
inline

Definition at line 92 of file SimplexCollection.hpp.

References m_simplices.

Referenced by wmtk::function::utils::get_simplex_attributes().

Here is the caller graph for this function:

◆ end() [2/2]

auto wmtk::simplex::SimplexCollection::end ( ) const
inline

Definition at line 94 of file SimplexCollection.hpp.

References m_simplices.

◆ get_intersection()

SimplexCollection wmtk::simplex::SimplexCollection::get_intersection ( const SimplexCollection collection_a,
const SimplexCollection collection_b 
)
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().

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

◆ get_union()

SimplexCollection wmtk::simplex::SimplexCollection::get_union ( const SimplexCollection collection_a,
const SimplexCollection collection_b 
)
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().

Here is the caller graph for this function:

◆ mesh()

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().

Here is the caller graph for this function:

◆ operator==()

bool wmtk::simplex::SimplexCollection::operator== ( const SimplexCollection other) const

Definition at line 170 of file SimplexCollection.cpp.

References are_simplex_collections_equal().

Here is the call graph for this function:

◆ reserve()

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().

Here is the caller graph for this function:

◆ simplex_vector() [1/2]

◆ simplex_vector() [2/2]

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.

◆ simplex_vector_tuples()

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().

Here is the caller graph for this function:

◆ size()

size_t wmtk::simplex::SimplexCollection::size ( ) const
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().

Here is the caller graph for this function:

◆ sort()

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().

Here is the caller graph for this function:

◆ sort_and_clean()

Member Data Documentation

◆ m_mesh

const Mesh& wmtk::simplex::SimplexCollection::m_mesh
protected

Definition at line 106 of file SimplexCollection.hpp.

Referenced by get_intersection(), get_union(), and mesh().

◆ m_simplex_is_equal

internal::SimplexEqualFunctor wmtk::simplex::SimplexCollection::m_simplex_is_equal
protected

Definition at line 111 of file SimplexCollection.hpp.

Referenced by sort_and_clean().

◆ m_simplex_is_less

internal::SimplexLessFunctor wmtk::simplex::SimplexCollection::m_simplex_is_less
protected

Definition at line 110 of file SimplexCollection.hpp.

Referenced by contains(), get_intersection(), get_union(), sort(), and sort_and_clean().

◆ m_simplices

std::vector<Simplex> wmtk::simplex::SimplexCollection::m_simplices
protected

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