BouncingBlackHole.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 #include <memory>
8 
9 #include "DataStructures/SpinWeighted.hpp"
11 #include "Evolution/Systems/Cce/AnalyticSolutions/WorldtubeData.hpp"
12 #include "Evolution/Systems/Cce/Tags.hpp"
13 #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp"
15 #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
16 #include "Utilities/Gsl.hpp"
17 #include "Utilities/Literals.hpp"
18 #include "Utilities/TMPL.hpp"
19 
20 /// \cond
21 class DataVector;
22 /// \endcond
23 
24 namespace Cce::Solutions {
25 
26 /*!
27  * \brief Analytic solution representing a coordinate oscillation about a
28  * stationary Schwarzschild black hole.
29  *
30  * \details As the oscillation in the metric data at the worldtube is a pure
31  * coordinate effect, the system evolved using this worldtube data should
32  * produce zero news. The solution is a coordinate transform applied to the
33  * Schwarzschild solution in Kerr-Schild coordinates.
34  */
36  struct Amplitude {
37  using type = double;
38  static constexpr OptionString help{
39  "The coordinate distance of the gauge oscillation"};
40  static type lower_bound() noexcept { return 0.0; }
41  static type default_value() noexcept { return 2.0; }
42  };
44  using type = double;
45  static constexpr OptionString help{
46  "The extraction radius of the spherical solution"};
47  static type lower_bound() noexcept { return 0.0; }
48  static type default_value() noexcept { return 20.0; }
49  };
50  struct Mass {
51  using type = double;
52  static constexpr OptionString help{
53  "The mass of the Schwarzschild black hole"};
54  static type lower_bound() noexcept { return 0.0; }
55  static type default_value() noexcept { return 1.0; }
56  };
57  struct Period {
58  using type = double;
59  static constexpr OptionString help{
60  "The period of the coordinate oscillation"};
61  static type lower_bound() noexcept { return 0.0; }
62  static type default_value() noexcept { return 40.0; }
63  };
64 
65  using options = tmpl::list<Amplitude, ExtractionRadius, Mass, Period>;
66 
67  WRAPPED_PUPable_decl_template(BouncingBlackHole); // NOLINT
68 
69  explicit BouncingBlackHole(CkMigrateMessage* /*unused*/) noexcept {}
70 
71  // clang doesn't manage to use = default correctly in this case
72  // NOLINTNEXTLINE(modernize-use-equals-default)
73  BouncingBlackHole() noexcept {}
74 
75  BouncingBlackHole(double amplitude, double extraction_radius, double mass,
76  double period) noexcept;
77 
78  std::unique_ptr<WorldtubeData> get_clone() const noexcept override;
79 
80  void pup(PUP::er& p) noexcept override;
81 
82  protected:
83  // The bouncing black hole solution is easily computed directly, so requires
84  // no additional preparation.
85  void prepare_solution(const size_t /*l_max*/,
86  const double /*time*/) const noexcept override{};
87 
88  using WorldtubeData::variables_impl;
89 
90  /*!
91  * \brief The implementation function that computes the spacetime metric on
92  * the extraction sphere at collocation points associated with angular
93  * resolution `l_max`.
94  *
95  * \details The spacetime metric \f$g_{a b}\f$ is determined by evaluating the
96  * Kerr-Schild metric at a set of transformed coordinates \f$t^\prime = t,
97  * y^\prime = y, z^\prime = z\f$, and
98  *
99  * \f{align*}{
100  * x = x^\prime + A \left(\sin\left(\frac{2 \pi t}{T}\right)\right)^4,
101  * \f}
102  *
103  * where the amplitude \f$A\f$ is set by the option `Amplitude` and the period
104  * \f$T\f$ is set by the option `Period`. In this notation we take
105  * the primed coordinates to be the coordinates for which the black hole has
106  * time-dependent coordinate position.
107  */
108  void variables_impl(
109  gsl::not_null<tnsr::aa<DataVector, 3>*> spacetime_metric, size_t l_max,
110  double time,
111  tmpl::type_<
113  const noexcept override;
114 
115  /*!
116  * \brief The implementation function that computes the first time derivative
117  * of the spacetime metric on the extraction sphere.
118  *
119  * \details The time derivative of the spacetime metric
120  * \f$\partial_t g_{a b}\f$ comes entirely from the Jacobian factor:
121  *
122  * \f{align*}{
123  * \partial_t x = \frac{8 \pi A}{T} \cos\left(\frac{2 \pi t}{T}\right)
124  * \left(\sin\left(\frac{2 \pi t}{T}\right)\right)^3,
125  * \f}
126  *
127  * so the transformed metric derivative is,
128  *
129  * \f{align*}{
130  * \partial_t g_{a^\prime b^\prime} = 2 \partial_{(a^\prime} \partial_t x
131  * \partial_{b^\prime)} x^a g_{x a}.
132  * \f}
133  *
134  * In this notation we take the primed coordinates to be the coordinates for
135  * which the black hole has time-dependent coordinate position.
136  */
137  void variables_impl(
138  gsl::not_null<tnsr::aa<DataVector, 3>*> dt_spacetime_metric, size_t l_max,
139  double time,
140  tmpl::type_<::Tags::dt<gr::Tags::SpacetimeMetric<
141  3, ::Frame::Inertial, DataVector>>> /*meta*/) const noexcept override;
142 
143  /*!
144  * \brief The implementation function that computes the first spatial
145  * derivative of the spacetime metric on the extraction sphere.
146  *
147  * \details The calculation proceeds by standard coordinate transform
148  * techniques for the transformation given by \f$t^\prime = t,
149  * y^\prime = y, z^\prime = z\f$, and
150  *
151  * \f{align*}{
152  * x = x^\prime + A \left(\sin\left(\frac{2 \pi t}{T}\right)\right)^4,
153  * \f}
154  *
155  * The general coordinate transformation formula that gives the metric
156  * is then
157  * \f{align*}{
158  * \partial_a g_{b c} =
159  * \partial_a \partial_b x^{\prime a^\prime} \partial_c x^{\prime b^\prime}
160  * g_{a^\prime b^\prime}
161  * + \partial_b x^{\prime a^\prime} \partial_a \partial_c x^{\prime b^\prime}
162  * g_{a^\prime b^\prime}
163  * + \partial_a x^{\prime a^\prime} \partial_b x^{\prime b^\prime}
164  * \partial_c x^{\prime c^\prime} \partial_a g_{b c}
165  * \f}
166  */
167  void variables_impl(
168  gsl::not_null<tnsr::iaa<DataVector, 3>*> d_spacetime_metric, size_t l_max,
169  double time,
170  tmpl::type_<
171  GeneralizedHarmonic::Tags::Phi<3, ::Frame::Inertial>> /*meta*/)
172  const noexcept override;
173 
174  /// The News in the bouncing black hole solution vanishes, as the oscillation
175  /// comes entirely from a coordinate transform.
176  void variables_impl(
177  gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, -2>>*> news,
178  size_t output_l_max, double time,
179  tmpl::type_<Tags::News> /*meta*/) const noexcept override;
180 
181  double amplitude_ = std::numeric_limits<double>::signaling_NaN();
182  double mass_ = std::numeric_limits<double>::signaling_NaN();
183  double frequency_ = std::numeric_limits<double>::signaling_NaN();
184 };
185 } // namespace Cce::Solutions
CharmPupable.hpp
Literals.hpp
Cce::Solutions::BouncingBlackHole::ExtractionRadius
Definition: BouncingBlackHole.hpp:43
Cce::Solutions::BouncingBlackHole::Period
Definition: BouncingBlackHole.hpp:57
GeneralizedHarmonic
Items related to evolving the first-order generalized harmonic system.
Definition: Characteristics.cpp:21
SpinWeighted
Make a spin-weighted type T with spin-weight Spin. Mathematical operators are restricted to addition,...
Definition: SpinWeighted.hpp:24
Cce::Solutions::BouncingBlackHole
Analytic solution representing a coordinate oscillation about a stationary Schwarzschild black hole.
Definition: BouncingBlackHole.hpp:35
cstddef
Cce::Solutions::BouncingBlackHole::variables_impl
void variables_impl(gsl::not_null< tnsr::aa< DataVector, 3 > * > spacetime_metric, size_t l_max, double time, tmpl::type_< gr::Tags::SpacetimeMetric< 3, ::Frame::Inertial, DataVector >>) const noexcept override
The implementation function that computes the spacetime metric on the extraction sphere at collocatio...
gr::Tags::SpacetimeMetric
Definition: Tags.hpp:17
DataVector
Stores a collection of function values.
Definition: DataVector.hpp:42
memory
Cce::Solutions::BouncingBlackHole::Mass
Definition: BouncingBlackHole.hpp:50
Cce::Solutions::WorldtubeData
Abstract base class for analytic worldtube data for verifying the CCE system.
Definition: WorldtubeData.hpp:66
tnsr
Type aliases to construct common Tensors.
Definition: TypeAliases.hpp:31
Cce::Solutions::BouncingBlackHole::Amplitude
Definition: BouncingBlackHole.hpp:36
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
Gsl.hpp
Frame
Definition: IndexType.hpp:36
gr::spacetime_metric
void spacetime_metric(gsl::not_null< tnsr::aa< DataType, Dim, Frame > * > spacetime_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, Dim, Frame > &shift, const tnsr::ii< DataType, Dim, Frame > &spatial_metric) noexcept
Computes the spacetime metric from the spatial metric, lapse, and shift.
gr
Definition: GaugeWave.hpp:27
Tensor.hpp
ComplexDataVector
Stores a collection of complex function values.
Definition: ComplexDataVector.hpp:47
std::unique_ptr
OptionString
const char *const OptionString
The string used in option structs.
Definition: Options.hpp:30
gsl
Implementations from the Guideline Support Library.
Definition: Gsl.hpp:80
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: Gsl.hpp:183