Wildmeshing Toolkit
Loading...
Searching...
No Matches
ExecutorUtils.hpp
1#pragma once
2
3#include "TupleUtils.hpp"
4
5namespace wmtk {
6
7constexpr auto renewal_edges = [](const auto& m, auto op, const std::vector<TetMesh::Tuple>& newt) {
8 std::vector<std::pair<std::string, TetMesh::Tuple>> op_tups;
9 std::vector<TetMesh::Tuple> new_edges;
10 for (const TetMesh::Tuple& ti : newt) {
11 for (auto j = 0; j < 6; j++) {
12 new_edges.push_back(m.tuple_from_edge(ti.tid(m), j));
13 }
14 };
15 wmtk::unique_edge_tuples(m, new_edges);
16 for (const auto& f : new_edges) {
17 op_tups.emplace_back(op, f);
18 }
19 return op_tups;
20};
21
22constexpr auto renewal_faces = [](const auto& m, auto op, const auto& newtets) {
23 std::vector<std::pair<std::string, wmtk::TetMesh::Tuple>> op_tups;
24
25 auto new_faces = std::vector<wmtk::TetMesh::Tuple>();
26 for (auto ti : newtets) {
27 for (auto j = 0; j < 4; j++) new_faces.push_back(m.tuple_from_face(ti.tid(m), j));
28 }
29 wmtk::unique_face_tuples(m, new_faces);
30 for (auto f : new_faces) op_tups.emplace_back(op, f);
31 return op_tups;
32};
33
34constexpr auto renewal_simple = [](const auto& m, auto op, const auto& newts) {
35 std::vector<std::pair<std::string, wmtk::TetMesh::Tuple>> op_tups;
36 for (auto t : newts) {
37 op_tups.emplace_back(op, t);
38 }
39 return op_tups;
40};
41} // namespace wmtk