CDT++ 1.0.0
Causal Dynamical Triangulations in C++
Loading...
Searching...
No Matches
Geometry.hpp
Go to the documentation of this file.
1/*******************************************************************************
2 Causal Dynamical Triangulations in C++ using CGAL
3
4 Copyright © 2018 Adam Getchell
5 ******************************************************************************/
6
13
14#ifndef CDT_PLUSPLUS_GEOMETRY_HPP
15#define CDT_PLUSPLUS_GEOMETRY_HPP
16
17#include <type_traits>
18
20
21namespace cdt
22{
25 template <int dimension>
26 struct Geometry;
27
29 template <>
30 struct [[nodiscard("This contains data!")]] Geometry<3>
31 {
32 static_assert(std::is_nothrow_swappable_v<Int_precision>,
33 "Geometry swap requires non-throwing scalar swaps.");
34
36 Int_precision N3{0}; // NOLINT
37
39 Int_precision N3_31{0}; // NOLINT
40
42 Int_precision N3_13{0}; // NOLINT
43
45 Int_precision N3_31_13{0}; // NOLINT
46
48 Int_precision N3_22{0}; // NOLINT
49
51 Int_precision N2{0}; // NOLINT
52
54 Int_precision N1{0}; // NOLINT
55
57 Int_precision N1_TL{0}; // NOLINT
58
60 Int_precision N1_SL{0}; // NOLINT
61
63 Int_precision N0{0}; // NOLINT
64
66 Geometry() = default;
67
71 explicit Geometry(
73
74 : N3{static_cast<Int_precision>(triangulation.number_of_finite_cells())}
75 , N3_31{static_cast<Int_precision>(
76 triangulation.number_of_three_one_cells())}
77 , N3_13{static_cast<Int_precision>(
78 triangulation.number_of_one_three_cells())}
80 , N3_22{static_cast<Int_precision>(
81 triangulation.number_of_two_two_cells())}
82 , N2{static_cast<Int_precision>(
83 triangulation.number_of_finite_facets())}
84 , N1{static_cast<Int_precision>(triangulation.number_of_finite_edges())}
85 , N1_TL{triangulation.N1_TL()}
86 , N1_SL{triangulation.N1_SL()}
87 , N0{static_cast<Int_precision>(triangulation.number_of_vertices())}
88
89 {}
90
96 friend void swap(Geometry& swap_from, Geometry& swap_into) noexcept
97 {
98 using std::swap;
99 swap(swap_from.N3, swap_into.N3);
100 swap(swap_from.N3_31, swap_into.N3_31);
101 swap(swap_from.N3_13, swap_into.N3_13);
102 swap(swap_from.N3_31_13, swap_into.N3_31_13);
103 swap(swap_from.N3_22, swap_into.N3_22);
104 swap(swap_from.N2, swap_into.N2);
105 swap(swap_from.N1, swap_into.N1);
106 swap(swap_from.N1_TL, swap_into.N1_TL);
107 swap(swap_from.N1_SL, swap_into.N1_SL);
108 swap(swap_from.N0, swap_into.N0);
109 } // swap
110 }; // struct Geometry<3>
111
114} // namespace cdt
115
116#endif // CDT_PLUSPLUS_GEOMETRY_HPP
Create foliated spherical triangulations.
FoliatedTriangulation< 3 > FoliatedTriangulation_3
Three-dimensional foliated Delaunay triangulation.
clang-15 does not support std::format
std::int32_t Int_precision
Definition Settings.hpp:30
Geometry< 3 > Geometry_3
Three-dimensional simplex-count geometry.
Definition Geometry.hpp:113
Int_precision N3
Number of 3D simplices.
Definition Geometry.hpp:36
Int_precision N3_13
Number of (1,3) simplices.
Definition Geometry.hpp:42
Geometry()=default
Default ctor.
Int_precision N2
Number of 2D faces.
Definition Geometry.hpp:51
friend void swap(Geometry &swap_from, Geometry &swap_into) noexcept
Non-member swap function for Geometry.
Definition Geometry.hpp:96
Int_precision N3_22
Number of (2,2) simplices.
Definition Geometry.hpp:48
Int_precision N1_SL
Number of spacelike edges.
Definition Geometry.hpp:60
Int_precision N3_31_13
Number of (3,1) + (1,3) simplices.
Definition Geometry.hpp:45
Int_precision N1
Number of 1D edges.
Definition Geometry.hpp:54
Geometry(foliated_triangulations::FoliatedTriangulation_3 const &triangulation)
Constructor with triangulation.
Definition Geometry.hpp:71
Int_precision N0
Number of vertices.
Definition Geometry.hpp:63
Int_precision N1_TL
Number of timelike edges.
Definition Geometry.hpp:57
Int_precision N3_31
Number of (3,1) simplices.
Definition Geometry.hpp:39