Wildmeshing Toolkit
wmtk::simplex::TopDimensionCofacesIterable Class Reference

Iterating through the d-simplices of a mesh can be done in different ways, depending on the simplex dimension x around which the iteration is done. More...

#include <TopDimensionCofacesIterable.hpp>

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

Classes

class  Iterator
 

Public Types

enum  IteratorPhase { Forward = 0 , Intermediate = 1 , Backward = 2 , End = 3 }
 The IteratorPhase is only used for depth 1 and 2. More...
 

Public Member Functions

 TopDimensionCofacesIterable (const Mesh &mesh, const Simplex &simplex, const bool retrieve_intermediate_tuple=false)
 
Iterator begin ()
 
Iterator end ()
 

Private Attributes

const Meshm_mesh
 
const Simplex m_simplex
 
bool m_retrieve_intermediate_tuple = false
 
wmtk::utils::DynamicArray< Tuplem_q
 
int64_t m_q_front = 0
 
simplex::internal::VisitedArray< int64_t > m_visited
 

Detailed Description

Iterating through the d-simplices of a mesh can be done in different ways, depending on the simplex dimension x around which the iteration is done.

More precisely, the type of iteration depends on the depth = d - x.

  • depth 0: no iteration necessary
  • depth 1: there are at most 2 d-simplices
  • depth 2: circular iteration
  • depth 3: breadth first search

Iteration for depth 0 and 1 are straight forward. Depth 3 is also rather simple as an entire breadth first search must be performed.

Depth 2 is more complex, especially because the input simplex could be on the boundary. To reach all simplices, iteration is divided in 4 phases:

  • forward: Starting from the input simplex's tuple, use tuple switches of type d-1 and d until either the iteration reaches again the input simplex, or it hits a boundary.
  • intermediate: If the forward iteration stopped at a boundary, the iteration needs to switch to the backward phase. The intermediate phase prepares that by setting the iterator to the input simplex's tuple and performing a d-1 switch.
  • backward: After successful switch, the iteration continues just like in the forward phase until another boundary is hit.
  • end: In this phase, the iteration is ended, is_end = true.

Definition at line 37 of file TopDimensionCofacesIterable.hpp.

Member Enumeration Documentation

◆ IteratorPhase

The IteratorPhase is only used for depth 1 and 2.

Enumerator
Forward 
Intermediate 
Backward 
End 

Definition at line 43 of file TopDimensionCofacesIterable.hpp.

Constructor & Destructor Documentation

◆ TopDimensionCofacesIterable()

wmtk::simplex::TopDimensionCofacesIterable::TopDimensionCofacesIterable ( const Mesh mesh,
const Simplex simplex,
const bool  retrieve_intermediate_tuple = false 
)

Definition at line 11 of file TopDimensionCofacesIterable.cpp.

Member Function Documentation

◆ begin()

Iterator wmtk::simplex::TopDimensionCofacesIterable::begin ( )
inline

Definition at line 118 of file TopDimensionCofacesIterable.hpp.

References m_simplex, and wmtk::simplex::Simplex::tuple().

Here is the call graph for this function:

◆ end()

Iterator wmtk::simplex::TopDimensionCofacesIterable::end ( )
inline

Definition at line 119 of file TopDimensionCofacesIterable.hpp.

Member Data Documentation

◆ m_mesh

const Mesh& wmtk::simplex::TopDimensionCofacesIterable::m_mesh
private

Definition at line 122 of file TopDimensionCofacesIterable.hpp.

◆ m_q

wmtk::utils::DynamicArray<Tuple> wmtk::simplex::TopDimensionCofacesIterable::m_q
private

Definition at line 127 of file TopDimensionCofacesIterable.hpp.

◆ m_q_front

int64_t wmtk::simplex::TopDimensionCofacesIterable::m_q_front = 0
private

Definition at line 128 of file TopDimensionCofacesIterable.hpp.

◆ m_retrieve_intermediate_tuple

bool wmtk::simplex::TopDimensionCofacesIterable::m_retrieve_intermediate_tuple = false
private

Definition at line 125 of file TopDimensionCofacesIterable.hpp.

◆ m_simplex

const Simplex wmtk::simplex::TopDimensionCofacesIterable::m_simplex
private

Definition at line 123 of file TopDimensionCofacesIterable.hpp.

Referenced by begin().

◆ m_visited

simplex::internal::VisitedArray<int64_t> wmtk::simplex::TopDimensionCofacesIterable::m_visited
private

Definition at line 129 of file TopDimensionCofacesIterable.hpp.


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