Wildmeshing Toolkit
MultiMeshTopologyInvariant.cpp
Go to the documentation of this file.
1
#include "
MultiMeshTopologyInvariant.hpp
"
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
>
9
#include <
wmtk/multimesh/MultiMeshSimplexVisitor.hpp
>
10
#include <
wmtk/simplex/Simplex.hpp
>
11
12
namespace
wmtk
{
13
MultiMeshEdgeTopologyInvariant::MultiMeshEdgeTopologyInvariant
(
14
const
Mesh
& parent,
15
const
EdgeMesh
& child)
16
:
Invariant
(parent, true, false, false)
17
, m_child_mesh(child)
18
{}
19
20
bool
MultiMeshEdgeTopologyInvariant::before
(
const
simplex::Simplex
& t)
const
21
{
22
const
Tuple
v1 = t.
tuple
();
23
const
Tuple
v2 =
mesh
().
switch_tuple
(t.
tuple
(),
PrimitiveType::Vertex
);
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(
34
m_child_mesh
,
35
simplex::Simplex
(
mesh
(),
PrimitiveType::Vertex
, v1))
36
.size() != 0 &&
37
mesh
().map_to_child_tuples(
38
m_child_mesh
,
39
simplex::Simplex
(
mesh
(),
PrimitiveType::Vertex
, v2))
40
.size() != 0) {
41
return
false
;
42
}
43
44
45
return
true
;
46
}
47
}
// namespace wmtk
EdgeMesh.hpp
Mesh.hpp
MultiMeshSimplexVisitor.hpp
MultiMeshTopologyInvariant.hpp
PointMesh.hpp
Simplex.hpp
TetMesh.hpp
TriMesh.hpp
wmtk::EdgeMesh
Definition:
EdgeMesh.hpp:16
wmtk::Mesh
Definition:
Mesh.hpp:107
wmtk::Mesh::switch_tuple
virtual Tuple switch_tuple(const Tuple &tuple, PrimitiveType type) const =0
switch the orientation of the Tuple of the given dimension
wmtk::MultiMeshEdgeTopologyInvariant::before
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...
Definition:
MultiMeshTopologyInvariant.cpp:20
wmtk::MultiMeshEdgeTopologyInvariant::m_child_mesh
const Mesh & m_child_mesh
Definition:
MultiMeshTopologyInvariant.hpp:21
wmtk::MultiMeshEdgeTopologyInvariant::MultiMeshEdgeTopologyInvariant
MultiMeshEdgeTopologyInvariant(const Mesh &parent, const EdgeMesh &child)
Definition:
MultiMeshTopologyInvariant.cpp:13
wmtk::Tuple
Definition:
Tuple.hpp:42
wmtk::invariants::Invariant
Definition:
Invariant.hpp:12
wmtk::invariants::Invariant::mesh
const Mesh & mesh() const
Definition:
Invariant.cpp:35
wmtk::simplex::Simplex
Definition:
Simplex.hpp:22
wmtk::simplex::Simplex::tuple
const Tuple & tuple() const
Definition:
Simplex.hpp:53
wmtk
Definition:
Accessor.hpp:6
wmtk::PrimitiveType::Vertex
@ Vertex
wmtk::PrimitiveType::Edge
@ Edge
src
wmtk
invariants
MultiMeshTopologyInvariant.cpp
Generated by
1.9.1