Wildmeshing Toolkit
local_id_table_offset.hxx
Go to the documentation of this file.
1 #pragma once
4 namespace wmtk::autogen::tet_mesh {
5 // computes the offset of a tuple's local ids in the tables
6 inline int64_t local_id_table_offset(const Tuple& tuple)
7 {
8  int64_t value = wmtk::utils::TupleInspector::local_vid(tuple) * 6 * 4 +
11 
12 
13  // value = (TupleInspector::local_vid(tuple) * 6 + TupleInspector::local_eid(tuple)) * 4 +
14  // TupleInspector::local_fid(tuple);
15  return value;
16 }
17 
18 inline std::array<int64_t, 3> lvid_leid_lfid_from_table_offset(int64_t table_offset)
19 {
20  std::array<int64_t, 3> r;
21  auto& [lvid, leid, lfid] = r;
22  lfid = table_offset % 4;
23 
24  int64_t ve_offset = table_offset / 4;
25  leid = ve_offset % 6;
26  lvid = ve_offset / 6;
27  return r;
28 }
29 
30 } // namespace wmtk::autogen::tet_mesh
static int8_t local_eid(const Tuple &t)
static int8_t local_vid(const Tuple &t)
static int8_t local_fid(const Tuple &t)
std::array< int64_t, 3 > lvid_leid_lfid_from_table_offset(int64_t table_offset)
int64_t local_id_table_offset(const Tuple &t)