7 , m_critical_points(critical_points)
8 , m_vertex_tag_acc(mesh.create_accessor(
10 , m_edge_tag_acc(mesh.create_accessor(
11 mesh.register_attribute<int64_t>(
"edge_tag",
PrimitiveType::
Edge, 1).as<int64_t>()))
21 for (
const Tuple& e : e_tuples) {
27 for (
const Tuple& v : v_tuples) {
36 std::set<int64_t> tags;
41 for (
const Tuple& e : e_tuples) {
48 for (
const Tuple& e : e_tuples) {
55 tags.insert(edge_tag + vid_max);
68 assert(v1_root == v2_root);
124 mutable_v =
v_tuple(parent_vid);
144 if (v1_root == v2_root) {
150 int64_t root = std::min(v1_root, v2_root);
160 int64_t vid1 =
vid(v1);
161 int64_t vid2 =
vid(v2);
int64_t capacity(PrimitiveType type) const
read in the m_capacities return the upper bound for the number of entities of the given dimension
int64_t id(const Tuple &tuple, PrimitiveType type) const
return the global id of the Tuple of the given dimension
virtual Tuple tuple_from_id(const PrimitiveType type, const int64_t gid) const =0
internal function that returns the tuple of requested type, and has the global index cid
std::vector< Tuple > get_all(PrimitiveType type) const
Generate a vector of Tuples from global vertex/edge/triangle/tetrahedron index.
virtual Tuple switch_tuple(const Tuple &tuple, PrimitiveType type) const =0
switch the orientation of the Tuple of the given dimension
T & scalar_attribute(const ArgType &t)
T const_scalar_attribute(const ArgType &t) const
const Mesh & mesh() const
wmtk::attribute::Accessor< int64_t > m_vertex_tag_acc
int64_t get_edge_tag(const Tuple &tuple) const
bool vertex_is_root(const Tuple &v) const
std::set< int64_t > run()
void set_edge_tag(const Tuple &tuple, int64_t tag)
bool is_critical_vertex(const Tuple &v) const
Check if a vertex is a critical point.
void vertex_set_root(const Tuple &v, int64_t root)
wmtk::attribute::Accessor< int64_t > m_edge_tag_acc
void set_vertex_tag(const Tuple &tuple, int64_t tag)
void vertex_sets_unify(const Tuple &v1, const Tuple &v2)
Given two vertex tuple, join the sets that contain them.
TupleTag(Mesh &mesh, const std::set< int64_t > &critical_points)
Tuple v_tuple(int64_t vid) const
int64_t vertex_get_root(const Tuple &v) const
void initialize()
Go through edges of the parent mesh (triangle mesh) and initialize all the vertex tags to be -1.
int64_t vid(const Tuple &tuple) const
int64_t get_vertex_tag(const Tuple &tuple) const
std::set< int64_t > m_critical_points