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"
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* /*unused*/) noexcept {}
75 
76  // clang doesn't manage to use = default correctly in this case
77  // NOLINTNEXTLINE(modernize-use-equals-default)
78  BouncingBlackHole() noexcept {}
79 
80  BouncingBlackHole(double amplitude, double extraction_radius, double mass,
81  double period) noexcept;
82 
83  std::unique_ptr<WorldtubeData> get_clone() const noexcept override;
84 
85  void pup(PUP::er& p) noexcept override;
86 
87  protected:
88  // The bouncing black hole solution is easily computed directly, so requires
89  // no additional preparation.
90  void prepare_solution(const size_t /*l_max*/,
91  const double /*time*/) const noexcept override{};
92 
93  using WorldtubeData::variables_impl;
94 
95  /*!
96  * \brief The implementation function that computes the spacetime metric on
97  * the extraction sphere at collocation points associated with angular
98  * resolution `l_max`.
99  *
100  * \details The spacetime metric \f$g_{a b}\f$ is determined by evaluating the
101  * Kerr-Schild metric at a set of transformed coordinates \f$t^\prime = t,
102  * y^\prime = y, z^\prime = z\f$, and
103  *
104  * \f{align*}{
105  * x = x^\prime + A \left(\sin\left(\frac{2 \pi t}{T}\right)\right)^4,
106  * \f}
107  *
108  * where the amplitude \f$A\f$ is set by the option `Amplitude` and the period
109  * \f$T\f$ is set by the option `Period`. In this notation we take
110  * the primed coordinates to be the coordinates for which the black hole has
111  * time-dependent coordinate position.
112  */
113  void variables_impl(
114  gsl::not_null<tnsr::aa<DataVector, 3>*> spacetime_metric, size_t l_max,
115  double time,
116  tmpl::type_<
118  const noexcept override;
119 
120  /*!
121  * \brief The implementation function that computes the first time derivative
122  * of the spacetime metric on the extraction sphere.
123  *
124  * \details The time derivative of the spacetime metric
125  * \f$\partial_t g_{a b}\f$ comes entirely from the Jacobian factor:
126  *
127  * \f{align*}{
128  * \partial_t x = \frac{8 \pi A}{T} \cos\left(\frac{2 \pi t}{T}\right)
129  * \left(\sin\left(\frac{2 \pi t}{T}\right)\right)^3,
130  * \f}
131  *
132  * so the transformed metric derivative is,
133  *
134  * \f{align*}{
135  * \partial_t g_{a^\prime b^\prime} = 2 \partial_{(a^\prime} \partial_t x
136  * \partial_{b^\prime)} x^a g_{x a}.
137  * \f}
138  *
139  * In this notation we take the primed coordinates to be the coordinates for
140  * which the black hole has time-dependent coordinate position.
141  */
142  void variables_impl(
143  gsl::not_null<tnsr::aa<DataVector, 3>*> dt_spacetime_metric, size_t l_max,
144  double time,
145  tmpl::type_<::Tags::dt<gr::Tags::SpacetimeMetric<
146  3, ::Frame::Inertial, DataVector>>> /*meta*/) const noexcept override;
147 
148  /*!
149  * \brief The implementation function that computes the first spatial
150  * derivative of the spacetime metric on the extraction sphere.
151  *
152  * \details The calculation proceeds by standard coordinate transform
153  * techniques for the transformation given by \f$t^\prime = t,
154  * y^\prime = y, z^\prime = z\f$, and
155  *
156  * \f{align*}{
157  * x = x^\prime + A \left(\sin\left(\frac{2 \pi t}{T}\right)\right)^4,
158  * \f}
159  *
160  * The general coordinate transformation formula that gives the metric
161  * is then
162  * \f{align*}{
163  * \partial_a g_{b c} =
164  * \partial_a \partial_b x^{\prime a^\prime} \partial_c x^{\prime b^\prime}
165  * g_{a^\prime b^\prime}
166  * + \partial_b x^{\prime a^\prime} \partial_a \partial_c x^{\prime b^\prime}
167  * g_{a^\prime b^\prime}
168  * + \partial_a x^{\prime a^\prime} \partial_b x^{\prime b^\prime}
169  * \partial_c x^{\prime c^\prime} \partial_a g_{b c}
170  * \f}
171  */
172  void variables_impl(
173  gsl::not_null<tnsr::iaa<DataVector, 3>*> d_spacetime_metric, size_t l_max,
174  double time,
175  tmpl::type_<
176  GeneralizedHarmonic::Tags::Phi<3, ::Frame::Inertial>> /*meta*/)
177  const noexcept override;
178 
179  /// The News in the bouncing black hole solution vanishes, as the oscillation
180  /// comes entirely from a coordinate transform.
181  void variables_impl(
182  gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, -2>>*> news,
183  size_t output_l_max, double time,
184  tmpl::type_<Tags::News> /*meta*/) const noexcept override;
185 
186  double amplitude_ = std::numeric_limits<double>::signaling_NaN();
187  double mass_ = std::numeric_limits<double>::signaling_NaN();
188  double frequency_ = std::numeric_limits<double>::signaling_NaN();
189 };
190 } // namespace Cce::Solutions
CharmPupable.hpp
Literals.hpp
Options.hpp
Cce::Solutions::BouncingBlackHole::ExtractionRadius
Definition: BouncingBlackHole.hpp:44
Cce::Solutions::BouncingBlackHole::Period
Definition: BouncingBlackHole.hpp:58
GeneralizedHarmonic
Items related to evolving the first-order generalized harmonic system.
Definition: BoundaryCondition.hpp:20
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:71
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:27
Tensor.hpp
ComplexDataVector
Stores a collection of complex function values.
Definition: ComplexDataVector.hpp:53
std::unique_ptr
gsl
Implementations from the Guideline Support Library.
Definition: ReadSpecThirdOrderPiecewisePolynomial.hpp:11
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecThirdOrderPiecewisePolynomial.hpp:13