Wildmeshing Toolkit
Loading...
Searching...
No Matches
ClosedStarIterable.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <wmtk/Mesh.hpp>
7
9
10namespace wmtk::simplex {
11
17{
18public:
20
22 {
23 public:
24 Iterator(ClosedStarIterable& container, const Tuple& t = Tuple());
26 bool operator!=(const Iterator& other) const;
28 const IdSimplex operator*() const;
29
30 private:
36 int64_t depth();
37
41 void init();
42
48
52
54
55 bool step_faces();
56 bool step_faces_edge();
59
60 private:
62 const Mesh& m_mesh;
63
66 int8_t m_pt = -1;
67 int8_t m_face_counter = 0;
69 };
70
71public:
72 ClosedStarIterable(const Mesh& mesh, const Simplex& simplex);
73
74 Iterator begin() { return Iterator(*this, m_simplex.tuple()); }
75 Iterator end() { return Iterator(*this); }
76
77private:
78 const Mesh& m_mesh;
82
83 std::array<simplex::internal::VisitedArray<simplex::IdSimplex>, 2>
84 m_visited_cofaces; // for depth 3 iteration
85 std::array<simplex::internal::VisitedArray<simplex::IdSimplex>, 2>
86 m_visited_link; // for depth 3 iteration
87};
88
89} // namespace wmtk::simplex
The Tuple is the basic navigation tool in our mesh data structure.
Definition Tuple.hpp:19
TopDimensionCofacesIterable::Iterator m_it
Iterator & step_depth_3()
Use breadth first search to find all d-simplices, and iterate through all cofaces in a d-simplex.
bool operator!=(const Iterator &other) const
int64_t depth()
Compute the depth from the mesh and the simplex type.
void init()
Depending on the depth, the iterator must be initialized differently.
This iterator internally uses TopDimensionCofacesIterable.
std::array< simplex::internal::VisitedArray< simplex::IdSimplex >, 2 > m_visited_cofaces
TopDimensionCofacesIterable m_tdc_itrbl
TopDimensionCofacesIterable::Iterator m_it_end
std::array< simplex::internal::VisitedArray< simplex::IdSimplex >, 2 > m_visited_link
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...