-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathNumbering.h
63 lines (50 loc) · 1.71 KB
/
Numbering.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// SPDX-FileCopyrightText: 2017-2024 Technical University of Munich
//
// SPDX-License-Identifier: BSD-3-Clause
/**
* @file
* This file is part of PUML
*
* For conditions of distribution and use, please see the copyright
* notice in the file 'COPYING' at the root directory of this package
* and the copyright notice at https://github.com/TUM-I5/PUMGen
*
* @author Sebastian Rettenberger <[email protected]>
* @author David Schneller <[email protected]>
*/
#ifndef PUML_NUMBERING_H
#define PUML_NUMBERING_H
#include "Topology.h"
namespace PUML::internal {
template <TopoType Topo>
class Numbering {
public:
typedef unsigned int face_t[Topology<Topo>::facevertices()];
typedef unsigned int edge_t[2];
typedef unsigned int faceadj_t[2];
static auto facevertices() -> const face_t*;
static auto edgevertices() -> const edge_t*;
static auto edgefaces() -> const faceadj_t*;
};
template <>
class Numbering<TETRAHEDRON> {
public:
typedef unsigned int face_t[Topology<TETRAHEDRON>::facevertices()];
typedef unsigned int edge_t[2];
typedef unsigned int faceadj_t[2];
static auto facevertices() -> const face_t* {
static const face_t Vertices[4] = {{1, 0, 2}, {0, 1, 3}, {1, 2, 3}, {2, 0, 3}};
return Vertices;
}
static auto edgevertices() -> const edge_t* {
static const edge_t Vertices[6] = {{0, 1}, {1, 2}, {2, 0}, {0, 3}, {1, 3}, {2, 3}};
return Vertices;
}
static auto edgefaces() -> const faceadj_t* {
static const faceadj_t Faces[6] = {{0, 1}, {0, 2}, {0, 3}, {1, 3}, {1, 2}, {2, 3}};
return Faces;
}
};
// TODO(someone): adapt for HEXAHEDRON. Maybe edgefaces() can be removed or inferred
} // namespace PUML::internal
#endif // PUML_NUMBERING_H