13 bool hash_free_tuple_equality(
const Tuple& a,
const Tuple& b)
21 std::optional<std::vector<PrimitiveType>> find_local_switch_sequence_on_edge(
27 if (hash_free_tuple_equality(source, target)) {
28 return std::vector<PrimitiveType>{};
29 }
else if (hash_free_tuple_equality(
37 std::optional<std::vector<PrimitiveType>> find_local_switch_sequence_on_triangle(
44 Tuple cur_tuple = source;
45 std::vector<PrimitiveType> switches;
47 const auto edge_local_operations =
48 find_local_switch_sequence_on_edge(mesh_pt, cur_tuple, target);
49 if (edge_local_operations.has_value()) {
50 return edge_local_operations.value();
56 const auto edge_local_operations =
57 find_local_switch_sequence_on_edge(mesh_pt, cur_tuple, target);
58 if (edge_local_operations.has_value()) {
61 edge_local_operations.value().begin(),
62 edge_local_operations.value().end());
70 const auto edge_local_operations =
71 find_local_switch_sequence_on_edge(mesh_pt, cur_tuple, target);
72 if (edge_local_operations.has_value()) {
75 edge_local_operations.value().begin(),
76 edge_local_operations.value().end());
83 std::optional<std::vector<PrimitiveType>> find_local_switch_sequence_on_tet(
89 Tuple cur_tuple = source;
90 std::vector<PrimitiveType> switches;
93 const auto triangle_local_operations =
94 find_local_switch_sequence_on_triangle(mesh_pt, cur_tuple, target);
95 if (triangle_local_operations.has_value()) {
96 return triangle_local_operations.value();
102 const auto triangle_local_operations =
103 find_local_switch_sequence_on_triangle(mesh_pt, cur_tuple, target);
104 if (triangle_local_operations.has_value()) {
107 triangle_local_operations.value().begin(),
108 triangle_local_operations.value().end());
116 const auto triangle_local_operations =
117 find_local_switch_sequence_on_triangle(mesh_pt, cur_tuple, target);
118 if (triangle_local_operations.has_value()) {
121 triangle_local_operations.value().begin(),
122 triangle_local_operations.value().end());
130 const auto triangle_local_operations =
131 find_local_switch_sequence_on_triangle(mesh_pt, cur_tuple, target);
132 if (triangle_local_operations.has_value()) {
135 triangle_local_operations.value().begin(),
136 triangle_local_operations.value().end());
148 std::vector<PrimitiveType>
151 switch (primitive_type) {
153 const auto operations =
155 if (!operations.has_value()) {
156 throw std::runtime_error(
157 "switch sequence was unable to find a sequence of switches to match tuples");
159 return operations.value();
162 const auto operations =
164 if (!operations.has_value()) {
165 throw std::runtime_error(
166 "switch sequence was unable to find a sequence of switches to match tuples");
168 return operations.value();
171 const auto operations =
173 if (!operations.has_value()) {
174 throw std::runtime_error(
175 "switch sequence was unable to find a sequence of switches to match tuples");
177 return operations.value();
static int8_t local_eid(const Tuple &t)
static int64_t global_cid(const Tuple &t)
static int8_t local_vid(const Tuple &t)
static int8_t local_fid(const Tuple &t)
std::vector< PrimitiveType > find_local_switch_sequence(const Tuple &source, const Tuple &target, PrimitiveType primitive_type)
Tuple local_switch_tuples(PrimitiveType mesh_primitive_type, const Tuple &tuple, const std::initializer_list< PrimitiveType > &op_sequence)
Tuple local_switch_tuple(PrimitiveType mesh_primitive_type, const Tuple &source, PrimitiveType primitive_type)