Wildmeshing Toolkit
NoBoundaryCollapseToInteriorInvariant.cpp
Go to the documentation of this file.
2 #include <wmtk/Mesh.hpp>
4 
5 namespace wmtk::invariants {
7  : Invariant(m, true, false, false)
8 {}
9 
11 {
12  assert(t.primitive_type() == PrimitiveType::Edge);
13  bool v0_on_boundary = mesh().is_boundary(PrimitiveType::Vertex, t.tuple());
14  bool v1_on_boundary = mesh().is_boundary(
16  mesh().switch_tuple(t.tuple(), PrimitiveType::Vertex));
17 
18  if (v0_on_boundary && !v1_on_boundary) {
19  return false;
20  }
21  return true;
22 }
23 } // namespace wmtk::invariants
bool is_boundary(const simplex::Simplex &tuple) const
check if a simplex lies on a boundary or not
Definition: Mesh.cpp:107
const Mesh & mesh() const
Definition: Invariant.cpp:35
const Tuple & tuple() const
Definition: Simplex.hpp:53
PrimitiveType primitive_type() const
Definition: Simplex.hpp:51