9 const bool retrieve_intermediate_tuple)
12 , m_retrieve_intermediate_tuple(retrieve_intermediate_tuple)
18 : m_container(container)
32 case 0:
return step_depth_0();
33 case 1:
return step_depth_1();
34 case 2:
return step_depth_2();
35 case 3:
return step_depth_3();
46 return m_t != other.
m_t;
66 const Mesh& mesh = m_container.m_mesh;
76 const Mesh& mesh = m_container.m_mesh;
87 }
else if (depth == 3) {
89 m_container.m_visited.is_visited(m_t.global_cid());
91 add_neighbors_to_queue();
103 const Mesh& mesh = m_container.m_mesh;
118 const Mesh& mesh = m_container.m_mesh;
121 m_is_intermediate =
false;
132 if (m_container.m_retrieve_intermediate_tuple) {
133 m_is_intermediate =
true;
145 if (m_t == simplex.
tuple()) {
163 const Mesh& mesh = m_container.m_mesh;
164 auto& q = m_container.m_q;
165 auto& q_front = m_container.m_q_front;
167 if (q_front == q.size()) {
174 add_neighbors_to_queue();
182 const Mesh& mesh = m_container.m_mesh;
189 for (
size_t i = 0; i < 3; ++i) {
194 if (!m_container.m_visited.is_visited(neigh_id)) {
195 m_container.m_q.emplace_back(neigh);
204 return m_is_intermediate;
bool is_boundary(const simplex::Simplex &tuple) const
check if a simplex lies on a boundary or not
Tuple switch_tuples(const Tuple &tuple, const ContainerType &op_sequence) const
int64_t top_cell_dimension() const
virtual Tuple switch_tuple(const Tuple &tuple, PrimitiveType type) const =0
switch the orientation of the Tuple of the given dimension
PrimitiveType top_simplex_type() const
The Tuple is the basic navigation tool in our mesh data structure.
bool is_null() const
Checks if a tuple is "null". This merely implies the global index is -1.
int64_t global_cid() const
const Tuple & tuple() const
PrimitiveType primitive_type() const
Iterator & step_depth_1()
There are at max two d-simplices.
PrimitiveType pt(int64_t depth) const
Get the d - depth primitive type.
Iterator & step_depth_0()
Just return the simplex and stop.
void add_neighbors_to_queue()
bool is_intermediate() const
int64_t depth()
Compute the depth from the mesh and the simplex type.
Iterator(TopDimensionCofacesIterable &container, const Tuple &t=Tuple())
bool operator!=(const Iterator &other) const
void init(int64_t depth)
Depending on the depth, the iterator must be initialized differently.
Iterator & step_depth_2()
Iterate around simplex to find all d-simplices.
Iterator & step_depth_3()
Use breadth first search to find all d-simplices.
Iterating through the d-simplices of a mesh can be done in different ways, depending on the simplex d...
IteratorPhase
The IteratorPhase is only used for depth 1 and 2.
TopDimensionCofacesIterable(const Mesh &mesh, const Simplex &simplex, const bool retrieve_intermediate_tuple=false)
constexpr PrimitiveType get_primitive_type_from_id(int8_t id)
Get the primitive type corresponding to its unique integer id.
constexpr int8_t get_primitive_type_id(PrimitiveType t)
Get a unique integer id corresponding to each primitive type.