Wildmeshing Toolkit
Loading...
Searching...
No Matches
local_id_table_offset.hxx
Go to the documentation of this file.
1#pragma once
2
5// computes the offset of a tuple's local ids in the tables
6inline int64_t local_id_table_offset(const Tuple& tuple)
7{
8 return tuple.local_vid() * 3 + tuple.local_eid();
9}
10
11inline std::array<int64_t, 2> lvid_leid_from_table_offset(int64_t table_offset)
12{
13 std::array<int64_t, 2> r;
14 auto& [lvid, leid] = r;
15
16 lvid = table_offset / 3;
17 leid = table_offset % 3;
18 return r;
19}
20
21} // namespace wmtk::autogen::tri_mesh
The Tuple is the basic navigation tool in our mesh data structure.
Definition Tuple.hpp:19
int8_t local_vid() const
Definition Tuple.hxx:52
int8_t local_eid() const
Definition Tuple.hxx:57
int64_t local_id_table_offset(const Tuple &t)
std::array< int64_t, 2 > lvid_leid_from_table_offset(int64_t table_offset)