Wildmeshing Toolkit
local_id_table_offset.hxx
Go to the documentation of this file.
1
#pragma once
2
3
#include <
wmtk/utils/TupleInspector.hpp
>
4
#include "
autogenerated_tables.hpp
"
5
namespace
wmtk::autogen::tri_mesh
{
6
// computes the offset of a tuple's local ids in the tables
7
inline
int64_t
local_id_table_offset
(
const
Tuple
& tuple)
8
{
9
return
wmtk::utils::TupleInspector::local_vid
(tuple) * 3 +
10
wmtk::utils::TupleInspector::local_eid
(tuple);
11
}
12
13
inline
std::array<int64_t, 2>
lvid_leid_from_table_offset
(int64_t table_offset)
14
{
15
std::array<int64_t, 2> r;
16
auto
& [lvid, leid] = r;
17
18
lvid = table_offset / 3;
19
leid = table_offset % 3;
20
return
r;
21
}
22
23
}
// namespace wmtk::autogen::tri_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::autogen::tri_mesh
Definition:
autogenerated_tables.cpp:4
wmtk::autogen::tri_mesh::local_id_table_offset
int64_t local_id_table_offset(const Tuple &t)
Definition:
local_id_table_offset.hxx:7
wmtk::autogen::tri_mesh::lvid_leid_from_table_offset
std::array< int64_t, 2 > lvid_leid_from_table_offset(int64_t table_offset)
Definition:
local_id_table_offset.hxx:13
autogenerated_tables.hpp
src
wmtk
autogen
tri_mesh
local_id_table_offset.hxx
Generated by
1.9.1