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  static type default_value() noexcept { return 1.0; }
50  };
51  struct Frequency {
52  using type = double;
53  static constexpr Options::String help{
54  "The frequency of the coordinate rotation."};
55  static type lower_bound() noexcept { return 0.0; }
56  };
57 
58  using options = tmpl::list<ExtractionRadius, Mass, Frequency>;
59 
60  static constexpr Options::String help = {
61  "Analytic solution representing a Schwarzschild black hole in a rotating "
62  "frame"};
63 
64  WRAPPED_PUPable_decl_template(RotatingSchwarzschild); // NOLINT
65 
66  explicit RotatingSchwarzschild(CkMigrateMessage* /*unused*/) noexcept {}
67 
68  // clang doesn't manage to use = default correctly in this case
69  // NOLINTNEXTLINE(modernize-use-equals-default)
70  RotatingSchwarzschild() noexcept {};
71 
72  RotatingSchwarzschild(double extraction_radius, double mass,
73  double frequency) noexcept;
74 
75  std::unique_ptr<WorldtubeData> get_clone() const noexcept override;
76 
77  protected:
78  /// A no-op as the rotating Schwarzschild solution does not have substantial
79  /// shared computation to prepare before the separate component calculations.
80  void prepare_solution(const size_t /*output_l_max*/,
81  const double /*time*/) const noexcept override {}
82 
83  /*!
84  * \brief Compute the spherical coordinate metric from the closed-form
85  * rotating Schwarzschild metric.
86  *
87  * \details The rotating Schwarzschild takes the coordinate form
88  * \cite Barkett2019uae,
89  *
90  * \f{align}{
91  * ds^2 = -\left(1 - \frac{2 M}{r} - \omega^2 r^2 \sin^2 \theta\right) dt^2
92  * + \frac{1}{1 - \frac{2 M}{r}} dr^2
93  * + 2 \omega r^2 \sin^2 \theta dt d\phi + r^2 d\Omega^2
94  * \f}
95  */
96  void spherical_metric(
100  size_t l_max, double time) const noexcept override;
101 
102  /*!
103  * \brief Compute the radial derivative of the spherical coordinate metric
104  * from the closed-form rotating Schwarzschild metric.
105  *
106  * \details The rotating Schwarzschild takes the coordinate form
107  * \cite Barkett2019uae,
108  *
109  * \f{align}{
110  * \partial_r g_{a b} dx^a dx^b =& -\left(\frac{2 M}{r^2} - 2 \omega^2 r
111  * \sin^2 \theta\right) dt^2 - \frac{2 M}{(r - 2 M)^2} dr^2
112  * + 4 \omega r \sin^2 \theta dt d\phi + 2 r d\Omega^2
113  * \f}
114  */
115  void dr_spherical_metric(
119  size_t l_max, double time) const noexcept override;
120 
121  /*!
122  * \brief The time derivative of the spherical coordinate metric in the
123  * rotating Schwarzschild metric vanishes.
124  */
125  void dt_spherical_metric(
129  size_t l_max, double time) const noexcept override;
130 
131  using WorldtubeData::variables_impl;
132 
134 
135  /// The News vanishes in the rotating Schwarzschild metric
136  void variables_impl(
138  size_t l_max, double time,
139  tmpl::type_<Tags::News> /*meta*/) const noexcept override;
140 
141  double frequency_ = std::numeric_limits<double>::signaling_NaN();
143 };
144 } // 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:80
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:51
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: Gsl.hpp:183