CDT++
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
18
21template <int dimension>
22struct Geometry;
23
25template <>
26struct [[nodiscard("This contains data!")]] Geometry<3>
27{
29 Int_precision N3{0}; // NOLINT
30
32 Int_precision N3_31{0}; // NOLINT
33
35 Int_precision N3_13{0}; // NOLINT
36
38 Int_precision N3_31_13{0}; // NOLINT
39
41 Int_precision N3_22{0}; // NOLINT
42
44 Int_precision N2{0}; // NOLINT
45
47 Int_precision N1{0}; // NOLINT
48
50 Int_precision N1_TL{0}; // NOLINT
51
53 Int_precision N1_SL{0}; // NOLINT
54
56 Int_precision N0{0}; // NOLINT
57
59 Geometry() = default;
60
64 explicit Geometry(
66
67 : N3{static_cast<Int_precision>(triangulation.number_of_finite_cells())}
68 , N3_31{static_cast<Int_precision>(triangulation.get_three_one().size())}
69 , N3_13{static_cast<Int_precision>(triangulation.get_one_three().size())}
70 , N3_31_13{N3_31 + N3_13}
71 , N3_22{static_cast<Int_precision>(triangulation.get_two_two().size())}
72 , N2{static_cast<Int_precision>(triangulation.number_of_finite_facets())}
73 , N1{static_cast<Int_precision>(triangulation.number_of_finite_edges())}
74 , N1_TL{triangulation.N1_TL()}
75 , N1_SL{triangulation.N1_SL()}
76 , N0{static_cast<Int_precision>(triangulation.number_of_vertices())}
77
78 {}
79
85 friend void swap(Geometry& swap_from, Geometry& swap_into) noexcept
86 {
87#ifndef NDEBUG
88 spdlog::debug("{} called.\n", __PRETTY_FUNCTION__);
89#endif
90 using std::swap;
91 swap(swap_from.N3, swap_into.N3);
92 swap(swap_from.N3_31, swap_into.N3_31);
93 swap(swap_from.N3_13, swap_into.N3_13);
94 swap(swap_from.N3_31_13, swap_into.N3_31_13);
95 swap(swap_from.N3_22, swap_into.N3_22);
96 swap(swap_from.N2, swap_into.N2);
97 swap(swap_from.N1, swap_into.N1);
98 swap(swap_from.N1_TL, swap_into.N1_TL);
99 swap(swap_from.N1_SL, swap_into.N1_SL);
100 swap(swap_from.N0, swap_into.N0);
101 } // swap
102}; // struct Geometry<3>
103
104using Geometry_3 = Geometry<3>;
105
106template <>
107struct [[nodiscard("This contains data!")]] Geometry<4>
108{
109 Int_precision N4{0};
110 Int_precision N3{0};
111 Int_precision N2{0};
112 Int_precision N1{0};
113 Int_precision N0{0};
114}; // struct Geometry<4>
115
116using Geometry_4 = Geometry<4>;
117
118#endif // CDT_PLUSPLUS_GEOMETRY_HPP
Create foliated spherical triangulations.
std::int_fast32_t Int_precision
Definition: Settings.hpp:31
Definition: group.cpp:53
3D Geometry
Definition: Geometry.hpp:27
friend void swap(Geometry &swap_from, Geometry &swap_into) noexcept
Non-member swap function for Geometry.
Definition: Geometry.hpp:85
Geometry()=default
Default ctor.
Geometry(foliated_triangulations::FoliatedTriangulation_3 const &triangulation)
Constructor with triangulation.
Definition: Geometry.hpp:64