Wildmeshing Toolkit
mesh_type_from_primitive_type.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <wmtk/Primitive.hpp>
4 
5 namespace wmtk {
6 class Mesh;
7 class EdgeMesh;
8 class PointMesh;
9 class TetMesh;
10 class TriMesh;
11 } // namespace wmtk
12 namespace wmtk::utils {
13 
14 // helper functions for identifying a simplicial complex from a primtivie type
15 template <PrimitiveType pt>
17 {
18  // if we ever call this something is wrong, but leaving this impl to let compilation work
19  using type = Mesh;
20 };
21 template <PrimitiveType pt>
23 
24 template <>
26 {
27  using type = PointMesh;
28 };
29 template <>
31 {
32  using type = EdgeMesh;
33 };
34 template <>
36 {
37  using type = TriMesh;
38 };
39 
40 template <>
42 {
43  using type = TetMesh;
44 };
45 
46 template <int8_t DIM>
48 {
51 };
52 
53 
54 template <int8_t DIM>
56 } // namespace wmtk::utils
typename mesh_type_from_dimension< DIM >::type mesh_type_from_dimension_t
typename mesh_type_from_primitive_type< pt >::type mesh_type_from_primitive_type_t
Definition: Accessor.hpp:6
constexpr PrimitiveType get_primitive_type_from_id(int8_t id)
Get the primitive type corresponding to its unique integer id.
wmtk::utils::mesh_type_from_primitive_type_t< primitive_type > type