Wildmeshing Toolkit
Loading...
Searching...
No Matches
SimplexDart.hpp
Go to the documentation of this file.
1#pragma once
3#include <wmtk/Tuple.hpp>
4#include <wmtk/Types.hpp>
5
6#include "Dart.hpp"
7namespace wmtk::autogen {
8// TODO: valid_index here currently stands for the range [0,N] rfather than the set of discontiguous
9// valid indices stored in each mesh. This nomenclature needs to be cleaned up.
11{
12public:
14
15 // to avoid potential construction costs we have some singletons available
17
18 // takes two valid indices and returns their dart-product as a valid index
19 int8_t product(int8_t a, int8_t b) const;
20 int8_t inverse(int8_t a) const;
21
22 // returns the action equivalent to switching by a particular primitive
24
25 // returns the two-sided identity action - product(identity(),x) = x
26 int8_t identity() const;
27 // returns the dart O such that for each simplex I[i] in the identity I,
28 // O[i] = S - I[i], where S is the facet simplex
29 int8_t opposite() const;
30
31 Dart act(const Dart& d, int8_t action) const;
32
33 wmtk::Tuple tuple_from_valid_index(int64_t gid, int8_t valid_index) const;
34 wmtk::Tuple update_tuple_from_valid_index(const Tuple& t, int8_t valid_index) const;
35
36 wmtk::Tuple tuple_from_dart(const Dart& dart) const;
37 Dart dart_from_tuple(const wmtk::Tuple& t) const;
38
39 int8_t valid_index_from_tuple(const wmtk::Tuple& t) const;
40
41
42 int8_t simplex_index(const int8_t valid_index, PrimitiveType simplex_type) const;
43 int8_t simplex_index(const Dart& dart, PrimitiveType simplex_type) const;
44
45 using binary_op_type = int8_t (*)(int8_t, int8_t);
46 using unary_op_type = int8_t (*)(int8_t);
48 using nullary_op_type = int8_t (*)();
49
50 size_t size() const;
52
53
54 // converts input valid_indx to the target mesh
55 int8_t convert(int8_t valid_index, const SimplexDart& target) const;
56
57
59
60private:
67};
68} // namespace wmtk::autogen
The Tuple is the basic navigation tool in our mesh data structure.
Definition Tuple.hpp:19
const nullary_op_type m_identity
wmtk::Tuple tuple_from_dart(const Dart &dart) const
int8_t simplex_index(const int8_t valid_index, PrimitiveType simplex_type) const
int8_t valid_index_from_tuple(const wmtk::Tuple &t) const
const wmtk::PrimitiveType m_simplex_type
static const SimplexDart & get_singleton(wmtk::PrimitiveType simplex_type)
VectorX< int8_t >::ConstMapType valid_indices() const
const unary_op_type m_inverse
wmtk::Tuple update_tuple_from_valid_index(const Tuple &t, int8_t valid_index) const
wmtk::PrimitiveType simplex_type() const
const primitive_to_index_type m_primitive_to_index
const binary_op_type m_product
int8_t primitive_as_index(wmtk::PrimitiveType pt) const
int8_t inverse(int8_t a) const
int8_t product(int8_t a, int8_t b) const
int8_t(*)(PrimitiveType) primitive_to_index_type
const nullary_op_type m_opposite
int8_t(*)(int8_t) unary_op_type
Dart act(const Dart &d, int8_t action) const
Dart dart_from_tuple(const wmtk::Tuple &t) const
int8_t convert(int8_t valid_index, const SimplexDart &target) const
wmtk::Tuple tuple_from_valid_index(int64_t gid, int8_t valid_index) const
int8_t(*)(int8_t, int8_t) binary_op_type
Vector< T, Eigen::Dynamic > VectorX
Definition Types.hpp:19