18 bool both_map_to_child(
21 const simplex::Simplex& left,
22 const simplex::Simplex& right)
24 return parent.can_map(child, left) && parent.can_map(child, right);
30 bool both_map_to_child(
const Mesh& parent,
const Mesh& child,
const Tuple&
input)
34 assert(parent_type > child_type);
35 const PrimitiveType collapsed_simplex_type = std::min(child_type + 1, parent_type);
36 auto opposite = [&parent, collapsed_simplex_type](Tuple t) {
50 assert(pt < parent.top_simplex_type());
51 t = parent.switch_tuple(t, pt);
55 const simplex::Simplex left(child_type, opposite(
input));
56 const simplex::Simplex right(
59 return both_map_to_child(parent, child, left, right);
66 bool any_pairs_both_map_to_child(
69 const simplex::Simplex& edge)
74 assert(parent_type > child_type);
75 if (parent_type == child_type) {
79 }
else if (parent_type == child_type + 1) {
80 return both_map_to_child(parent, child, edge.tuple());
82 for (
const Tuple& tuple :
84 if (both_map_to_child(parent, child, tuple)) {
92 struct MultiMeshMapValidFunctor
95 bool operator()(
const T& m,
const simplex::Simplex& s, int64_t)
97 return this->operator()(m, s);
99 bool operator()(
const Mesh& m,
const simplex::Simplex& s)
const
101 for (
auto child_ptr : m.get_child_meshes()) {
102 if (any_pairs_both_map_to_child(m, *child_ptr, s)) {
118 std::integral_constant<int64_t, 1>{},
119 MultiMeshMapValidFunctor{});
122 const auto& data = visitor.cache();
124 for (
const auto& [key, value_var] : data) {
125 const bool valid = std::get<bool>(value_var);
MultiMeshMapValidInvariant(const Mesh &m)
bool before(const simplex::Simplex &t) const override
const Mesh & mesh() const
void execute_from_root(Mesh &mesh, const simplex::NavigatableSimplex &simplex)
PrimitiveType primitive_type() const
CofacesSingleDimensionIterable cofaces_single_dimension_iterable(const Mesh &mesh, const Simplex &simplex, const PrimitiveType cofaces_type)