13#include <doctest/doctest.h>
16using namespace foliated_triangulations;
18SCENARIO(
"Geometry special member and swap properties" *
19 doctest::test_suite(
"geometry"))
21 spdlog::debug(
"Geometry special member and swap properties.\n");
22 GIVEN(
"A 3-dimensional geometry.")
24 WHEN(
"Special members are examined.")
26 THEN(
"It is trivially destructible.")
28 REQUIRE(is_trivially_destructible_v<Geometry_3>);
29 spdlog::debug(
"It is trivially destructible.\n");
31 THEN(
"It is no-throw default constructible.")
33 REQUIRE(is_nothrow_default_constructible_v<Geometry_3>);
34 spdlog::debug(
"It is no-throw default constructible.\n");
36 THEN(
"It is no-throw copy constructible.")
38 REQUIRE(is_nothrow_copy_constructible_v<Geometry_3>);
39 spdlog::debug(
"It is no-throw copy constructible.\n");
41 THEN(
"It is no-throw copy assignable.")
43 REQUIRE(is_nothrow_copy_assignable_v<Geometry_3>);
44 spdlog::debug(
"It is no-throw copy assignable.\n");
46 THEN(
"It is no-throw move constructible.")
48 REQUIRE(is_nothrow_move_constructible_v<Geometry_3>);
49 spdlog::debug(
"It is no-throw move constructible.\n");
51 THEN(
"It is no-throw move assignable.")
53 REQUIRE(is_nothrow_move_assignable_v<Geometry_3>);
54 spdlog::debug(
"It is no-throw move assignable.\n");
56 THEN(
"It is no-throw swappable.")
58 REQUIRE(is_nothrow_swappable_v<Geometry_3>);
59 spdlog::debug(
"It is no-throw swappable.\n");
65SCENARIO(
"3-Geometry classification" * doctest::test_suite(
"geometry"))
67 spdlog::debug(
"3-Geometry classification.\n");
68 GIVEN(
"A small 3-dimensional geometry.")
70 WHEN(
"It is constructed with a Delaunay triangulation.")
72 auto constexpr desired_simplices = 72;
73 auto constexpr desired_timeslices = 3;
77 THEN(
"The Delaunay triangulation is described by the geometry.")
79 fmt::print(
"There are {} simplices ...\n", geometry.N3);
81 "There are {} (3,1) simplices and {} (2,2) simplices and {} (1,3) "
83 geometry.N3_31, geometry.N3_22, geometry.N3_13);
84 CHECK_GT(geometry.N3, 2);
86 triangulation.number_of_finite_cells()));
88 triangulation.get_three_one().size()));
90 triangulation.get_one_three().size()));
91 CHECK_EQ(geometry.N3_31 + geometry.N3_22 + geometry.N3_13, geometry.N3);
93 triangulation.get_two_two().size()));
95 triangulation.number_of_finite_facets()));
97 triangulation.number_of_finite_edges()));
98 CHECK_NE(geometry.N1_TL, 0);
99 CHECK_NE(geometry.N1_SL, 0);
100 CHECK_EQ(geometry.N1, geometry.N1_TL + geometry.N1_SL);
102 triangulation.number_of_vertices()));
105 fmt::print(
"There are {} edges.\n", geometry.N1);
106 fmt::print(
"There are {} timelike edges and {} spacelike edges.\n",
107 geometry.N1_TL, geometry.N1_SL);
109 triangulation.print_cells();
110 triangulation.print_edges();
113 "There are {} vertices with a max timevalue of {} and a min "
114 "timevalue of {}.\n",
115 geometry.N0, triangulation.max_time(), triangulation.min_time());
116 triangulation.print_volume_per_timeslice();
122SCENARIO(
"3-Geometry initialization" * doctest::test_suite(
"geometry"))
124 spdlog::debug(
"3-Geometry initialization.\n");
125 GIVEN(
"A 3-dimensional geometry.")
127 WHEN(
"It is default constructed.")
129 THEN(
"All data members are zero-initialized.")
132 REQUIRE_EQ(geometry.
N3, 0);
133 REQUIRE_EQ(geometry.
N3_31, 0);
134 REQUIRE_EQ(geometry.
N3_13, 0);
135 REQUIRE_EQ(geometry.
N3_22, 0);
136 REQUIRE_EQ(geometry.
N2, 0);
137 REQUIRE_EQ(geometry.
N1, 0);
138 REQUIRE_EQ(geometry.
N1_TL, 0);
139 REQUIRE_EQ(geometry.
N1_SL, 0);
140 REQUIRE_EQ(geometry.
N0, 0);
143 WHEN(
"It is constructed with a triangulation.")
145 auto constexpr desired_simplices = 640;
146 auto constexpr desired_timeslices = 4;
151 "The properties of the Delaunay triangulation are saved in geometry "
155 triangulation.number_of_finite_cells()));
157 triangulation.get_three_one().size()));
159 triangulation.get_one_three().size()));
160 CHECK_EQ(geometry.N3_31 + geometry.N3_22 + geometry.N3_13, geometry.N3);
162 triangulation.get_two_two().size()));
164 triangulation.number_of_finite_facets()));
166 triangulation.number_of_finite_edges()));
167 CHECK_NE(geometry.N1_TL, 0);
168 CHECK_NE(geometry.N1_SL, 0);
169 CHECK_EQ(geometry.N1_TL + geometry.N1_SL, geometry.N1);
171 triangulation.number_of_vertices()));
172 triangulation.print();
173 triangulation.print_volume_per_timeslice();
Geometric scalars of the Manifold used to calculate the Regge action.
std::int_fast32_t Int_precision
SCENARIO("Perform bistellar flip on Delaunay triangulation" *doctest::test_suite("bistellar"))
3D Foliated triangulation
Int_precision N1
Number of 1D edges.
Int_precision N3_31
Number of (3,1) simplices.
Int_precision N1_SL
Number of spacelike edges.
Int_precision N3_13
Number of (1,3) simplices.
Int_precision N2
Number of 2D faces.
Int_precision N3_22
Number of (2,2) simplices.
Int_precision N1_TL
Number of timelike edges.
Int_precision N3
Number of 3D simplices.
Int_precision N0
Number of vertices.