Wildmeshing Toolkit
NoBoundaryCollapseToInteriorInvariant.cpp
Go to the documentation of this file.
1
#include "
NoBoundaryCollapseToInteriorInvariant.hpp
"
2
#include <
wmtk/Mesh.hpp
>
3
#include <
wmtk/simplex/Simplex.hpp
>
4
5
namespace
wmtk::invariants
{
6
NoBoundaryCollapseToInteriorInvariant::NoBoundaryCollapseToInteriorInvariant
(
const
Mesh
& m)
7
:
Invariant
(m, true, false, false)
8
{}
9
10
bool
NoBoundaryCollapseToInteriorInvariant::before
(
const
simplex::Simplex
& t)
const
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
(
15
PrimitiveType::Vertex
,
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
Mesh.hpp
NoBoundaryCollapseToInteriorInvariant.hpp
Simplex.hpp
wmtk::Mesh
Definition:
Mesh.hpp:106
wmtk::Mesh::is_boundary
bool is_boundary(const simplex::Simplex &tuple) const
check if a simplex lies on a boundary or not
Definition:
Mesh.cpp:106
wmtk::invariants::Invariant
Definition:
Invariant.hpp:12
wmtk::invariants::Invariant::mesh
const Mesh & mesh() const
Definition:
Invariant.cpp:35
wmtk::invariants::NoBoundaryCollapseToInteriorInvariant::before
bool before(const simplex::Simplex &t) const override
Definition:
NoBoundaryCollapseToInteriorInvariant.cpp:10
wmtk::invariants::NoBoundaryCollapseToInteriorInvariant::NoBoundaryCollapseToInteriorInvariant
NoBoundaryCollapseToInteriorInvariant(const Mesh &m)
Definition:
NoBoundaryCollapseToInteriorInvariant.cpp:6
wmtk::simplex::Simplex
Definition:
Simplex.hpp:22
wmtk::simplex::Simplex::tuple
const Tuple & tuple() const
Definition:
Simplex.hpp:53
wmtk::simplex::Simplex::primitive_type
PrimitiveType primitive_type() const
Definition:
Simplex.hpp:51
wmtk::invariants
Definition:
CollapseEnergyBeforeInvariant.cpp:11
wmtk::PrimitiveType::Vertex
@ Vertex
wmtk::PrimitiveType::Edge
@ Edge
src
wmtk
invariants
NoBoundaryCollapseToInteriorInvariant.cpp
Generated by
1.9.1