Wildmeshing Toolkit
CofacesSingleDimensionIterable.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <queue>
4 
5 #include <wmtk/Mesh.hpp>
10 
12 
13 namespace wmtk::simplex {
14 
24 {
25 public:
26  class Iterator
27  {
28  public:
29  Iterator(CofacesSingleDimensionIterable& container, const Tuple& t = Tuple());
31  bool operator!=(const Iterator& other) const;
32  Tuple& operator*();
33  const Tuple& operator*() const;
34 
35  private:
41  int64_t depth();
45  bool is_coface_d0();
46 
50  void init();
51 
57 
58  private:
61  int8_t m_edge_counter = 0;
62  };
63 
64 public:
66  const Mesh& mesh,
67  const Simplex& simplex,
68  const PrimitiveType cofaces_type);
69 
70  Iterator begin() { return Iterator(*this, m_simplex.tuple()); }
71  Iterator end() { return Iterator(*this); }
72 
73 private:
74  const Mesh& m_mesh;
79 
81 };
82 
83 } // namespace wmtk::simplex
int64_t depth()
Compute the depth from the mesh and the simplex type.
Iterator & step_depth_3()
Use breadth first search to find all d-simplices, and iterate through all cofaces in a d-simplex.
void init()
Depending on the depth, the iterator must be initialized differently.
Iterator(CofacesSingleDimensionIterable &container, const Tuple &t=Tuple())
bool is_coface_d0()
Check if coface type is the mesh's top simplex type.
This iterator internally uses TopDimensionCofacesIterable.
simplex::internal::VisitedArray< simplex::IdSimplex > m_visited_cofaces
CofacesSingleDimensionIterable(const Mesh &mesh, const Simplex &simplex, const PrimitiveType cofaces_type)
const Tuple & tuple() const
Definition: Simplex.hpp:53
Iterating through the d-simplices of a mesh can be done in different ways, depending on the simplex d...