Wildmeshing Toolkit
MultiMeshEdgeSplitFunctor.cpp
Go to the documentation of this file.
2 
7 
8 #include <wmtk/utils/Logger.hpp>
9 
10 namespace wmtk::operations::utils {
11 
13  Mesh& mesh,
14  const simplex::Simplex& s) const
15 {
16  switch (mesh.top_simplex_type()) {
17  case PrimitiveType::Vertex: break;
18  case PrimitiveType::Edge: return (*this)(static_cast<EdgeMesh&>(mesh), s);
19  case PrimitiveType::Triangle: return (*this)(static_cast<TriMesh&>(mesh), s);
20  case PrimitiveType::Tetrahedron: return (*this)(static_cast<TetMesh&>(mesh), s);
21  default: break;
22  }
23  assert(false);
24  return {};
25 }
26 
28  EdgeMesh& m,
29  const simplex::Simplex& s) const
30 {
32  exec.split_edge();
33  return std::move(static_cast<edge_mesh::EdgeOperationData&>(exec));
34 }
36  TriMesh& m,
37  const simplex::Simplex& s) const
38 {
40 
41  exec.split_edge();
42  for (const auto& id : exec.incident_face_datas()) {
43  logger().trace(
44  "[{}] mapped {}->{}",
45  fmt::join(m.absolute_multi_mesh_id(), ","),
46  id.fid,
47  fmt::join(id.split_f, ","));
48  }
49 
50  return std::move(static_cast<tri_mesh::EdgeOperationData&>(exec));
51 }
53  TetMesh& m,
54  const simplex::Simplex& s) const
55 {
57  exec.split_edge();
58  return std::move(static_cast<tet_mesh::EdgeOperationData&>(exec));
59 }
60 } // namespace wmtk::operations::utils
std::vector< int64_t > absolute_multi_mesh_id() const
returns a unique identifier for this mesh within a single multimesh structure
PrimitiveType top_simplex_type() const
Definition: Mesh.hpp:996
const std::vector< IncidentFaceData > & incident_face_datas() const
wmtk::operations::EdgeOperationData run(Mesh &, const simplex::Simplex &) const
void operator()(const Mesh &, const simplex::Simplex &) const
const Tuple & tuple() const
Definition: Simplex.hpp:53
spdlog::logger & logger()
Retrieves the current logger.
Definition: Logger.cpp:58