14 const int64_t substructure_tag_value)
16 , m_substructure_edge_tag_handle(substructure_edge_tag_handle)
17 , m_substructure_tag_value(substructure_tag_value)
25 using namespace simplex;
38 RawSimplexCollection lk_u_0(
link(
mesh(), vertex_u));
39 RawSimplexCollection lk_u_1;
40 RawSimplexCollection lk_u_2;
42 int64_t u_incident_subset_edges = 0;
47 ++u_incident_subset_edges;
49 std::vector<Tuple> vertices_dummy_tri =
51 vertices_dummy_tri.emplace_back(
Tuple());
53 RawSimplex dummy_tri(
mesh(), vertices_dummy_tri);
54 RawSimplex opp_dummy_edge = dummy_tri.opposite_face(
mesh(), vertex_u.
tuple());
55 lk_u_0.add(opp_dummy_edge);
56 lk_u_0.add(opp_dummy_edge.faces());
58 lk_u_1.add(opp_dummy_edge);
59 lk_u_1.add(opp_dummy_edge.faces());
61 RawSimplex raw_e_u(
mesh(), e_u);
62 lk_u_2.add(raw_e_u.opposite_face(
mesh(), vertex_u.
tuple()));
67 if (u_incident_subset_edges != 0 && u_incident_subset_edges != 2) {
68 lk_u_2.add(RawSimplex({-1}));
71 lk_u_0.sort_and_clean();
72 lk_u_1.sort_and_clean();
73 lk_u_2.sort_and_clean();
77 RawSimplexCollection lk_v_0(
link(
mesh(), vertex_v));
78 RawSimplexCollection lk_v_1;
79 RawSimplexCollection lk_v_2;
81 int64_t v_incident_subset_edges = 0;
86 ++v_incident_subset_edges;
88 std::vector<Tuple> vertices_dummy_tri =
90 vertices_dummy_tri.emplace_back(
Tuple());
92 RawSimplex dummy_tri(
mesh(), vertices_dummy_tri);
93 RawSimplex opp_dummy_edge = dummy_tri.opposite_face(
mesh(), vertex_v.
tuple());
94 lk_v_0.add(opp_dummy_edge);
95 lk_v_0.add(opp_dummy_edge.faces());
97 lk_v_1.add(opp_dummy_edge);
98 lk_v_1.add(opp_dummy_edge.faces());
100 RawSimplex raw_e_v(
mesh(), e_v);
101 lk_v_2.add(raw_e_v.opposite_face(
mesh(), vertex_v.
tuple()));
106 if (v_incident_subset_edges != 0 && v_incident_subset_edges != 2) {
107 lk_v_2.add(RawSimplex({-1}));
110 lk_v_0.sort_and_clean();
111 lk_v_1.sort_and_clean();
112 lk_v_2.sort_and_clean();
114 if (!RawSimplexCollection::get_intersection(lk_u_2, lk_v_2).simplex_vector().empty()) {
119 RawSimplexCollection lk_e_0(
link(
mesh(), edge_e));
120 RawSimplexCollection lk_e_1;
122 RawSimplex raw_edge_e(
mesh(), edge_e);
125 RawSimplex dummy_vertex({-1});
126 lk_e_0.add(dummy_vertex);
127 lk_e_1.add(dummy_vertex);
130 lk_e_0.sort_and_clean();
131 lk_e_1.sort_and_clean();
133 RawSimplexCollection intersection_u_v_0 =
134 RawSimplexCollection::get_intersection(lk_u_0, lk_v_0);
135 if (!RawSimplexCollection::are_simplex_collections_equal(intersection_u_v_0, lk_e_0)) {
138 RawSimplexCollection intersection_u_v_1 =
139 RawSimplexCollection::get_intersection(lk_u_1, lk_v_1);
140 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
TriMeshSubstructureTopologyPreservingInvariant(const Mesh &m, const TypedAttributeHandle< int64_t > &substructure_edge_tag_handle, const int64_t substructure_tag_value)
TypedAttributeHandle< int64_t > m_substructure_edge_tag_handle
int64_t m_substructure_tag_value
bool before(const simplex::Simplex &input_simplex) const override
const Tuple & tuple() const
PrimitiveType primitive_type() const
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)