Wildmeshing Toolkit
MultiMeshTopologyInvariant.cpp
Go to the documentation of this file.
2 
3 #include <stdexcept>
4 #include <wmtk/EdgeMesh.hpp>
5 #include <wmtk/Mesh.hpp>
6 #include <wmtk/PointMesh.hpp>
7 #include <wmtk/TetMesh.hpp>
8 #include <wmtk/TriMesh.hpp>
10 #include <wmtk/simplex/Simplex.hpp>
11 
12 namespace wmtk {
14  const Mesh& parent,
15  const EdgeMesh& child)
16  : Invariant(parent, true, false, false)
17  , m_child_mesh(child)
18 {}
19 
21 {
22  const Tuple v1 = t.tuple();
24 
25  // if the edge is in the child mesh, return true
26  if (mesh()
27  .map_to_child_tuples(m_child_mesh, simplex::Simplex(mesh(), PrimitiveType::Edge, v1))
28  .size() != 0)
29  return true;
30 
31  // now the edge is not in the childmesh, then if both vertices are in the child mesh, return
32  // false
33  if (mesh().map_to_child_tuples(
36  .size() != 0 &&
37  mesh().map_to_child_tuples(
40  .size() != 0) {
41  return false;
42  }
43 
44 
45  return true;
46 }
47 } // namespace wmtk
virtual Tuple switch_tuple(const Tuple &tuple, PrimitiveType type) const =0
switch the orientation of the Tuple of the given dimension
bool before(const simplex::Simplex &t) const override
check if both the vertices are in the child mesh but the edge itself is not in the child mesh (return...
MultiMeshEdgeTopologyInvariant(const Mesh &parent, const EdgeMesh &child)
const Mesh & mesh() const
Definition: Invariant.cpp:35
const Tuple & tuple() const
Definition: Simplex.hpp:53
Definition: Accessor.hpp:6