RotatingSchwarzschild.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <complex>
7 #include <cstddef>
8 #include <limits>
9 #include <memory>
10 #include <vector>
11 
12 #include "DataStructures/SpinWeighted.hpp"
13 #include "Evolution/Systems/Cce/AnalyticSolutions/SphericalMetricData.hpp"
14 #include "Evolution/Systems/Cce/AnalyticSolutions/WorldtubeData.hpp"
15 #include "Evolution/Systems/Cce/Tags.hpp"
16 #include "Options/Options.hpp"
18 #include "Utilities/Gsl.hpp"
19 #include "Utilities/Literals.hpp"
20 #include "Utilities/TMPL.hpp"
21 
22 /// \cond
23 class DataVector;
24 class ComplexDataVector;
25 /// \endcond
26 
27 namespace Cce::Solutions {
28 
29 /*!
30  * \brief Computes the analytic data for the rotating Schwarzschild solution
31  * described in \cite Barkett2019uae, section VI.C.
32  *
33  * \details This is a comparatively simple test which simply determines the
34  * Schwarzschild metric in transformed coordinates given by \f$\phi\rightarrow
35  * \phi + \omega u\f$, where \f$u\f$ is the retarded time.
36  */
39  using type = double;
40  static constexpr Options::String help{
41  "The extraction radius of the spherical solution"};
42  static type lower_bound() noexcept { return 0.0; }
43  };
44  struct Mass {
45  using type = double;
46  static constexpr Options::String help{
47  "The mass of the Schwarzschild black hole"};
48  static type lower_bound() noexcept { return 0.0; }
49  };
50  struct Frequency {
51  using type = double;
52  static constexpr Options::String help{
53  "The frequency of the coordinate rotation."};
54  static type lower_bound() noexcept { return 0.0; }
55  };
56 
57  using options = tmpl::list<ExtractionRadius, Mass, Frequency>;
58 
59  static constexpr Options::String help = {
60  "Analytic solution representing a Schwarzschild black hole in a rotating "
61  "frame"};
62 
63  WRAPPED_PUPable_decl_template(RotatingSchwarzschild); // NOLINT
64 
65  explicit RotatingSchwarzschild(CkMigrateMessage* /*unused*/) noexcept {}
66 
67  // clang doesn't manage to use = default correctly in this case
68  // NOLINTNEXTLINE(modernize-use-equals-default)
69  RotatingSchwarzschild() noexcept {};
70 
71  RotatingSchwarzschild(double extraction_radius, double mass,
72  double frequency) noexcept;
73 
74  std::unique_ptr<WorldtubeData> get_clone() const noexcept override;
75 
76  protected:
77  /// A no-op as the rotating Schwarzschild solution does not have substantial
78  /// shared computation to prepare before the separate component calculations.
79  void prepare_solution(const size_t /*output_l_max*/,
80  const double /*time*/) const noexcept override {}
81 
82  /*!
83  * \brief Compute the spherical coordinate metric from the closed-form
84  * rotating Schwarzschild metric.
85  *
86  * \details The rotating Schwarzschild takes the coordinate form
87  * \cite Barkett2019uae,
88  *
89  * \f{align}{
90  * ds^2 = -\left(1 - \frac{2 M}{r} - \omega^2 r^2 \sin^2 \theta\right) dt^2
91  * + \frac{1}{1 - \frac{2 M}{r}} dr^2
92  * + 2 \omega r^2 \sin^2 \theta dt d\phi + r^2 d\Omega^2
93  * \f}
94  */
95  void spherical_metric(
99  size_t l_max, double time) const noexcept override;
100 
101  /*!
102  * \brief Compute the radial derivative of the spherical coordinate metric
103  * from the closed-form rotating Schwarzschild metric.
104  *
105  * \details The rotating Schwarzschild takes the coordinate form
106  * \cite Barkett2019uae,
107  *
108  * \f{align}{
109  * \partial_r g_{a b} dx^a dx^b =& -\left(\frac{2 M}{r^2} - 2 \omega^2 r
110  * \sin^2 \theta\right) dt^2 - \frac{2 M}{(r - 2 M)^2} dr^2
111  * + 4 \omega r \sin^2 \theta dt d\phi + 2 r d\Omega^2
112  * \f}
113  */
114  void dr_spherical_metric(
118  size_t l_max, double time) const noexcept override;
119 
120  /*!
121  * \brief The time derivative of the spherical coordinate metric in the
122  * rotating Schwarzschild metric vanishes.
123  */
124  void dt_spherical_metric(
128  size_t l_max, double time) const noexcept override;
129 
130  using WorldtubeData::variables_impl;
131 
133 
134  /// The News vanishes in the rotating Schwarzschild metric
135  void variables_impl(
137  size_t l_max, double time,
138  tmpl::type_<Tags::News> /*meta*/) const noexcept override;
139 
140  double frequency_ = std::numeric_limits<double>::signaling_NaN();
142 };
143 } // namespace Cce::Solutions
CharmPupable.hpp
Cce::Solutions::RotatingSchwarzschild::ExtractionRadius
Definition: RotatingSchwarzschild.hpp:38
Literals.hpp
Options.hpp
vector
Cce::Solutions::RotatingSchwarzschild::spherical_metric
void spherical_metric(gsl::not_null< tnsr::aa< DataVector, 3, ::Frame::Spherical<::Frame::Inertial >> * > spherical_metric, size_t l_max, double time) const noexcept override
Compute the spherical coordinate metric from the closed-form rotating Schwarzschild metric.
SpinWeighted
Make a spin-weighted type T with spin-weight Spin. Mathematical operators are restricted to addition,...
Definition: SpinWeighted.hpp:24
Cce::Solutions::SphericalMetricData
Abstract base class for analytic worldtube data most easily derived in spherical coordinate form.
Definition: SphericalMetricData.hpp:42
Cce::Solutions::RotatingSchwarzschild::dr_spherical_metric
void dr_spherical_metric(gsl::not_null< tnsr::aa< DataVector, 3, ::Frame::Spherical<::Frame::Inertial >> * > dr_spherical_metric, size_t l_max, double time) const noexcept override
Compute the radial derivative of the spherical coordinate metric from the closed-form rotating Schwar...
Cce::Solutions::RotatingSchwarzschild::prepare_solution
void prepare_solution(const size_t, const double) const noexcept override
A no-op as the rotating Schwarzschild solution does not have substantial shared computation to prepar...
Definition: RotatingSchwarzschild.hpp:79
cstddef
Cce::Solutions::SphericalMetricData::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
Computes the Cartesian spacetime metric from the spherical solution provided by the derived classes.
DataVector
Stores a collection of function values.
Definition: DataVector.hpp:42
std::numeric_limits::signaling_NaN
T signaling_NaN(T... args)
memory
Frame::Spherical
Represents a spherical-coordinate frame that is associated with a Cartesian frame,...
Definition: IndexType.hpp:54
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
limits
Gsl.hpp
Cce::Solutions::RotatingSchwarzschild::variables_impl
void variables_impl(gsl::not_null< Scalar< SpinWeighted< ComplexDataVector, -2 >> * > news, size_t l_max, double time, tmpl::type_< Tags::News >) const noexcept override
The News vanishes in the rotating Schwarzschild metric.
Options::String
const char *const String
The string used in option structs.
Definition: Options.hpp:32
Cce::Solutions::RotatingSchwarzschild::dt_spherical_metric
void dt_spherical_metric(gsl::not_null< tnsr::aa< DataVector, 3, ::Frame::Spherical<::Frame::Inertial >> * > dt_spherical_metric, size_t l_max, double time) const noexcept override
The time derivative of the spherical coordinate metric in the rotating Schwarzschild metric vanishes.
complex
Cce::Solutions::RotatingSchwarzschild::Frequency
Definition: RotatingSchwarzschild.hpp:50
Cce::Solutions::RotatingSchwarzschild::Mass
Definition: RotatingSchwarzschild.hpp:44
Cce::Solutions::RotatingSchwarzschild
Computes the analytic data for the rotating Schwarzschild solution described in , section VI....
Definition: RotatingSchwarzschild.hpp:37
ComplexDataVector
Stores a collection of complex function values.
Definition: ComplexDataVector.hpp:47
std::unique_ptr
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecThirdOrderPiecewisePolynomial.hpp:13