Wildmeshing Toolkit
NoChildMeshAttachingInvariant.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 
14  auto child_meshes = mesh().get_child_meshes();
15 
16  for (auto child_mesh : child_meshes) {
17  // if (!mesh().map_to_child(*child_mesh, simplex::Simplex::edge(mesh(), t.tuple())).empty())
18  // {
19  // continue;
20  // }
21  if (!mesh()
22  .map_to_child(*child_mesh, simplex::Simplex::vertex(mesh(), t.tuple()))
23  .empty() ||
24  !mesh()
25  .map_to_child(
26  *child_mesh,
28  mesh(),
29  mesh().switch_tuple(t.tuple(), PrimitiveType::Vertex)))
30  .empty()) {
31  return false;
32  }
33  }
34 
35  return true;
36 }
37 } // namespace wmtk::invariants
std::vector< std::shared_ptr< Mesh > > get_child_meshes() const
returns the direct multimesh child meshes for the current mesh
const Mesh & mesh() const
Definition: Invariant.cpp:35
bool before(const simplex::Simplex &t) const override
const Tuple & tuple() const
Definition: Simplex.hpp:53
static Simplex vertex(const Mesh &m, const Tuple &t)
Definition: Simplex.hpp:56
PrimitiveType primitive_type() const
Definition: Simplex.hpp:51