SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/Cce/AnalyticSolutions - RotatingSchwarzschild.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 21.9 % 32 7
Test Date: 2026-10-22 17:29:42
Legend: Lines:     hit not hit

            Line data    Source code
       1            0 : // 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/String.hpp"
      17              : #include "Utilities/Gsl.hpp"
      18              : #include "Utilities/Literals.hpp"
      19              : #include "Utilities/Serialization/CharmPupable.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              :  */
      37            1 : struct RotatingSchwarzschild : public SphericalMetricData {
      38            0 :   struct ExtractionRadius {
      39            0 :     using type = double;
      40            0 :     static constexpr Options::String help{
      41              :         "The extraction radius of the spherical solution"};
      42            0 :     static type lower_bound() { return 0.0; }
      43              :   };
      44            0 :   struct Mass {
      45            0 :     using type = double;
      46            0 :     static constexpr Options::String help{
      47              :         "The mass of the Schwarzschild black hole"};
      48            0 :     static type lower_bound() { return 0.0; }
      49              :   };
      50            0 :   struct Frequency {
      51            0 :     using type = double;
      52            0 :     static constexpr Options::String help{
      53              :         "The frequency of the coordinate rotation."};
      54            0 :     static type lower_bound() { return 0.0; }
      55              :   };
      56              : 
      57            0 :   using options = tmpl::list<ExtractionRadius, Mass, Frequency>;
      58              : 
      59            0 :   static constexpr Options::String help = {
      60              :       "Analytic solution representing a Schwarzschild black hole in a rotating "
      61              :       "frame"};
      62              : 
      63            0 :   WRAPPED_PUPable_decl_template(RotatingSchwarzschild);  // NOLINT
      64              : 
      65            0 :   explicit RotatingSchwarzschild(CkMigrateMessage* msg)
      66              :       : SphericalMetricData(msg) {}
      67              : 
      68              :   // clang doesn't manage to use = default correctly in this case
      69              :   // NOLINTNEXTLINE(modernize-use-equals-default)
      70            0 :   RotatingSchwarzschild() {}
      71              : 
      72            0 :   RotatingSchwarzschild(double extraction_radius, double mass,
      73              :                         double frequency);
      74              : 
      75            0 :   ~RotatingSchwarzschild() override = default;
      76              : 
      77            0 :   std::unique_ptr<WorldtubeData> get_clone() const override;
      78              : 
      79            0 :   void pup(PUP::er& p) override;
      80              : 
      81              :  protected:
      82              :   /// A no-op as the rotating Schwarzschild solution does not have substantial
      83              :   /// shared computation to prepare before the separate component calculations.
      84            1 :   void prepare_solution(const size_t /*output_l_max*/,
      85              :                         const double /*time*/) const override {}
      86              : 
      87              :   /*!
      88              :    * \brief Compute the spherical coordinate metric from the closed-form
      89              :    * rotating Schwarzschild metric.
      90              :    *
      91              :    * \details The rotating Schwarzschild takes the coordinate form
      92              :    * \cite Barkett2019uae,
      93              :    *
      94              :    * \f{align}{
      95              :    * ds^2 = -\left(1 - \frac{2 M}{r} - \omega^2 r^2 \sin^2 \theta\right) dt^2
      96              :    * + \frac{1}{1 - \frac{2 M}{r}} dr^2
      97              :    * + 2 \omega r^2 \sin^2 \theta dt d\phi + r^2 d\Omega^2
      98              :    * \f}
      99              :    */
     100            1 :   void spherical_metric(
     101              :       gsl::not_null<
     102              :           tnsr::aa<DataVector, 3, ::Frame::Spherical<::Frame::Inertial>>*>
     103              :           spherical_metric,
     104              :       size_t l_max, double time) const override;
     105              : 
     106              :   /*!
     107              :    * \brief Compute the radial derivative of the spherical coordinate metric
     108              :    * from the closed-form rotating Schwarzschild metric.
     109              :    *
     110              :    * \details The rotating Schwarzschild takes the coordinate form
     111              :    * \cite Barkett2019uae,
     112              :    *
     113              :    * \f{align}{
     114              :    * \partial_r g_{a b} dx^a dx^b =& -\left(\frac{2 M}{r^2} - 2 \omega^2 r
     115              :    * \sin^2 \theta\right) dt^2 - \frac{2 M}{(r - 2 M)^2} dr^2
     116              :    * + 4 \omega r \sin^2 \theta dt d\phi + 2 r d\Omega^2
     117              :    * \f}
     118              :    */
     119            1 :   void dr_spherical_metric(
     120              :       gsl::not_null<
     121              :           tnsr::aa<DataVector, 3, ::Frame::Spherical<::Frame::Inertial>>*>
     122              :           dr_spherical_metric,
     123              :       size_t l_max, double time) const override;
     124              : 
     125              :   /*!
     126              :    * \brief The time derivative of the spherical coordinate metric in the
     127              :    * rotating Schwarzschild metric vanishes.
     128              :    */
     129            1 :   void dt_spherical_metric(
     130              :       gsl::not_null<
     131              :           tnsr::aa<DataVector, 3, ::Frame::Spherical<::Frame::Inertial>>*>
     132              :           dt_spherical_metric,
     133              :       size_t l_max, double time) const override;
     134              : 
     135            0 :   using WorldtubeData::variables_impl;
     136              : 
     137            1 :   using SphericalMetricData::variables_impl;
     138              : 
     139              :   /// The News vanishes in the rotating Schwarzschild metric
     140            1 :   void variables_impl(
     141              :       gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, -2>>*> news,
     142              :       size_t l_max, double time,
     143              :       tmpl::type_<Tags::News> /*meta*/) const override;
     144              : 
     145            0 :   double frequency_ = std::numeric_limits<double>::signaling_NaN();
     146            0 :   double mass_ = std::numeric_limits<double>::signaling_NaN();
     147              : };
     148              : }  // namespace Cce::Solutions
        

Generated by: LCOV version 2.0-1