Wildmeshing Toolkit
EnergyFilterInvariant.cpp
Go to the documentation of this file.
2 #include <wmtk/Mesh.hpp>
3 
5 
6 namespace wmtk {
7 
9  const Mesh& m,
10  const attribute::TypedAttributeHandle<char>& energy_filter_handle)
11  : Invariant(m)
12  , m_energy_filter_handle(energy_filter_handle)
13 {}
14 
16 {
17  assert(
20 
22  if (accessor.const_scalar_attribute(t.tuple()) == char(1) ||
23  accessor.const_scalar_attribute(
24  mesh().switch_tuple(t.tuple(), PrimitiveType::Vertex)) == char(1)) {
25  return true;
26  }
27  } else {
28  if (accessor.const_scalar_attribute(t.tuple()) == char(1)) {
29  return true;
30  }
31  }
32 
33  return false;
34 }
35 
36 } // namespace wmtk
EnergyFilterInvariant(const Mesh &m, const attribute::TypedAttributeHandle< char > &energy_filter_handle)
bool before(const simplex::Simplex &t) const override
const attribute::TypedAttributeHandle< char > m_energy_filter_handle
const attribute::Accessor< T, Mesh, D > create_const_accessor(const attribute::MeshAttributeHandle &handle) const
const Mesh & mesh() const
Definition: Invariant.cpp:35
const Tuple & tuple() const
Definition: Simplex.hpp:53
PrimitiveType primitive_type() const
Definition: Simplex.hpp:51
Definition: Accessor.hpp:6