Wildmeshing Toolkit
SeparateSubstructuresInvariant.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Invariant.hpp"
4 
5 namespace wmtk::invariants {
6 
7 /*
8  * This invariant keeps substructures in a multimesh separated during collapses.
9  *
10  * It should be attached to collapse operations alongside the link condition.
11  *
12  * There are two different options. The default is that all substructures are kept separate. For
13  * example, a child A and a child B must remain separate, if they were separate to begin with.
14  * However, the invariant can also be restricted to only disallow topological changes in single
15  * substructures.
16  *
17  * The invariant checks two conditions, where the second one can be deactivated if different
18  * substructures are allowed to be collapsed into each other. Assume we collapse an edge E and its
19  * incident vertices V0 and V1. We denote all substructures a simplex S belongs to by subs(S).
20  *
21  * Condition 1: The intersection of subs(V0) and subs(V1) is a subset of subs(E).
22  * Condition 2 (optional): subs(V0) is a subset of subs(V1) or subs(V1) is a subset of subs(V0).
23  *
24  */
26 {
27 public:
28  SeparateSubstructuresInvariant(const Mesh& m, bool check_condition_2 = true);
29 
30  bool before(const simplex::Simplex& s) const override;
31 
32 private:
33  const bool m_check_condition_2 = true;
34 };
35 
36 } // namespace wmtk::invariants
SeparateSubstructuresInvariant(const Mesh &m, bool check_condition_2=true)
bool before(const simplex::Simplex &s) const override