15#include <doctest/doctest.h>
20using namespace manifolds;
22SCENARIO(
"Calculate the bulk action on S3 triangulations" *
23 doctest::test_suite(
"s3action"))
25 spdlog::debug(
"Calculate the bulk action on S3 triangulations.\n");
26 GIVEN(
"A 3D 2-sphere foliated triangulation.")
28 auto constexpr simplices = 6400;
29 auto constexpr timeslices = 7;
30 auto constexpr K = 1.1L;
31 auto constexpr Lambda = 0.1L;
32 Manifold_3 const universe(simplices, timeslices);
34 CHECK_EQ(universe.N3(), universe.simplices());
35 CHECK_EQ(universe.N1(), universe.edges());
36 CHECK_EQ(universe.N0(), universe.vertices());
37 CHECK_EQ(universe.dimensionality(), 3);
38 CHECK(universe.is_correct());
40 universe.print_volume_per_timeslice();
42 CHECK_EQ(universe.max_time(), timeslices);
43 CHECK_EQ(universe.min_time(), 1);
44 WHEN(
"The alpha=-1 Bulk Action is calculated.")
47 universe.N1_TL(), universe.N3_31_13(), universe.N3_22(), K, Lambda);
48 THEN(
"The action falls within accepted values.")
50 spdlog::debug(
"S3_bulk_action_alpha_minus_one() = {}\n",
51 Bulk_action.to_double());
52 REQUIRE_LE(3500, Bulk_action);
53 REQUIRE_LE(Bulk_action, 4500);
56 WHEN(
"The alpha=1 Bulk Action is calculated.")
59 universe.N1_TL(), universe.N3_31_13(), universe.N3_22(), K, Lambda);
60 THEN(
"The action falls within accepted values.")
62 spdlog::debug(
"S3_bulk_action_alpha_one() = {}\n",
63 Bulk_action.to_double());
64 REQUIRE_LE(2000, Bulk_action);
65 REQUIRE_LE(Bulk_action, 3000);
68 WHEN(
"The generalized Bulk Action is calculated.")
70 auto constexpr Alpha = 0.6L;
71 spdlog::debug(
"(Long double) Alpha = {}\n", Alpha);
72 auto Bulk_action =
S3_bulk_action(universe.N1_TL(), universe.N3_31_13(),
73 universe.N3_22(), Alpha, K, Lambda);
74 THEN(
"The action falls within accepted values.")
76 spdlog::debug(
"S3_bulk_action() = {}\n", Bulk_action.to_double());
77 REQUIRE_LE(2700, Bulk_action);
78 REQUIRE_LE(Bulk_action, 3700);
82 "S3_bulk_action(alpha=1) and S3_bulk_action_alpha_one() are "
85 auto constexpr Alpha = 1.0L;
86 auto Bulk_action =
S3_bulk_action(universe.N1_TL(), universe.N3_31_13(),
87 universe.N3_22(), Alpha, K, Lambda);
89 universe.N1_TL(), universe.N3_31_13(), universe.N3_22(), K, Lambda);
91 "S3_bulk_action(alpha=1) == S3_bulk_action_alpha_one() within "
94 spdlog::debug(
"S3_bulk_action() = {}\n", Bulk_action.to_double());
95 spdlog::debug(
"S3_bulk_action_alpha_one() = {}\n",
96 Bulk_action_one.to_double());
97 REQUIRE(utilities::Gmpzf_to_double(Bulk_action_one) ==
98 doctest::Approx(utilities::Gmpzf_to_double(Bulk_action))
Data structures for manifolds.
Calculate S3 bulk actions on 3D Delaunay Triangulations.
auto S3_bulk_action_alpha_one(Int_precision const N1_TL, Int_precision const N3_31_13, Int_precision const N3_22, long double const K, long double const Lambda) noexcept -> Gmpzf
Calculates S3 bulk action for =1.
auto S3_bulk_action_alpha_minus_one(Int_precision const N1_TL, Int_precision const N3_31_13, Int_precision const N3_22, long double const K, long double const Lambda) noexcept -> Gmpzf
Calculates S3 bulk action for =-1.
auto S3_bulk_action(Int_precision const N1_TL, Int_precision const N3_31_13, Int_precision const N3_22, long double const Alpha, long double const K, long double const Lambda) noexcept -> Gmpzf
Calculates the generalized S3 bulk action in terms of , , , , , and .
static double constexpr TOLERANCE
Sets epsilon values for floating point comparisons.
SCENARIO("Perform bistellar flip on Delaunay triangulation" *doctest::test_suite("bistellar"))