15 const int64_t substructure_tag_value)
17 , m_substructure_face_tag_handle(substructure_face_tag_handle)
18 , m_substructure_edge_tag_handle(substructure_edge_tag_handle)
19 , m_substructure_tag_value(substructure_tag_value)
27 using namespace simplex;
41 RawSimplexCollection lk_u_0(
link(
mesh(), vertex_u));
42 RawSimplexCollection lk_u_1;
43 RawSimplexCollection lk_u_2;
49 std::vector<Tuple> vertices_dummy_tet =
51 vertices_dummy_tet.emplace_back(
Tuple());
53 RawSimplex dummy_tet(
mesh(), vertices_dummy_tet);
56 RawSimplex opp_dummy_face = dummy_tet.opposite_face(
mesh(), vertex_u.
tuple());
57 lk_u_0.add(opp_dummy_face);
58 lk_u_0.add(opp_dummy_face.faces());
60 RawSimplex raw_f_u(
mesh(), f_u);
62 RawSimplex opp_dummy_edge = raw_f_u.opposite_face(
mesh(), vertex_u.
tuple());
63 lk_u_1.add(opp_dummy_edge);
64 lk_u_1.add(opp_dummy_edge.faces());
68 int64_t u_incident_subset_edges = 0;
72 ++u_incident_subset_edges;
73 std::vector<Tuple> vertices_dummy_tri =
75 vertices_dummy_tri.emplace_back(
Tuple());
77 RawSimplex dummy_tri(
mesh(), vertices_dummy_tri);
78 RawSimplex opp_dummy_edge = dummy_tri.opposite_face(
mesh(), vertex_u.
tuple());
79 lk_u_0.add(opp_dummy_edge);
80 lk_u_0.add(opp_dummy_edge.faces());
82 lk_u_1.add(opp_dummy_edge);
83 lk_u_1.add(opp_dummy_edge.faces());
85 RawSimplex raw_e_u(
mesh(), e_u);
86 lk_u_2.add(raw_e_u.opposite_face(
mesh(), vertex_u.
tuple()));
91 if (u_incident_subset_edges != 0 && u_incident_subset_edges != 2) {
92 lk_u_2.add(RawSimplex({-1}));
95 lk_u_0.sort_and_clean();
96 lk_u_1.sort_and_clean();
97 lk_u_2.sort_and_clean();
101 RawSimplexCollection lk_v_0(
link(
mesh(), vertex_v));
102 RawSimplexCollection lk_v_1;
103 RawSimplexCollection lk_v_2;
109 std::vector<Tuple> vertices_dummy_tet =
111 vertices_dummy_tet.emplace_back(
Tuple());
113 RawSimplex dummy_tet(
mesh(), vertices_dummy_tet);
116 RawSimplex opp_dummy_face = dummy_tet.opposite_face(
mesh(), vertex_v.
tuple());
117 lk_v_0.add(opp_dummy_face);
118 lk_v_0.add(opp_dummy_face.faces());
120 RawSimplex raw_f_u(
mesh(), f_v);
122 RawSimplex opp_dummy_edge = raw_f_u.opposite_face(
mesh(), vertex_v.
tuple());
123 lk_v_1.add(opp_dummy_edge);
124 lk_v_1.add(opp_dummy_edge.faces());
128 int64_t v_incident_subset_edges = 0;
132 ++v_incident_subset_edges;
133 std::vector<Tuple> vertices_dummy_tri =
135 vertices_dummy_tri.emplace_back(
Tuple());
137 RawSimplex dummy_tri(
mesh(), vertices_dummy_tri);
138 RawSimplex opp_dummy_edge = dummy_tri.opposite_face(
mesh(), vertex_v.
tuple());
139 lk_v_0.add(opp_dummy_edge);
140 lk_v_0.add(opp_dummy_edge.faces());
142 lk_v_1.add(opp_dummy_edge);
143 lk_v_1.add(opp_dummy_edge.faces());
145 RawSimplex raw_e_v(
mesh(), e_v);
146 lk_v_2.add(raw_e_v.opposite_face(
mesh(), vertex_v.
tuple()));
151 if (v_incident_subset_edges != 0 && v_incident_subset_edges != 2) {
152 lk_v_2.add(RawSimplex({-1}));
155 lk_v_0.sort_and_clean();
156 lk_v_1.sort_and_clean();
157 lk_v_2.sort_and_clean();
159 if (!RawSimplexCollection::get_intersection(lk_u_2, lk_v_2).simplex_vector().empty()) {
164 RawSimplexCollection lk_e_0(
link(
mesh(), edge_e));
165 RawSimplexCollection lk_e_1;
167 RawSimplex raw_edge_e(
mesh(), edge_e);
172 std::vector<Tuple> vertices_dummy_tet =
174 vertices_dummy_tet.emplace_back(
Tuple());
176 RawSimplex raw_f_e(
mesh(), f_e);
178 RawSimplex dummy_tet(
mesh(), vertices_dummy_tet);
179 RawSimplex dummy_edge = dummy_tet.opposite_face(raw_edge_e);
181 lk_e_0.add(dummy_edge);
182 lk_e_0.add(dummy_edge.faces());
184 lk_e_1.add(raw_f_e.opposite_face(raw_edge_e));
189 RawSimplex dummy_vertex({-1});
190 lk_e_0.add(dummy_vertex);
191 lk_e_1.add(dummy_vertex);
194 lk_e_0.sort_and_clean();
195 lk_e_1.sort_and_clean();
197 RawSimplexCollection intersection_u_v_0 =
198 RawSimplexCollection::get_intersection(lk_u_0, lk_v_0);
199 if (!RawSimplexCollection::are_simplex_collections_equal(intersection_u_v_0, lk_e_0)) {
202 RawSimplexCollection intersection_u_v_1 =
203 RawSimplexCollection::get_intersection(lk_u_1, lk_v_1);
204 if (!RawSimplexCollection::are_simplex_collections_equal(intersection_u_v_1, lk_e_1)) {
const attribute::Accessor< T, Mesh, D > create_const_accessor(const attribute::MeshAttributeHandle &handle) const
Handle that represents attributes for some mesh.
const Mesh & mesh() const
bool before(const simplex::Simplex &input_simplex) const override
TetMeshSubstructureTopologyPreservingInvariant(const Mesh &m, const TypedAttributeHandle< int64_t > &substructure_face_tag_handle, const TypedAttributeHandle< int64_t > &substructure_edge_tag_handle, const int64_t substructure_tag_value)
TypedAttributeHandle< int64_t > m_substructure_edge_tag_handle
TypedAttributeHandle< int64_t > m_substructure_face_tag_handle
int64_t m_substructure_tag_value
const std::vector< Simplex > & simplex_vector() const
Return const reference to the simplex vector.
const Tuple & tuple() const
PrimitiveType primitive_type() const
SimplexCollection open_star(const Mesh &mesh, const Simplex &simplex, const bool sort_and_clean)
SimplexCollection link(const Mesh &mesh, const simplex::Simplex &simplex, const bool sort_and_clean)
std::vector< Simplex > cofaces_single_dimension_simplices(const Mesh &mesh, const Simplex &simplex, PrimitiveType cofaces_type)
std::vector< Tuple > faces_single_dimension_tuples(const Mesh &mesh, const Simplex &simplex, const PrimitiveType face_type)