CDT++
Causal Dynamical Triangulations in C++
Loading...
Searching...
No Matches
S3Action_test.cpp
Go to the documentation of this file.
1/*******************************************************************************
2 Causal Dynamical Triangulations in C++ using CGAL
3
4 Copyright © 2017 Adam Getchell
5 ******************************************************************************/
6
12
13#include "S3Action.hpp"
14
15#include <doctest/doctest.h>
16
17#include "Manifold.hpp"
18
19using namespace std;
20using namespace manifolds;
21
22SCENARIO("Calculate the bulk action on S3 triangulations" *
23 doctest::test_suite("s3action"))
24{
25 spdlog::debug("Calculate the bulk action on S3 triangulations.\n");
26 GIVEN("A 3D 2-sphere foliated triangulation.")
27 {
28 auto constexpr simplices = 6400;
29 auto constexpr timeslices = 7;
30 auto constexpr K = 1.1L; // NOLINT
31 auto constexpr Lambda = 0.1L;
32 Manifold_3 const universe(simplices, timeslices);
33 // Verify triangulation
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());
39
40 universe.print_volume_per_timeslice();
41
42 CHECK_EQ(universe.max_time(), timeslices);
43 CHECK_EQ(universe.min_time(), 1);
44 WHEN("The alpha=-1 Bulk Action is calculated.")
45 {
46 auto Bulk_action = S3_bulk_action_alpha_minus_one(
47 universe.N1_TL(), universe.N3_31_13(), universe.N3_22(), K, Lambda);
48 THEN("The action falls within accepted values.")
49 {
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);
54 }
55 }
56 WHEN("The alpha=1 Bulk Action is calculated.")
57 {
58 auto Bulk_action = S3_bulk_action_alpha_one(
59 universe.N1_TL(), universe.N3_31_13(), universe.N3_22(), K, Lambda);
60 THEN("The action falls within accepted values.")
61 {
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);
66 }
67 }
68 WHEN("The generalized Bulk Action is calculated.")
69 {
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.")
75 {
76 spdlog::debug("S3_bulk_action() = {}\n", Bulk_action.to_double());
77 REQUIRE_LE(2700, Bulk_action);
78 REQUIRE_LE(Bulk_action, 3700);
79 }
80 }
81 WHEN(
82 "S3_bulk_action(alpha=1) and S3_bulk_action_alpha_one() are "
83 "calculated.")
84 {
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);
88 auto Bulk_action_one = S3_bulk_action_alpha_one(
89 universe.N1_TL(), universe.N3_31_13(), universe.N3_22(), K, Lambda);
90 THEN(
91 "S3_bulk_action(alpha=1) == S3_bulk_action_alpha_one() within "
92 "tolerances.")
93 {
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))
99 .epsilon(TOLERANCE));
100 }
101 }
102 }
103}
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.
Definition: S3Action.hpp:144
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.
Definition: S3Action.hpp:47
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 .
Definition: S3Action.hpp:252
static double constexpr TOLERANCE
Sets epsilon values for floating point comparisons.
Definition: Settings.hpp:51
SCENARIO("Perform bistellar flip on Delaunay triangulation" *doctest::test_suite("bistellar"))