Wildmeshing Toolkit
extract_operation_tuples.cpp
Go to the documentation of this file.
7 
8 
10 
12 
13 namespace {
14 class ExtractTuple
15 {
16 public:
17  // std::array<Tuple, 2> operator()(const wmtk::operations::point_mesh::EdgeOperationData& t)
18  // const
19  //{
20  // return std::array<Tuple, 2>{};
21  // }
22 
23  std::array<Tuple, 2> operator()(
24  const wmtk::operations::edge_mesh::EdgeOperationData& t) const noexcept
25  {
26  return std::array<Tuple, 2>{{t.m_operating_tuple, t.m_output_tuple}};
27  }
28  std::array<Tuple, 2> operator()(
29  const wmtk::operations::tri_mesh::EdgeOperationData& t) const noexcept
30  {
31  return std::array<Tuple, 2>{{t.m_operating_tuple, t.m_output_tuple}};
32  }
33  std::array<Tuple, 2> operator()(
34  const wmtk::operations::tet_mesh::EdgeOperationData& t) const noexcept
35  {
36  return std::array<Tuple, 2>{{t.m_operating_tuple, t.m_output_tuple}};
37  }
38 };
39 } // namespace
40 
41 std::map<const Mesh*, std::vector<std::array<Tuple, 2>>> extract_operation_tuples(
43 {
44  std::map<const Mesh*, std::vector<std::array<Tuple, 2>>> ret;
45 
46  for (const auto& [key, value_var] : return_data) {
47  const auto [mesh_ptr, input_simplex] = key;
48  auto tups = std::visit(ExtractTuple{}, value_var);
49  assert(tups[0] == input_simplex.tuple());
50  ret[mesh_ptr].emplace_back(tups);
51  }
52 
53  return ret;
54 }
55 std::map<const Mesh*, std::vector<std::array<Tuple, 2>>> extract_operation_tuples(
57 {
58  std::map<const Mesh*, std::vector<std::array<Tuple, 2>>> ret;
59 
60  for (const auto& [key, value_var] : return_data) {
61  const auto [mesh_ptr, input_simplex] = key;
62  auto tups = std::visit(ExtractTuple{}, value_var);
63  assert(tups[0] == input_simplex.tuple());
64  ret[mesh_ptr].emplace_back(tups);
65  }
66 
67  return ret;
68 }
70 {
71  std::map<const Mesh*, std::vector<std::tuple<simplex::NavigatableSimplex, Tuple>>> ret;
72 
73  for (const auto& [key, value_var] : return_data) {
74  const auto [mesh_ptr, input_simplex] = key;
75  auto tups = std::visit(ExtractTuple{}, value_var);
76  assert(tups[0] == input_simplex.tuple());
77  ret[mesh_ptr].emplace_back(input_simplex, tups[1]);
78  }
79 
80  return ret;
81 }
83 {
84  std::map<const Mesh*, std::vector<std::tuple<simplex::NavigatableSimplex, Tuple>>> ret;
85 
86  for (const auto& [key, value_var] : return_data) {
87  const auto [mesh_ptr, input_simplex] = key;
88  auto tups = std::visit(ExtractTuple{}, value_var);
89  assert(tups[0] == input_simplex.tuple());
90  ret[mesh_ptr].emplace_back(input_simplex, tups[1]);
91  }
92 
93  return ret;
94 }
95 } // namespace wmtk::multimesh::operations
std::map< const Mesh *, std::vector< std::array< Tuple, 2 > > > extract_operation_tuples(const wmtk::operations::utils::CollapseReturnData &return_data)
OperationInOutData extract_operation_in_out(const CollapseReturnData &return_data)
wmtk::utils::metaprogramming::ReferenceWrappedFunctorReturnCacheCustomComparator< wmtk::operations::utils::MultiMeshEdgeSplitFunctor, wmtk::utils::metaprogramming::MeshVariantTraits, wmtk::simplex::utils::MeshSimplexComparator, simplex::NavigatableSimplex > SplitReturnData
std::map< const Mesh *, std::vector< std::tuple< simplex::NavigatableSimplex, wmtk::Tuple > >> OperationInOutData
wmtk::utils::metaprogramming::ReferenceWrappedFunctorReturnCacheCustomComparator< wmtk::operations::utils::MultiMeshEdgeCollapseFunctor, wmtk::utils::metaprogramming::MeshVariantTraits, wmtk::simplex::utils::MeshSimplexComparator, simplex::NavigatableSimplex > CollapseReturnData
wmtk::multimesh::operations::CollapseReturnData CollapseReturnData
wmtk::multimesh::operations::SplitReturnData SplitReturnData