Wildmeshing Toolkit
local_id_table_offset.hxx
Go to the documentation of this file.
1
#pragma once
2
#include <
wmtk/utils/TupleInspector.hpp
>
3
#include "
autogenerated_tables.hpp
"
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 +
9
wmtk::utils::TupleInspector::local_eid
(tuple) * 4 +
10
wmtk::utils::TupleInspector::local_fid
(tuple);
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
TupleInspector.hpp
wmtk::Tuple
Definition:
Tuple.hpp:42
wmtk::utils::TupleInspector::local_eid
static int8_t local_eid(const Tuple &t)
Definition:
TupleInspector.hpp:14
wmtk::utils::TupleInspector::local_vid
static int8_t local_vid(const Tuple &t)
Definition:
TupleInspector.hpp:13
wmtk::utils::TupleInspector::local_fid
static int8_t local_fid(const Tuple &t)
Definition:
TupleInspector.hpp:15
wmtk::autogen::tet_mesh
Definition:
autogenerated_tables.cpp:4
wmtk::autogen::tet_mesh::lvid_leid_lfid_from_table_offset
std::array< int64_t, 3 > lvid_leid_lfid_from_table_offset(int64_t table_offset)
Definition:
local_id_table_offset.hxx:18
wmtk::autogen::tet_mesh::local_id_table_offset
int64_t local_id_table_offset(const Tuple &t)
Definition:
local_id_table_offset.hxx:6
autogenerated_tables.hpp
src
wmtk
autogen
tet_mesh
local_id_table_offset.hxx
Generated by
1.9.1