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