10 using Pair = std::array<int8_t, 2>;
11 using PairPair = std::array<Pair, 2>;
15 auto run = [](
auto size_const) {
16 using T = decltype(size_const);
17 constexpr
static size_t C = T::value;
18 std::array<PairPair, C> ret = {};
21 for (
size_t j = 0; j < ret.size(); ++j) {
23 auto& main = std::get<0>(r);
24 auto& dual = std::get<1>(r);
25 const int8_t edge_index = j;
27 for (int8_t k = 0; k < sd.size(); ++k) {
31 main[0] = sd.simplex_index(left, boundary_type);
32 main[1] = sd.simplex_index(right, boundary_type);
43 if constexpr (Dim == 1) {
44 return run(std::integral_constant<size_t, 1>{});
45 }
else if constexpr (Dim == 2) {
46 return run(std::integral_constant<size_t, 3>{});
47 }
else if constexpr (Dim == 3) {
48 return run(std::integral_constant<size_t, 6>{});
51 template <
size_t ArrSize>
52 const std::array<int8_t, 2>& boundary_indices_(
55 const std::array<PairPair, ArrSize>& arr)
58 const int8_t boundary_index =
60 const PairPair& pairpair = arr.at(edge_index);
61 const Pair& pair = std::get<0>(pairpair);
62 static_assert(std::tuple_size_v<Pair> == 2);
63 if (boundary_index == std::get<1>(pair)) {
70 const std::array<int8_t, 2>& boundary_indices_(
74 const static std::array<PairPair, 1> edge_inds = make_inds<1>();
75 const static std::array<PairPair, 3> tri_inds = make_inds<2>();
76 const static std::array<PairPair, 6> tet_inds = make_inds<3>();
86 constexpr
static Pair empty = {};
92 ->
const std::array<int8_t, 2>&
95 const auto& boundary_inds = boundary_indices_(sd,
input.local_orientation());
101 const std::array<int64_t, 2>& n)
103 , new_facet_indices(n)
111 const auto& boundary_simplex_indices = boundary_indices(mesh_type);
117 auto get_size = [&](
size_t index) {
122 boundary_simplex_indices[index]);
124 const std::array<int8_t, 2> sizes{{get_size(0), get_size(1)}};
125 if (sizes[0] >= sizes[1]) {
126 return new_facet_indices[0];
128 return new_facet_indices[1];
int8_t simplex_index(const int8_t valid_index, PrimitiveType simplex_type) const
static const SimplexDart & get_singleton(wmtk::PrimitiveType simplex_type)
wmtk::PrimitiveType simplex_type() const
int8_t product(int8_t a, int8_t b) const
int64_t new_gid(PrimitiveType primitive_type, int8_t index) const
SplitAlternateFacetOptionData(const Dart &input_tuple, const std::array< int64_t, 2 > &new_facet_indices)
const std::array< int8_t, 2 > & boundary_indices(PrimitiveType pt) const
auto largest_shared_subdart_size(PrimitiveType mesh_type, int8_t dart_index, int8_t simplex_dimension, int8_t simplex_index) -> int8_t
int8_t right_ear_action(PrimitiveType mesh_type)
int8_t left_ear_action(PrimitiveType mesh_type)