Wildmeshing Toolkit
wmtk::simplex::IdSimplexCollection Class Reference

#include <IdSimplexCollection.hpp>

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

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< IdSimplexsimplex_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 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 Meshm_mesh
 
std::vector< IdSimplexm_simplices
 

Detailed Description

Definition at line 8 of file IdSimplexCollection.hpp.

Constructor & Destructor Documentation

◆ IdSimplexCollection()

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

Definition at line 11 of file IdSimplexCollection.hpp.

Member Function Documentation

◆ add() [1/4]

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

Here is the caller graph for this function:

◆ add() [2/4]

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

Definition at line 48 of file IdSimplexCollection.cpp.

References m_simplices.

◆ add() [3/4]

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

Here is the call graph for this function:

◆ add() [4/4]

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

Definition at line 63 of file IdSimplexCollection.cpp.

References m_simplices, and mesh().

Here is the call graph for this function:

◆ are_simplex_collections_equal()

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

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

◆ begin() [1/2]

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

Definition at line 87 of file IdSimplexCollection.hpp.

References m_simplices.

◆ begin() [2/2]

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

Definition at line 89 of file IdSimplexCollection.hpp.

References m_simplices.

◆ cbegin()

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

Definition at line 91 of file IdSimplexCollection.hpp.

References m_simplices.

◆ cend()

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

Definition at line 92 of file IdSimplexCollection.hpp.

References m_simplices.

◆ contains()

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.

◆ end() [1/2]

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

Definition at line 88 of file IdSimplexCollection.hpp.

References m_simplices.

◆ end() [2/2]

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

Definition at line 90 of file IdSimplexCollection.hpp.

References m_simplices.

◆ get_intersection()

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

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

◆ get_union()

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

◆ mesh()

const Mesh & wmtk::simplex::IdSimplexCollection::mesh ( ) const

Definition at line 23 of file IdSimplexCollection.cpp.

References m_mesh.

Referenced by add().

Here is the caller graph for this function:

◆ operator==()

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

Definition at line 139 of file IdSimplexCollection.cpp.

References are_simplex_collections_equal().

Here is the call graph for this function:

◆ reserve()

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

Here is the caller graph for this function:

◆ simplex_vector() [1/2]

const std::vector<IdSimplex>& wmtk::simplex::IdSimplexCollection::simplex_vector ( ) const
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().

Here is the caller graph for this function:

◆ simplex_vector() [2/2]

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.

◆ simplex_vector_tuples()

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.

Here is the call graph for this function:

◆ size()

size_t wmtk::simplex::IdSimplexCollection::size ( ) const
inline

Definition at line 96 of file IdSimplexCollection.hpp.

References m_simplices.

Referenced by are_simplex_collections_equal().

Here is the caller graph for this function:

◆ sort()

void wmtk::simplex::IdSimplexCollection::sort ( )

Definition at line 75 of file IdSimplexCollection.cpp.

References m_simplices.

◆ sort_and_clean()

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

Here is the caller graph for this function:

Member Data Documentation

◆ m_mesh

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

Definition at line 102 of file IdSimplexCollection.hpp.

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

◆ m_simplices

std::vector<IdSimplex> wmtk::simplex::IdSimplexCollection::m_simplices
protected

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