Wildmeshing Toolkit
Loading...
Searching...
No Matches
CollapseAlternateFacetOptionData.cpp
Go to the documentation of this file.
2#include <wmtk/Mesh.hpp>
7#include "ear_actions.hpp"
9
11 const Mesh& m,
12 const autogen::SimplexDart& sd,
13 const Tuple& input_tuple)
14 : input(sd.dart_from_tuple(input_tuple))
15 , alts({{left_switches(m, input_tuple), right_switches(m, input_tuple)}})
16 , local_boundary_indices({{
17 input_tuple.local_id(m.top_simplex_type() - 1),
18 m.switch_tuple(input_tuple, PrimitiveType::Vertex).local_id(m.top_simplex_type() - 1),
19 }})
20{}
21
23 const Mesh& m,
24 const Tuple& input_tuple)
26 m,
27 autogen::SimplexDart::get_singleton(m.top_simplex_type()),
28 input_tuple)
29{}
30
32{
33 const PrimitiveType mesh_type = m.top_simplex_type();
34 return get_neighbor_action(m, t, left_ear_action(mesh_type));
35}
37{
38 const PrimitiveType mesh_type = m.top_simplex_type();
39 return get_neighbor_action(m, t, right_ear_action(mesh_type));
40}
41
43 const Mesh& m,
44 const Tuple& t,
45 int8_t local_action) const -> Dart
46{
47 const PrimitiveType mesh_type = m.top_simplex_type();
48 const PrimitiveType boundary_type = mesh_type - 1;
49 Tuple r = wmtk::autogen::local_switch_tuple(mesh_type, t, local_action);
50 Dart d;
51 if (!m.is_boundary(boundary_type, r)) {
52 const auto& sd = autogen::SimplexDart::get_singleton(m.top_simplex_type());
53 int8_t source_orientation = sd.valid_index_from_tuple(t);
54 r = m.switch_tuple(r, m.top_simplex_type());
55 d = sd.dart_from_tuple(r);
56 int8_t& target_orientation = d.local_orientation();
57 int8_t old = target_orientation;
58
59 // encode the relative orientaiton at the d orientation
60 target_orientation =
61 autogen::find_local_dart_action(sd, source_orientation, target_orientation);
62 }
63
64 return d;
65}
66} // namespace wmtk::operations::internal
The Tuple is the basic navigation tool in our mesh data structure.
Definition Tuple.hpp:19
int8_t & local_orientation()
Definition Dart.hpp:18
static const SimplexDart & get_singleton(wmtk::PrimitiveType simplex_type)
Dart get_neighbor_action(const Mesh &m, const Tuple &t, int8_t local_action) const
int8_t find_local_dart_action(const SimplexDart &sd, int8_t source, int8_t target)
Tuple local_switch_tuple(PrimitiveType mesh_type, const Tuple &t, PrimitiveType pt)
int8_t right_ear_action(PrimitiveType mesh_type)
int8_t left_ear_action(PrimitiveType mesh_type)