21 std::tuple<std::vector<Tuple>, std::vector<Tuple>>
24 std::vector<Tuple> incident_tets, incident_faces;
26 incident_tets.emplace_back(t);
27 incident_faces.emplace_back(t);
38 bool loop_flag =
false;
51 incident_tets.emplace_back(iter_tuple);
52 incident_faces.emplace_back(iter_tuple);
66 incident_tets.clear();
67 incident_faces.clear();
75 const Tuple last_face_tuple = iter_tuple;
78 incident_tets.emplace_back(iter_tuple);
79 incident_faces.emplace_back(iter_tuple);
83 incident_tets.emplace_back(iter_tuple);
84 incident_faces.emplace_back(iter_tuple);
87 incident_faces.emplace_back(last_face_tuple);
90 return {incident_tets, incident_faces};
97 const Tuple& operating_tuple)
99 , tt_accessor(*m.m_tt_accessor)
100 , tf_accessor(*m.m_tf_accessor)
101 , te_accessor(*m.m_te_accessor)
102 , tv_accessor(*m.m_tv_accessor)
103 , vt_accessor(*m.m_vt_accessor)
104 , et_accessor(*m.m_et_accessor)
105 , ft_accessor(*m.m_ft_accessor)
108 m_operating_tuple = operating_tuple;
110 m_operating_edge_id = m_mesh.id_edge(m_operating_tuple);
111 m_spine_vids[0] = m_mesh.id_vertex(m_operating_tuple);
112 m_spine_vids[1] = m_mesh.id_vertex(m_mesh.switch_vertex(m_operating_tuple));
113 m_operating_face_id = m_mesh.id_face(m_operating_tuple);
114 m_operating_tet_id = m_mesh.id_tet(m_operating_tuple);
116 if (m_mesh.has_child_mesh()) {
127 edge_closed_star_vertices,
133 edge_closed_star_vertices.simplex_vector().size() ==
137 simplex::IdSimplexCollection hash_update_region(m);
138 for (
const simplex::Simplex& v : edge_closed_star_vertices.simplex_vector()) {
144 hash_update_region.sort_and_clean();
146 global_ids_to_potential_tuples.resize(4);
147 simplex::IdSimplexCollection
faces(m_mesh);
148 faces.
reserve(hash_update_region.simplex_vector().size() * 15);
150 for (
const simplex::IdSimplex& t : hash_update_region.simplex_vector()) {
152 const simplex::Simplex s = m.get_simplex(t);
164 for (
const simplex::IdSimplex& s :
faces) {
168 const int64_t index =
static_cast<int64_t
>(s.primitive_type());
169 if (!m.has_child_mesh_in_dimension(index)) {
172 global_ids_to_potential_tuples.at(index).emplace_back(
177 global_ids_to_potential_tuples.at(3).emplace_back(
196 const std::array<std::vector<int64_t>, 4>
202 std::array<std::vector<int64_t>, 4> ids;
210 const std::array<std::vector<int64_t>, 4>
215 std::array<std::vector<int64_t>, 4> ids;
223 const int64_t ear_tid,
224 const int64_t new_tid,
225 const int64_t old_tid,
226 const int64_t common_fid)
228 if (ear_tid < 0)
return;
230 auto ear_tt = tt_accessor.index_access().vector_attribute(ear_tid);
231 auto ear_tf = tf_accessor.index_access().vector_attribute(ear_tid);
232 for (
int i = 0; i < 4; ++i) {
233 if (ear_tt(i) == old_tid) {
235 ear_tf(i) = common_fid;
240 ft_accessor.index_access().scalar_attribute(common_fid) = ear_tid;
246 simplex_ids_to_delete = get_split_simplices_to_delete(m_operating_tuple, m_mesh);
251 assert(new_vids.size() == 1);
252 const int64_t v_new = new_vids[0];
253 m_split_new_vid = v_new;
257 assert(new_eids.size() == 2);
258 std::copy(new_eids.begin(), new_eids.end(), m_split_new_spine_eids.begin());
265 const auto [incident_tets, incident_faces] = get_incident_tets_and_faces(m_operating_tuple);
266 const bool loop_flag = (incident_tets.size() == incident_faces.size());
268 const size_t facet_size = incident_tets.size();
269 std::vector<int64_t> new_facet_ids =
271 assert(new_facet_ids.size() == 2 * facet_size);
272 const size_t face_size = incident_faces.size();
273 std::vector<int64_t> new_face_ids =
275 assert(new_face_ids.size() == 2 * face_size);
278 std::vector<FaceSplitData> new_incident_face_data;
279 for (int64_t i = 0; i < incident_faces.size(); ++i) {
283 fsd.
fid_old = m_mesh.id_face(incident_faces[i]);
285 new_face_ids.begin() + 2 * i,
286 new_face_ids.begin() + 2 * (i + 1),
291 fsd.
eid_rib = splitting_eids[0];
293 new_incident_face_data.emplace_back(fsd);
297 int64_t incident_face_cnt = new_incident_face_data.size();
300 m_incident_tet_datas.clear();
301 for (int64_t i = 0; i < incident_tets.size(); ++i) {
306 tsd.
tid = m_mesh.id_tet(incident_tets[i]);
308 new_facet_ids.begin() + 2 * i,
309 new_facet_ids.begin() + 2 * (i + 1),
311 tsd.
rib_f = split_fids[0];
314 split_facet_data().add_facet(m_mesh, m_operating_tuple, tsd.
split_t);
317 Tuple ear1 = m_mesh.switch_face(m_mesh.switch_edge(incident_tets[i]));
318 if (!m_mesh.is_boundary_face(ear1)) {
320 tsd.
ears[0] =
EarTet{m_mesh.id_tet(ear1), m_mesh.id_face(ear1)};
322 tsd.
ears[0] =
EarTet{-1, m_mesh.id_face(ear1)};
325 Tuple ear2 = m_mesh.switch_face(m_mesh.switch_edge(m_mesh.switch_vertex(incident_tets[i])));
326 if (!m_mesh.is_boundary_face(ear2)) {
328 tsd.
ears[1] =
EarTet{m_mesh.id_tet(ear2), m_mesh.id_face(ear2)};
330 tsd.
ears[1] =
EarTet{-1, m_mesh.id_face(ear2)};
334 new_incident_face_data[(i + incident_face_cnt - 1) % incident_face_cnt];
343 tsd.
v0 = m_mesh.id_vertex(incident_tets[i]);
344 tsd.
v1 = m_mesh.id_vertex(m_mesh.switch_vertex(incident_tets[i]));
345 tsd.
v2 = m_mesh.id_vertex(m_mesh.switch_vertex(
346 m_mesh.switch_edge(m_mesh.switch_face(incident_tets[i]))));
347 tsd.
v3 = m_mesh.id_vertex(
348 m_mesh.switch_vertex(m_mesh.switch_edge(incident_tets[i])));
350 tsd.
e01 = m_mesh.id_edge(incident_tets[i]);
351 tsd.
e03 = m_mesh.id_edge(m_mesh.switch_edge(incident_tets[i]));
352 tsd.
e13 = m_mesh.id_edge(
353 m_mesh.switch_edge(m_mesh.switch_vertex(incident_tets[i])));
354 tsd.
e02 = m_mesh.id_edge(
355 m_mesh.switch_edge(m_mesh.switch_face(incident_tets[i])));
356 tsd.
e12 = m_mesh.id_edge(m_mesh.switch_edge(
357 m_mesh.switch_face(m_mesh.switch_vertex(incident_tets[i]))));
358 tsd.
e23 = m_mesh.id_edge(m_mesh.switch_edge(m_mesh.switch_vertex(
359 m_mesh.switch_face(m_mesh.switch_edge(incident_tets[i])))));
361 m_incident_tet_datas.emplace_back(tsd);
365 m_incident_face_datas.clear();
366 for (int64_t i = 0; i < m_incident_tet_datas.size(); ++i) {
367 auto& data = m_incident_face_datas.emplace_back();
368 data.fid = m_incident_tet_datas[i].new_face_data[1].fid_old;
369 data.ear_eids[0] = m_incident_tet_datas[i].e03;
370 data.ear_eids[1] = m_incident_tet_datas[i].e13;
371 data.new_edge_id = m_incident_tet_datas[i].new_face_data[1].eid_rib;
372 data.split_f[0] = m_incident_tet_datas[i].new_face_data[1].fid_new[0];
373 data.split_f[1] = m_incident_tet_datas[i].new_face_data[1].fid_new[1];
374 data.local_operating_tuple = m_incident_tet_datas[i].new_face_data[1].local_operating_tuple;
378 auto& data = m_incident_face_datas.emplace_back();
379 data.fid = m_incident_tet_datas[0].new_face_data[0].fid_old;
380 data.ear_eids[0] = m_incident_tet_datas[0].e02;
381 data.ear_eids[1] = m_incident_tet_datas[0].e12;
382 data.new_edge_id = m_incident_tet_datas[0].new_face_data[0].eid_rib;
383 data.split_f[0] = m_incident_tet_datas[0].new_face_data[0].fid_new[0];
384 data.split_f[1] = m_incident_tet_datas[0].new_face_data[0].fid_new[1];
385 data.local_operating_tuple = m_incident_tet_datas[0].new_face_data[0].local_operating_tuple;
388 assert(m_incident_face_datas.size() == new_incident_face_data.size());
392 for (int64_t i = 0; i < m_incident_face_datas.size(); ++i) {
393 assert(m_incident_face_datas[i].fid == new_incident_face_data[i].fid_old);
399 int64_t return_local_vid = -1;
400 int64_t return_local_eid = -1;
401 int64_t return_local_fid = -1;
402 int64_t return_tid = -1;
406 int64_t return_fid = -1;
407 int64_t return_split_fid = -1;
411 for (int64_t i = 0; i < m_incident_tet_datas.size(); ++i) {
413 const auto& data = m_incident_tet_datas[i];
414 const int64_t vid_new = v_new;
415 const int64_t v0 = data.v0;
416 const int64_t v1 = data.v1;
417 const int64_t v2 = data.v2;
418 const int64_t v3 = data.v3;
419 const int64_t e_spine_1 = new_eids[0];
420 const int64_t e_spine_2 = new_eids[1];
421 const int64_t e_rib_1 = data.new_face_data[0].eid_rib;
422 const int64_t e_rib_2 = data.new_face_data[1].eid_rib;
423 const int64_t e01 = data.e01;
424 const int64_t e02 = data.e02;
425 const int64_t e12 = data.e12;
426 const int64_t e03 = data.e03;
427 const int64_t e13 = data.e13;
428 const int64_t e23 = data.e23;
429 const int64_t f_ear_1 = data.ears[0].fid;
430 const int64_t f_ear_2 = data.ears[1].fid;
431 const int64_t f1 = data.new_face_data[0].fid_new[0];
432 const int64_t f2 = data.new_face_data[0].fid_new[1];
433 const int64_t f_old_1 = data.new_face_data[0].fid_old;
434 const int64_t f3 = data.new_face_data[1].fid_new[0];
435 const int64_t f4 = data.new_face_data[1].fid_new[1];
436 const int64_t f_old_2 = data.new_face_data[1].fid_old;
437 const int64_t f_rib = data.rib_f;
438 const int64_t t_ear_1 = data.ears[0].tid;
439 const int64_t t_ear_2 = data.ears[1].tid;
440 const int64_t t1 = data.split_t[0];
441 const int64_t t2 = data.split_t[1];
442 const int64_t t_old = data.tid;
510 bool return_flag =
false;
511 if (t_old == m_operating_tet_id) {
514 logger().trace(
"split fid is {}", f_rib);
515 logger().trace(
"fids {} {} are joined by edge {}", f3, f4, e_rib_2);
518 return_split_fid = f_rib;
522 int64_t prev_index = (i - 1 + m_incident_tet_datas.size()) % m_incident_tet_datas.size();
523 int64_t next_index = (i + 1 + m_incident_tet_datas.size()) % m_incident_tet_datas.size();
526 t_f1 = m_incident_tet_datas[prev_index].split_t[0];
527 t_f2 = m_incident_tet_datas[prev_index].split_t[1];
528 t_f3 = m_incident_tet_datas[next_index].split_t[0];
529 t_f4 = m_incident_tet_datas[next_index].split_t[1];
531 if (m_incident_tet_datas.size() == 1) {
542 t_f1 = m_incident_tet_datas[prev_index].split_t[0];
543 t_f2 = m_incident_tet_datas[prev_index].split_t[1];
545 if (i == m_incident_tet_datas.size() - 1) {
550 t_f3 = m_incident_tet_datas[next_index].split_t[0];
551 t_f4 = m_incident_tet_datas[next_index].split_t[1];
559 update_ear_connectivity(t_ear_1, t1, t_old, f_ear_1);
561 auto tt = tt_accessor.index_access().vector_attribute(t1);
562 auto tf = tf_accessor.index_access().vector_attribute(t1);
563 auto te = te_accessor.index_access().vector_attribute(t1);
564 auto tv = tv_accessor.index_access().vector_attribute(t1);
580 tt = tt_accessor.index_access().vector_attribute(t_old);
581 tf = tf_accessor.index_access().vector_attribute(t_old);
582 te = te_accessor.index_access().vector_attribute(t_old);
583 tv = tv_accessor.index_access().vector_attribute(t_old);
588 for (
int k = 0; k < 4; ++k) {
590 if (tv(k) == m_spine_vids[0]) {
591 return_local_vid = k;
595 if (tf(k) == m_operating_face_id) {
596 return_local_fid = k;
601 for (
int k = 0; k < 6; ++k) {
603 return_local_eid = k;
610 for (
size_t k = 0; k < 4; ++k) {
617 if (tf(k) == f_old_1) {
619 m_incident_tet_datas[i].incident_face_local_fid[0] = k;
624 if (tf(k) == f_old_2) {
626 m_incident_tet_datas[i].incident_face_local_fid[1] = k;
631 if (tf(k) == f_ear_2) {
637 for (
size_t k = 0; k < 6; ++k) {
654 update_ear_connectivity(t_ear_2, t2, t_old, f_ear_2);
656 auto tt = tt_accessor.index_access().vector_attribute(t2);
657 auto tf = tf_accessor.index_access().vector_attribute(t2);
658 auto te = te_accessor.index_access().vector_attribute(t2);
659 auto tv = tv_accessor.index_access().vector_attribute(t2);
675 tt = tt_accessor.index_access().const_vector_attribute(t_old);
676 tf = tf_accessor.index_access().const_vector_attribute(t_old);
677 te = te_accessor.index_access().const_vector_attribute(t_old);
678 tv = tv_accessor.index_access().const_vector_attribute(t_old);
679 for (
size_t k = 0; k < 4; ++k) {
686 if (tf(k) == f_old_1) {
690 if (tf(k) == f_old_2) {
694 if (tf(k) == f_ear_1) {
700 for (
size_t k = 0; k < 6; ++k) {
715 ft_accessor.index_access().scalar_attribute(f_ear_1) = t1;
716 ft_accessor.index_access().scalar_attribute(f_ear_2) = t2;
717 ft_accessor.index_access().scalar_attribute(f1) = t1;
718 ft_accessor.index_access().scalar_attribute(f2) = t2;
719 ft_accessor.index_access().scalar_attribute(f3) = t1;
720 ft_accessor.index_access().scalar_attribute(f4) = t2;
721 ft_accessor.index_access().scalar_attribute(f_rib) = t1;
724 et_accessor.index_access().scalar_attribute(e02) = t1;
725 et_accessor.index_access().scalar_attribute(e12) = t2;
726 et_accessor.index_access().scalar_attribute(e03) = t1;
727 et_accessor.index_access().scalar_attribute(e13) = t2;
728 et_accessor.index_access().scalar_attribute(e23) = t1;
729 et_accessor.index_access().scalar_attribute(e_spine_1) = t1;
730 et_accessor.index_access().scalar_attribute(e_spine_2) = t2;
731 et_accessor.index_access().scalar_attribute(e_rib_1) = t1;
732 et_accessor.index_access().scalar_attribute(e_rib_2) = t1;
735 vt_accessor.index_access().scalar_attribute(v0) = t1;
736 vt_accessor.index_access().scalar_attribute(v1) = t2;
737 vt_accessor.index_access().scalar_attribute(v2) = t1;
738 vt_accessor.index_access().scalar_attribute(v3) = t1;
739 vt_accessor.index_access().scalar_attribute(vid_new) = t1;
748 assert(return_tid > -1);
749 assert(return_local_vid > -1);
750 assert(return_local_eid > -1);
751 assert(return_local_fid > -1);
756 m_output_tuple =
Tuple(return_local_vid, return_local_eid, return_local_fid, return_tid);
771 assert(!m_mesh.is_boundary_face(m_mesh.switch_tuples(m_output_tuple, {PE, PF})));
778 simplex_ids_to_delete = get_collapse_simplices_to_delete(m_operating_tuple, m_mesh);
796 auto [incident_tets, incident_faces] = get_incident_tets_and_faces(m_operating_tuple);
799 for (
const Tuple& tet : incident_tets) {
802 tcd.
tid = m_mesh.id_tet(tet);
805 Tuple ear1 = m_mesh.switch_face(m_mesh.switch_edge(tet));
806 if (!m_mesh.is_boundary_face(ear1)) {
808 tcd.
ears[0] =
EarTet{m_mesh.id_tet(ear1), m_mesh.id_face(ear1)};
810 tcd.
ears[0] =
EarTet{-1, m_mesh.id_face(ear1)};
813 Tuple ear2 = m_mesh.switch_face(m_mesh.switch_edge(m_mesh.switch_vertex(tet)));
814 if (!m_mesh.is_boundary_face(ear2)) {
816 tcd.
ears[1] =
EarTet{m_mesh.id_tet(ear2), m_mesh.id_face(ear2)};
818 tcd.
ears[1] =
EarTet{-1, m_mesh.id_face(ear2)};
821 tcd.
v0 = m_mesh.id_vertex(tet);
822 tcd.
v1 = m_mesh.id_vertex(m_mesh.switch_vertex(tet));
824 m_mesh.id_vertex(m_mesh.switch_vertex(m_mesh.switch_edge(m_mesh.switch_face(tet))));
825 tcd.
v3 = m_mesh.id_vertex(m_mesh.switch_vertex(m_mesh.switch_edge(tet)));
827 tcd.
e01 = m_mesh.id_edge(tet);
828 tcd.
e03 = m_mesh.id_edge(m_mesh.switch_edge(tet));
829 tcd.
e13 = m_mesh.id_edge(m_mesh.switch_edge(m_mesh.switch_vertex(tet)));
830 tcd.
e02 = m_mesh.id_edge(m_mesh.switch_edge(m_mesh.switch_face(tet)));
831 tcd.
e12 = m_mesh.id_edge(m_mesh.switch_edge(m_mesh.switch_face(m_mesh.switch_vertex(tet))));
832 tcd.
e23 = m_mesh.id_edge(
833 m_mesh.switch_edge(m_mesh.switch_vertex(m_mesh.switch_face(m_mesh.switch_edge(tet)))));
835 m_incident_tet_datas.emplace_back(tcd);
839 m_incident_face_datas.clear();
840 for (int64_t i = 0; i < m_incident_tet_datas.size(); ++i) {
841 auto& data = m_incident_face_datas.emplace_back();
842 data.ear_eids[0] = m_incident_tet_datas[i].e03;
843 data.ear_eids[1] = m_incident_tet_datas[i].e13;
844 data.new_edge_id = data.ear_eids[1];
847 if (incident_tets.size() != incident_faces.size()) {
848 auto& data = m_incident_face_datas.emplace_back();
849 data.ear_eids[0] = m_incident_tet_datas[0].e02;
850 data.ear_eids[1] = m_incident_tet_datas[0].e12;
851 data.new_edge_id = data.ear_eids[1];
854 assert(m_incident_face_datas.size() == incident_faces.size());
858 int64_t return_local_vid = -1;
859 int64_t return_local_eid = -1;
860 int64_t return_local_fid = -1;
861 int64_t return_tid = -1;
863 std::map<int64_t, int64_t> edge_replacement;
868 const int64_t v0 = data.v0;
869 const int64_t v1 = data.v1;
870 const int64_t v2 = data.v2;
871 const int64_t v3 = data.v3;
872 const int64_t e01 = data.e01;
873 const int64_t e02 = data.e02;
874 const int64_t e12 = data.e12;
875 const int64_t e03 = data.e03;
876 const int64_t e13 = data.e13;
877 const int64_t e23 = data.e23;
878 const int64_t f_ear_1 = data.ears[0].fid;
879 const int64_t f_ear_2 = data.ears[1].fid;
880 const int64_t t_ear_1 = data.ears[0].tid;
881 const int64_t t_ear_2 = data.ears[1].tid;
882 const int64_t t_old = data.tid;
884 edge_replacement[e02] = e12;
885 edge_replacement[e03] = e13;
918 assert(t_ear_1 > -1 || t_ear_2 > -1);
921 bool return_flag =
false;
922 if (t_old == m_operating_tet_id) {
926 return_tid = (t_ear_2 > -1) ? t_ear_2 : t_ear_1;
940 auto tt = tt_accessor.index_access().vector_attribute(t_ear_1);
941 auto tf = tf_accessor.index_access().vector_attribute(t_ear_1);
942 auto te = te_accessor.index_access().vector_attribute(t_ear_1);
943 auto tv = tv_accessor.index_access().vector_attribute(t_ear_1);
946 if (return_flag && return_tid == t_ear_1) {
947 for (
int k = 0; k < 4; ++k) {
949 if (tf(k) == f_ear_1) {
950 return_local_fid = k;
955 return_local_vid = k;
959 for (
int k = 0; k < 6; ++k) {
962 return_local_eid = k;
970 for (
int k = 0; k < 4; ++k) {
971 if (tf(k) == f_ear_1) {
972 assert(tt(k) == t_old);
979 for (
int k = 0; k < 6; ++k) {
991 auto tt = tt_accessor.index_access().vector_attribute(t_ear_2);
992 auto tf = tf_accessor.index_access().vector_attribute(t_ear_2);
993 auto te = te_accessor.index_access().vector_attribute(t_ear_2);
994 auto tv = tv_accessor.index_access().vector_attribute(t_ear_2);
998 if (return_flag && return_tid == t_ear_2) {
999 for (
int k = 0; k < 4; ++k) {
1001 return_local_vid = k;
1003 if (tf(k) == f_ear_2) {
1004 return_local_fid = k;
1008 for (
int k = 0; k < 6; ++k) {
1010 return_local_eid = k;
1016 for (
int k = 0; k < 4; ++k) {
1017 if (tt(k) == t_old) {
1024 const int64_t t_ear_valid = (t_ear_2 > -1) ? t_ear_2 : t_ear_1;
1027 data.merged_face_tid = t_ear_valid;
1029 ft_accessor.index_access().scalar_attribute(f_ear_2) = t_ear_valid;
1031 data.new_face_id = f_ear_2;
1034 et_accessor.index_access().scalar_attribute(e12) = t_ear_valid;
1035 et_accessor.index_access().scalar_attribute(e13) = t_ear_valid;
1036 et_accessor.index_access().scalar_attribute(e23) = t_ear_valid;
1039 vt_accessor.index_access().scalar_attribute(v1) = t_ear_valid;
1040 vt_accessor.index_access().scalar_attribute(v2) = t_ear_valid;
1041 vt_accessor.index_access().scalar_attribute(v3) = t_ear_valid;
1046 const int64_t v0 = m_spine_vids[0];
1047 const int64_t v1 = m_spine_vids[1];
1051 const int64_t tid = m_mesh.id(t);
1052 auto tv = tv_accessor.index_access().vector_attribute(tid);
1053 auto te = te_accessor.index_access().vector_attribute(tid);
1054 for (
int i = 0; i < 4; ++i) {
1060 for (
int i = 0; i < 6; ++i) {
1061 if (edge_replacement.find(te(i)) != edge_replacement.end()) {
1062 te(i) = edge_replacement[te(i)];
1072 assert(m_mesh.is_connectivity_valid());
1073 assert(return_tid > -1);
1074 assert(return_local_fid > -1);
1075 assert(return_local_eid > -1);
1076 assert(return_local_vid > -1);
1077 m_output_tuple =
Tuple(return_local_vid, return_local_eid, return_local_fid, return_tid);
1079 assert(m_mesh.id_vertex(m_output_tuple) == v1);
1086 m_mesh.guarantee_more_attributes(type, count);
1088 return m_mesh.request_simplex_indices(type, count);
std::vector< int64_t > request_simplex_indices(PrimitiveType type, int64_t count)
const attribute::Accessor< char > get_flag_accessor(PrimitiveType type) const
std::tuple< std::vector< Tuple >, std::vector< Tuple > > get_incident_tets_and_faces(Tuple t)
Get the incident tets and faces for an edge tuple.
std::vector< int64_t > request_simplex_indices(const PrimitiveType type, int64_t count)
void collapse_edge()
split edge v1-v2
static const std::array< std::vector< int64_t >, 4 > get_split_simplices_to_delete(const Tuple &tuple, const TetMesh &m)
gather all simplices that are deleted in a split
static const std::array< std::vector< int64_t >, 4 > get_collapse_simplices_to_delete(const Tuple &tuple, const TetMesh &m)
gather all simplices that are deleted in a collapse
void update_ear_connectivity(const int64_t ear_tid, const int64_t new_tid, const int64_t old_tid, const int64_t common_fid)
std::array< attribute::Accessor< char >, 4 > flag_accessors
TetMeshOperationExecutor(TetMesh &m, const Tuple &operating_tuple)
void split_edge()
split edge v1-v2
Tuple switch_face(const Tuple &tuple) const
int64_t id(const Tuple &tuple, PrimitiveType type) const
int64_t id_tet(const Tuple &tuple) const
Tuple switch_tetrahedron(const Tuple &tuple) const
bool is_boundary_face(const Tuple &tuple) const
std::array< std::vector< int64_t >, 4 > simplex_ids_to_delete
void add(const IdSimplex &simplex)
Add simplex to the collection.
void reserve(const size_t new_cap)
void reserve(const size_t new_cap)
void add(const Simplex &simplex)
Add simplex to the collection.
void sort_and_clean()
Sort simplex vector and remove duplicates.
static Simplex face(const Mesh &m, const Tuple &t)
static Simplex edge(const Mesh &m, const Tuple &t)
static Simplex tetrahedron(const Mesh &m, const Tuple &t)
static Simplex vertex(const Mesh &m, const Tuple &t)
static int8_t local_eid(const Tuple &t)
static int8_t local_vid(const Tuple &t)
static int8_t local_fid(const Tuple &t)
constexpr wmtk::PrimitiveType PF
void top_dimension_cofaces_tuples(const PointMesh &mesh, const Simplex &simplex, SimplexCollection &collection)
TopDimensionCofacesIterable top_dimension_cofaces_iterable(const Mesh &mesh, const Simplex &simplex)
SimplexCollection open_star(const Mesh &mesh, const Simplex &simplex, const bool sort_and_clean)
LinkSingleDimensionIterable link_single_dimension_iterable(const Mesh &mesh, const Simplex &simplex, const PrimitiveType link_type)
HalfClosedStarIterable half_closed_star_iterable(const Mesh &mesh, const Tuple &tuple)
The half closed star is used to determine the deleted simplices in an edge collapse.
SimplexCollection faces_single_dimension(const Mesh &mesh, const Simplex &simplex, const PrimitiveType face_type)
Returns a vector with all faces in the boundary of a simplex of the given dimension.
SimplexCollection faces(const Mesh &mesh, const Simplex &simplex, const bool sort_and_clean)
Returns all faces of a simplex.
constexpr int8_t get_primitive_type_id(PrimitiveType t)
Get a unique integer id corresponding to each primitive type.
spdlog::logger & logger()
Retrieves the current logger.
constexpr PrimitiveType PE
An EarTet is a neighbor of a tet to be deleted in the split/collapse operation.
std::array< int64_t, 2 > fid_new
std::array< int64_t, 2 > eid_spine_new
Tuple local_operating_tuple
Data on the incident tets of the operating edge.
Tuple local_operating_tuple
std::array< int64_t, 2 > split_t
std::array< FaceSplitData, 2 > new_face_data
std::array< int64_t, 2 > incident_face_data_idx
std::array< EarTet, 2 > ears