Wildmeshing Toolkit
Simplex.cpp
Go to the documentation of this file.
1 #include "Simplex.hpp"
2 
3 #include <tuple>
4 #include <wmtk/Mesh.hpp>
5 namespace wmtk::simplex {
6 
7 Simplex::Simplex(const Mesh& m, const PrimitiveType& ptype, const Tuple& t)
8 #if defined(WMTK_ENABLE_SIMPLEX_ID_CACHING)
9  : Simplex(ptype, t, m.id(t, ptype))
10 #else
11  : Simplex(ptype, t)
12 #endif
13 {}
14 
15 #if defined(WMTK_ENABLE_SIMPLEX_ID_CACHING)
16 bool Simplex::operator==(const Simplex& o) const
17 {
18  return m_primitive_type == o.m_primitive_type && m_index == o.m_index;
19 }
20 
21 bool Simplex::operator<(const Simplex& o) const
22 {
23  return std::tie(m_primitive_type, m_index) < std::tie(o.m_primitive_type, o.m_index);
24 }
25 #endif
26 } // namespace wmtk::simplex
int64_t id(const Tuple &tuple, PrimitiveType type) const
return the global id of the Tuple of the given dimension
Definition: Mesh.hpp:1020
PrimitiveType m_primitive_type
Definition: Simplex.hpp:31
constexpr bool operator==(PrimitiveType a, PrimitiveType b)
constexpr bool operator<(PrimitiveType a, PrimitiveType b)