Wildmeshing Toolkit
NewSimplexValueApplicator.cpp
Go to the documentation of this file.
1 
2 #pragma once
3 
5 
6 
7 void apply(
8  const wmtk::attribute::UpdateStrategy& strategy,
9  const OperationTupleData& data,
10  UpdateMode mode)
11 {
12  if (std::is_convertible_v<wmtk::attribute::UpdateStrategyCollection>(strategy)) {
13  auto& strat = static_cast<const UpdateStrategyCollection&>(strategy);
14  for (const auto& substrat_ptr : strat) {
15  apply(*substrat_ptr, data);
16  }
17  } else if (std::is_convertible_v<const UpdateStrategy>(strategy){
18  auto& strat = static_cast<const UpdateStrategy&>(strategy);
19 
20  const Mesh* m = &strat.mesh();
21  auto pairs = data.at(m);
22  for (const auto& [a, b] : pairs) {
23  switch (mode) {
24  case Split: {
25  strat.run_split(a, b);
26  return;
27  }
28  case Collapse: strat.run_collapse(a, b); return;
29  }
30  }
31 
32  }
33 }
34 
35 } // namespace wmtk::multimesh::attribute
void apply(const wmtk::attribute::UpdateStrategy &strategy, const OperationTupleData &data, UpdateMode mode)
std::map< const Mesh *, std::vector< std::array< Tuple, 2 > >> OperationTupleData