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 {
25 namespace 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 OptionString help{
40  "The coordinate distance of the gauge oscillation"};
41  static type lower_bound() noexcept { return 0.0; }
42  static type default_value() noexcept { return 2.0; }
43  };
45  using type = double;
46  static constexpr OptionString help{
47  "The extraction radius of the spherical solution"};
48  static type lower_bound() noexcept { return 0.0; }
49  static type default_value() noexcept { return 20.0; }
50  };
51  struct Mass {
52  using type = double;
53  static constexpr OptionString help{
54  "The mass of the Schwarzschild black hole"};
55  static type lower_bound() noexcept { return 0.0; }
56  static type default_value() noexcept { return 1.0; }
57  };
58  struct Period {
59  using type = double;
60  static constexpr OptionString help{
61  "The period of the coordinate oscillation"};
62  static type lower_bound() noexcept { return 0.0; }
63  static type default_value() noexcept { return 40.0; }
64  };
65 
66  using options = tmpl::list<Amplitude, ExtractionRadius, Mass, Period>;
67 
68  WRAPPED_PUPable_decl_template(BouncingBlackHole); // NOLINT
69 
70  explicit BouncingBlackHole(CkMigrateMessage* /*unused*/) noexcept {}
71 
72 
73  // clang doesn't manage to use = default correctly in this case
74  // NOLINTNEXTLINE(hicpp-use-equals-default)
75  BouncingBlackHole() noexcept {};
76 
77  BouncingBlackHole(double amplitude, double extraction_radius, double mass,
78  double period) noexcept;
79 
80  std::unique_ptr<WorldtubeData> get_clone() const noexcept override;
81 
82  void pup(PUP::er& p) noexcept override;
83 
84  protected:
85  // The bouncing black hole solution is easily computed directly, so requires
86  // no additional preparation.
87  void prepare_solution(const size_t /*l_max*/, const double /*time*/) const
88  noexcept override{};
89 
90  using WorldtubeData::variables_impl;
91 
92  /*!
93  * \brief The implementation function that computes the spacetime metric on
94  * the extraction sphere at collocation points associated with angular
95  * resolution `l_max`.
96  *
97  * \details The spacetime metric \f$g_{a b}\f$ is determined by evaluating the
98  * Kerr-Schild metric at a set of transformed coordinates \f$t^\prime = t,
99  * y^\prime = y, z^\prime = z\f$, and
100  *
101  * \f{align*}{
102  * x = x^\prime + A \left(\sin\left(\frac{2 \pi t}{T}\right)\right)^4,
103  * \f}
104  *
105  * where the amplitude \f$A\f$ is set by the option `Amplitude` and the period
106  * \f$T\f$ is set by the option `Period`. In this notation we take
107  * the primed coordinates to be the coordinates for which the black hole has
108  * time-dependent coordinate position.
109  */
110  void variables_impl(gsl::not_null<tnsr::aa<DataVector, 3>*> spacetime_metric,
111  size_t l_max, double time,
112  tmpl::type_<gr::Tags::SpacetimeMetric<
113  3, ::Frame::Inertial, DataVector>> /*meta*/) const
114  noexcept override;
115 
116  /*!
117  * \brief The implementation function that computes the first time derivative
118  * of the spacetime metric on the extraction sphere.
119  *
120  * \details The time derivative of the spacetime metric
121  * \f$\partial_t g_{a b}\f$ comes entirely from the Jacobian factor:
122  *
123  * \f{align*}{
124  * \partial_t x = \frac{8 \pi A}{T} \cos\left(\frac{2 \pi t}{T}\right)
125  * \left(\sin\left(\frac{2 \pi t}{T}\right)\right)^3,
126  * \f}
127  *
128  * so the transformed metric derivative is,
129  *
130  * \f{align*}{
131  * \partial_t g_{a^\prime b^\prime} = 2 \partial_{(a^\prime} \partial_t x
132  * \partial_{b^\prime)} x^a g_{x a}.
133  * \f}
134  *
135  * In this notation we take the primed coordinates to be the coordinates for
136  * which the black hole has time-dependent coordinate position.
137  */
138  void variables_impl(
139  gsl::not_null<tnsr::aa<DataVector, 3>*> dt_spacetime_metric, size_t l_max,
140  double time,
141  tmpl::type_<::Tags::dt<gr::Tags::SpacetimeMetric<
142  3, ::Frame::Inertial, DataVector>>> /*meta*/) const noexcept override;
143 
144  /*!
145  * \brief The implementation function that computes the first spatial
146  * derivative of the spacetime metric on the extraction sphere.
147  *
148  * \details The calculation proceeds by standard coordinate transform
149  * techniques for the transformation given by \f$t^\prime = t,
150  * y^\prime = y, z^\prime = z\f$, and
151  *
152  * \f{align*}{
153  * x = x^\prime + A \left(\sin\left(\frac{2 \pi t}{T}\right)\right)^4,
154  * \f}
155  *
156  * The general coordinate transformation formula that gives the metric
157  * is then
158  * \f{align*}{
159  * \partial_a g_{b c} =
160  * \partial_a \partial_b x^{\prime a^\prime} \partial_c x^{\prime b^\prime}
161  * g_{a^\prime b^\prime}
162  * + \partial_b x^{\prime a^\prime} \partial_a \partial_c x^{\prime b^\prime}
163  * g_{a^\prime b^\prime}
164  * + \partial_a x^{\prime a^\prime} \partial_b x^{\prime b^\prime}
165  * \partial_c x^{\prime c^\prime} \partial_a g_{b c}
166  * \f}
167  */
168  void variables_impl(
169  gsl::not_null<tnsr::iaa<DataVector, 3>*> d_spacetime_metric, size_t l_max,
170  double time,
171  tmpl::type_<
172  GeneralizedHarmonic::Tags::Phi<3, ::Frame::Inertial>> /*meta*/) const
173  noexcept override;
174 
175  /// The News in the bouncing black hole solution vanishes, as the oscillation
176  /// comes entirely from a coordinate transform.
177  void variables_impl(
178  gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, -2>>*> news,
179  size_t output_l_max, double time, tmpl::type_<Tags::News> /*meta*/) const
180  noexcept override;
181 
182  double amplitude_ = std::numeric_limits<double>::signaling_NaN();
183  double mass_ = std::numeric_limits<double>::signaling_NaN();
184  double frequency_ = std::numeric_limits<double>::signaling_NaN();
185 };
186 } // namespace Solutions
187 } // namespace Cce
CharmPupable.hpp
Frame::Inertial
Definition: IndexType.hpp:44
Literals.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: 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: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:42
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:65
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
Cce
The set of utilities for performing Cauchy characteristic evolution and Cauchy characteristic matchin...
Definition: BoundaryComputeAndSendToEvolution.hpp:28
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:79
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: Gsl.hpp:182