343 std::array<size_t, 2> vids{{
e.vid(*
this),
e.switch_vertex(*this).vid(*
this)}};
372 edge_attr(e.eid(*
this)) = old_edges.at(vids);
383 const auto &[old_v0_id, old_v0] =
op_cache->v0();
384 const auto &[old_v1_id, old_v1] =
op_cache->v1();
385 const auto &old_edges =
op_cache->edges();
387 const size_t new_vid = t.vid(*
this);
389 const std::vector<Tuple> one_ring_edges = get_one_ring_edges_for_vertex(t);
390 for (
const Tuple &e : one_ring_edges)
392 const size_t e_id =
e.eid(*
this);
394 size_t v0_id =
e.vid(*
this);
395 size_t v1_id =
e.switch_vertex(*this).vid(*
this);
397 std::swap(v0_id, v1_id);
398 assert(v1_id == new_vid);
400 const std::array<size_t, 2> old_edge0{{v0_id, old_v0_id}};
401 const std::array<size_t, 2> old_edge1{{v0_id, old_v1_id}};
402 const auto find_old_edge0 = old_edges.find(old_edge0);
403 const auto find_old_edge1 = old_edges.find(old_edge1);
405 if (find_old_edge0 != old_edges.end() && find_old_edge1 != old_edges.end())
408 assert(!(find_old_edge0->second.boundary_id >= 0 && find_old_edge1->second.boundary_id >= 0));
410 find_old_edge0->second.boundary_id, find_old_edge1->second.boundary_id);
412 find_old_edge0->second.energy_rank, find_old_edge1->second.energy_rank);
414 std::max(find_old_edge0->second.op_depth, find_old_edge1->second.op_depth);
416 else if (find_old_edge0 != old_edges.end())
418 else if (find_old_edge1 != old_edges.end())
438 const auto &[old_v0_id, old_v0] =
op_cache->v0();
439 const auto &[old_v1_id, old_v1] =
op_cache->v1();
440 const auto &old_faces =
op_cache->faces();
442 const size_t new_vid = t.vid(*
this);
446 assert(
f.is_boundary_face(*
this));
447 const size_t f_id =
f.fid(*
this);
449 const std::array<Tuple, 3> fv = get_face_vertices(f);
450 std::array<size_t, 3> vids{{fv[0].vid(*
this), fv[1].vid(*
this), fv[2].vid(*
this)}};
451 auto iter = std::find(vids.begin(), vids.end(), new_vid);
452 assert(iter != vids.end());
455 const auto find_old_face0 = old_faces.find(vids);
457 const auto find_old_face1 = old_faces.find(vids);
459 if (find_old_face0 != old_faces.end() && find_old_face1 != old_faces.end())
462 assert(!(find_old_face0->second.boundary_id >= 0 && find_old_face1->second.boundary_id >= 0));
464 find_old_face0->second.boundary_id, find_old_face1->second.boundary_id);
466 else if (find_old_face0 != old_faces.end())
468 else if (find_old_face1 != old_faces.end())
499 template class WildRemesher<wmtk::TriMesh>;
500 template class WildRemesher<wmtk::TetMesh>;
501 template class PhysicsRemesher<wmtk::TriMesh>;
502 template class PhysicsRemesher<wmtk::TetMesh>;