7 void insert_edges_of_face(
10 WildTriRemesher::EdgeMap<TriOperationCache::EdgeAttributes> &edge_map)
12 for (
auto i = 0; i < 3; i++)
15 const size_t v0 =
e.vid(m);
16 const size_t v1 =
e.switch_vertex(m).vid(m);
17 edge_map[{{v0, v1}}] = m.boundary_attrs[
e.eid(m)];
21 void insert_edges_of_tet(
24 WildTriRemesher::EdgeMap<TetOperationCache::EdgeAttributes> &edge_map)
26 for (
auto i = 0; i < 6; i++)
29 const size_t v0 =
e.vid(m);
30 const size_t v1 =
e.switch_vertex(m).vid(m);
31 edge_map[{{v0, v1}}] = m.edge_attr(
e.eid(m));
35 void insert_faces_of_tet(
38 WildTetRemesher::FaceMap<TetOperationCache::FaceAttributes> &face_map)
40 for (
auto i = 0; i < 4; i++)
43 std::array<WildTetRemesher::Tuple, 3> vs = m.get_face_vertices(f);
44 face_map[{{vs[0].vid(m), vs[1].vid(m), vs[2].vid(m)}}] = m.boundary_attrs[
f.fid(m)];
51 std::shared_ptr<TriOperationCache>
cache = std::make_shared<TriOperationCache>();
53 cache->m_v0.first = t.vid(m);
54 cache->m_v1.first = t.switch_vertex(m).vid(m);
59 insert_edges_of_face(m, t,
cache->m_edges);
64 const Tuple t1 = t.switch_face(m).value();
65 insert_edges_of_face(m, t1,
cache->m_edges);
76 std::shared_ptr<TriOperationCache>
cache = std::make_shared<TriOperationCache>();
78 cache->m_v0.first = t.vid(m);
79 cache->m_v1.first = t.switch_vertex(m).vid(m);
85 std::vector<Tuple> edge_one_ring_faces = m.get_one_ring_tris_for_vertex(t);
86 const std::vector<Tuple> tmp = m.get_one_ring_tris_for_vertex(t.switch_vertex(m));
87 edge_one_ring_faces.reserve(edge_one_ring_faces.size() + tmp.size());
88 edge_one_ring_faces.insert(edge_one_ring_faces.end(), tmp.begin(), tmp.end());
90 for (
const auto &face : edge_one_ring_faces)
92 insert_edges_of_face(m, face,
cache->m_edges);
107 std::shared_ptr<TriOperationCache>
cache = std::make_shared<TriOperationCache>();
109 cache->m_v0.first = t.vid(m);
110 cache->m_v1.first = t.switch_vertex(m).vid(m);
115 insert_edges_of_face(m, t,
cache->m_edges);
118 assert(t.switch_face(m));
119 const Tuple t1 = t.switch_face(m).value();
120 insert_edges_of_face(m, t1,
cache->m_edges);
130 std::shared_ptr<TetOperationCache>
cache = std::make_shared<TetOperationCache>();
132 cache->m_v0.first = e.vid(m);
133 cache->m_v1.first = e.switch_vertex(m).vid(m);
138 const std::vector<Tuple>
tets = m.get_incident_tets_for_edge(e);
139 assert(
tets.size() >= 1);
143 insert_edges_of_tet(m, t,
cache->m_edges);
144 insert_faces_of_tet(m, t,
cache->m_faces);
155 std::shared_ptr<TetOperationCache>
cache = std::make_shared<TetOperationCache>();
157 cache->m_v0.first = e.vid(m);
158 cache->m_v1.first = e.switch_vertex(m).vid(m);
163 const std::vector<Tuple>
tets = m.get_one_ring_tets_for_edge(e);
164 assert(
tets.size() >= 1);
168 insert_edges_of_tet(m, t,
cache->m_edges);
169 insert_faces_of_tet(m, t,
cache->m_faces);
std::unique_ptr< MatrixCache > cache
static std::shared_ptr< TetOperationCache > split_edge(WildTetRemesher &m, const Tuple &t)
wmtk::TetMesh::Tuple Tuple
static std::shared_ptr< TetOperationCache > collapse_edge(WildTetRemesher &m, const Tuple &t)
const Remesher::TetMap< TetAttributes > & tets() const
wmtk::TriMesh::Tuple Tuple
static std::shared_ptr< TriOperationCache > collapse_edge(WildTriRemesher &m, const Tuple &t)
static std::shared_ptr< TriOperationCache > split_edge(WildTriRemesher &m, const Tuple &t)
Construct a local mesh as an n-ring around a vertex.
static std::shared_ptr< TriOperationCache > swap_edge(WildTriRemesher &m, const Tuple &t)
wmtk::AttributeCollection< ElementAttributes > element_attrs
typename WMTKMesh::Tuple Tuple
wmtk::AttributeCollection< VertexAttributes > vertex_attrs
bool is_boundary_edge(const Tuple &e) const
Is the given edge tuple on the boundary of the mesh?
WildRemesher< wmtk::TetMesh > WildTetRemesher
WildRemesher< wmtk::TriMesh > WildTriRemesher