70 auto get_boundary_edges = [&mesh](
const Tuple& _v) {
72 std::vector<Tuple> ret;
77 for (
const Tuple& _e : incident_edges) {
87 const auto boundary_neighbors_a = get_boundary_edges(edge);
88 const auto boundary_neighbors_b =
91 assert(boundary_neighbors_a.size() == 2);
92 assert(boundary_neighbors_b.size() == 2);
93 for (
auto e_a : boundary_neighbors_a) {
94 for (
auto e_b : boundary_neighbors_b) {
105 if (boundary_neighbors_a.size() == 0 || boundary_neighbors_b.size() == 0) {
162 auto get_boundary_vertex_link = [&mesh](
const Tuple& _v) {
168 auto incident_faces =
170 for (
const Tuple& _f : incident_faces) {
188 auto get_boundary_edge_link = [&mesh](
const Tuple& _v) {
191 auto incident_faces =
193 for (
const Tuple& _f : incident_faces) {
203 const Tuple& a_tuple = edge;
219 boundary_link_a_link_b_intersection,
232 [&edge](
auto&& m) noexcept {
233 using MType = std::decay_t<decltype(m.get())>;
234 if constexpr (std::is_same_v<MType, Mesh>) {
235 throw std::runtime_error(
"Link condition called on an unknown type of mesh - could "
236 "only cast it to Mesh");
237 }
else if constexpr (std::is_same_v<MType, PointMesh>) {
Tuple switch_tuple(const Tuple &tuple, PrimitiveType type) const override
switch the orientation of the Tuple of the given dimension
bool is_boundary_vertex(const Tuple &tuple) const
Tuple switch_tuples(const Tuple &tuple, const ContainerType &op_sequence) const
Performs a sequence of switch_tuple operations in the order specified in op_sequence.
bool is_boundary_vertex(const Tuple &tuple) const
Tuple switch_tuple(const Tuple &tuple, PrimitiveType type) const final override
switch the orientation of the Tuple of the given dimension
bool is_boundary_edge(const Tuple &tuple) const
Tuple switch_vertex(const Tuple &tuple) const
bool is_boundary(PrimitiveType pt, const Tuple &tuple) const final override
check if a simplex (encoded as a tuple/primitive pair) lies on a boundary or not
Tuple switch_tuple(const Tuple &tuple, PrimitiveType type) const final override
switch the orientation of the Tuple of the given dimension
bool is_boundary(PrimitiveType pt, const Tuple &tuple) const final override
check if a simplex (encoded as a tuple/primitive pair) lies on a boundary or not
bool is_boundary_edge(const Tuple &tuple) const
void sort_and_clean()
Sort simplex vector and remove duplicates.
static IdSimplexCollection get_intersection(const IdSimplexCollection &collection_a, const IdSimplexCollection &collection_b)
Get intersection of two simplex collections.
void add(const IdSimplex &simplex)
Add simplex to the collection.
void reserve(const size_t new_cap)
static bool are_simplex_collections_equal(const IdSimplexCollection &collection_a, const IdSimplexCollection &collection_b)
Check if the two simplex collections are equal.
static Simplex edge(const Mesh &m, const Tuple &t)
static Simplex vertex(const Mesh &m, const Tuple &t)
static bool equal(const Mesh &m, const Simplex &s0, const Simplex &s1)
bool link_condition(const EdgeMesh &mesh, const Tuple &edge)
Check if the edge to collapse satisfying the link condition.
bool link_condition_closed_trimesh(const TriMesh &mesh, const Tuple &edge)
bool link_condition_closed_tetmesh(const TetMesh &mesh, const Tuple &edge)
LinkIterable link_iterable(const Mesh &mesh, const Simplex &simplex)
CofacesSingleDimensionIterable cofaces_single_dimension_iterable(const Mesh &mesh, const Simplex &simplex, const PrimitiveType cofaces_type)