Wildmeshing Toolkit
Loading...
Searching...
No Matches
local_id_table_offset.hxx
Go to the documentation of this file.
1#pragma once
4// computes the offset of a tuple's local ids in the tables
5inline int64_t local_id_table_offset(const Tuple& tuple)
6{
7 int64_t value = tuple.local_vid() * 6 * 4 + tuple.local_eid() * 4 + tuple.local_fid();
8 return value;
9}
10
11inline std::array<int64_t, 3> lvid_leid_lfid_from_table_offset(int64_t table_offset)
12{
13 std::array<int64_t, 3> r;
14 auto& [lvid, leid, lfid] = r;
15 lfid = table_offset % 4;
16
17 int64_t ve_offset = table_offset / 4;
18 leid = ve_offset % 6;
19 lvid = ve_offset / 6;
20 return r;
21}
22
23} // namespace wmtk::autogen::tet_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_fid() const
Definition Tuple.hxx:62
int8_t local_eid() const
Definition Tuple.hxx:57
std::array< int64_t, 3 > lvid_leid_lfid_from_table_offset(int64_t table_offset)
int64_t local_id_table_offset(const Tuple &t)