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>
16
struct
mesh_type_from_primitive_type
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>
22
using
mesh_type_from_primitive_type_t
=
typename
mesh_type_from_primitive_type<pt>::type
;
23
24
template
<>
25
struct
mesh_type_from_primitive_type
<
PrimitiveType
::
Vertex
>
26
{
27
using
type
=
PointMesh
;
28
};
29
template
<>
30
struct
mesh_type_from_primitive_type
<
PrimitiveType
::
Edge
>
31
{
32
using
type
=
EdgeMesh
;
33
};
34
template
<>
35
struct
mesh_type_from_primitive_type
<
PrimitiveType
::
Triangle
>
36
{
37
using
type
=
TriMesh
;
38
};
39
40
template
<>
41
struct
mesh_type_from_primitive_type
<
PrimitiveType
::
Tetrahedron
>
42
{
43
using
type
=
TetMesh
;
44
};
45
46
template
<
int
8_t DIM>
47
struct
mesh_type_from_dimension
48
{
49
constexpr
static
PrimitiveType
primitive_type
=
get_primitive_type_from_id
(DIM);
50
using
type
=
wmtk::utils::mesh_type_from_primitive_type_t<primitive_type>
;
51
};
52
53
54
template
<
int
8_t DIM>
55
using
mesh_type_from_dimension_t
=
typename
mesh_type_from_dimension<DIM>::type
;
56
}
// namespace wmtk::utils
Primitive.hpp
wmtk::EdgeMesh
Definition:
EdgeMesh.hpp:16
wmtk::Mesh
Definition:
Mesh.hpp:107
wmtk::PointMesh
Definition:
PointMesh.hpp:12
wmtk::TetMesh
Definition:
TetMesh.hpp:14
wmtk::TriMesh
Definition:
TriMesh.hpp:19
wmtk::utils
Definition:
Tuple.hpp:22
wmtk::utils::mesh_type_from_dimension_t
typename mesh_type_from_dimension< DIM >::type mesh_type_from_dimension_t
Definition:
mesh_type_from_primitive_type.hpp:55
wmtk::utils::mesh_type_from_primitive_type_t
typename mesh_type_from_primitive_type< pt >::type mesh_type_from_primitive_type_t
Definition:
mesh_type_from_primitive_type.hpp:22
wmtk
Definition:
Accessor.hpp:6
wmtk::get_primitive_type_from_id
constexpr PrimitiveType get_primitive_type_from_id(int8_t id)
Get the primitive type corresponding to its unique integer id.
Definition:
PrimitiveType.hpp:59
wmtk::PrimitiveType
PrimitiveType
Definition:
PrimitiveType.hpp:9
wmtk::PrimitiveType::Triangle
@ Triangle
wmtk::PrimitiveType::Vertex
@ Vertex
wmtk::PrimitiveType::Tetrahedron
@ Tetrahedron
wmtk::PrimitiveType::Edge
@ Edge
wmtk::utils::mesh_type_from_dimension
Definition:
mesh_type_from_primitive_type.hpp:48
wmtk::utils::mesh_type_from_dimension::primitive_type
constexpr static PrimitiveType primitive_type
Definition:
mesh_type_from_primitive_type.hpp:49
wmtk::utils::mesh_type_from_dimension::type
wmtk::utils::mesh_type_from_primitive_type_t< primitive_type > type
Definition:
mesh_type_from_primitive_type.hpp:50
wmtk::utils::mesh_type_from_primitive_type
Definition:
mesh_type_from_primitive_type.hpp:17
src
wmtk
utils
mesh_type_from_primitive_type.hpp
Generated by
1.9.1