SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/Cce - BoundaryData.hpp Hit Total Coverage
Commit: 1f2210958b4f38fdc0400907ee7c6d5af5111418 Lines: 30 33 90.9 %
Date: 2025-12-05 05:03:31
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 <cstddef>
       7             : 
       8             : #include "DataStructures/ComplexDataVector.hpp"
       9             : #include "DataStructures/ComplexModalVector.hpp"
      10             : #include "DataStructures/DataBox/PrefixHelpers.hpp"
      11             : #include "DataStructures/SpinWeighted.hpp"
      12             : #include "DataStructures/Tensor/TypeAliases.hpp"
      13             : #include "Evolution/Systems/Cce/BoundaryDataTags.hpp"
      14             : #include "Evolution/Systems/Cce/Tags.hpp"
      15             : #include "Utilities/TMPL.hpp"
      16             : 
      17             : /// \cond
      18             : class DataVector;
      19             : template <typename TagsList>
      20             : class Variables;
      21             : namespace gsl {
      22             : template <class T>
      23             : class not_null;
      24             : }  // namespace gsl
      25             : /// \endcond
      26             : 
      27             : namespace Cce {
      28             : 
      29             : /*!
      30             :  * \brief Constructs the collocation values for \f$\cos(\phi)\f$,
      31             :  * \f$\cos(\theta)\f$, \f$\sin(\phi)\f$, and \f$\sin(\theta)\f$, returned by
      32             :  * `not_null` pointer in that order.
      33             :  *
      34             :  * \details These are needed for coordinate transformations from the input
      35             :  * Cartesian-like coordinates.
      36             :  */
      37           1 : void trigonometric_functions_on_swsh_collocation(
      38             :     gsl::not_null<Scalar<DataVector>*> cos_phi,
      39             :     gsl::not_null<Scalar<DataVector>*> cos_theta,
      40             :     gsl::not_null<Scalar<DataVector>*> sin_phi,
      41             :     gsl::not_null<Scalar<DataVector>*> sin_theta, size_t l_max);
      42             : 
      43             : /*!
      44             :  * \brief Creates both the Jacobian and inverse Jacobian between Cartesian and
      45             :  * spherical coordinates, and the coordinates themselves
      46             :  *
      47             :  * \details The `cartesian_to_spherical_jacobian` is
      48             :  * \f$dx^i/d\tilde{x}^{\tilde j}\f$,
      49             :  * where the Cartesian components are in order \f$x^i = \{x, y, z\}\f$
      50             :  * and the spherical coordinates are
      51             :  * \f$\tilde{x}^{\tilde j} = \{r, \theta, \phi\}\f$.
      52             :  * The Cartesian coordinates given are the standard unit sphere coordinates:
      53             :  *
      54             :  * \f{align*}{
      55             :  *  x &= \cos(\phi) \sin(\theta)\\
      56             :  *  y &= \sin(\phi) \sin(\theta)\\
      57             :  *  z &= \cos(\theta)
      58             :  * \f}
      59             :  *
      60             :  * \note These Jacobians are adjusted to improve regularity near the pole, in
      61             :  * particular the \f$\partial \phi / \partial x^i\f$ components have been scaled
      62             :  * by \f$\sin \theta\f$ (omitting a \f$1/\sin(\theta)\f$) and the
      63             :  * \f$\partial x^i/\partial \phi\f$ components have been scaled by
      64             :  * \f$1/\sin(\theta)\f$ (omitting a \f$\sin(\theta)\f$). The reason is that in
      65             :  * most careful calculations, these problematic sin factors can actually be
      66             :  * omitted because they cancel. In cases where they are actually required, they
      67             :  * must be put in by hand.
      68             :  */
      69           1 : void cartesian_to_spherical_coordinates_and_jacobians(
      70             :     gsl::not_null<tnsr::I<DataVector, 3>*> unit_cartesian_coords,
      71             :     gsl::not_null<SphericaliCartesianJ*> cartesian_to_spherical_jacobian,
      72             :     gsl::not_null<CartesianiSphericalJ*>
      73             :         inverse_cartesian_to_spherical_jacobian,
      74             :     const Scalar<DataVector>& cos_phi, const Scalar<DataVector>& cos_theta,
      75             :     const Scalar<DataVector>& sin_phi, const Scalar<DataVector>& sin_theta,
      76             :     double extraction_radius);
      77             : 
      78             : /*
      79             :  * \brief Compute \f$g_{i j}\f$, \f$g^{i j}\f$, \f$\partial_i g_{j k}\f$, and
      80             :  * \f$\partial_t g_{i j}\f$ from input libsharp-compatible modal spatial
      81             :  * metric quantities.
      82             :  *
      83             :  * \details This function interpolates the modes of
      84             :  * input \f$g_{ij}\f$, \f$\partial_r g_{i j}\f$, and \f$\partial_r g_{i j}\f$ to
      85             :  * the libsharp-compatible grid. This function then applies the necessary
      86             :  * jacobian factors and angular derivatives to determine the full \f$\partial_i
      87             :  * g_{j k}\f$.
      88             :  */
      89           0 : void cartesian_spatial_metric_and_derivatives_from_modes(
      90             :     gsl::not_null<tnsr::ii<DataVector, 3>*> cartesian_spatial_metric,
      91             :     gsl::not_null<tnsr::II<DataVector, 3>*> inverse_cartesian_spatial_metric,
      92             :     gsl::not_null<tnsr::ijj<DataVector, 3>*> d_cartesian_spatial_metric,
      93             :     gsl::not_null<tnsr::ii<DataVector, 3>*> dt_cartesian_spatial_metric,
      94             :     gsl::not_null<Scalar<SpinWeighted<ComplexModalVector, 0>>*>
      95             :         interpolation_modal_buffer,
      96             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 0>>*>
      97             :         interpolation_buffer,
      98             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 1>>*> eth_buffer,
      99             :     const tnsr::ii<ComplexModalVector, 3>& spatial_metric_coefficients,
     100             :     const tnsr::ii<ComplexModalVector, 3>& dr_spatial_metric_coefficients,
     101             :     const tnsr::ii<ComplexModalVector, 3>& dt_spatial_metric_coefficients,
     102             :     const CartesianiSphericalJ& inverse_cartesian_to_spherical_jacobian,
     103             :     size_t l_max);
     104             : 
     105             : /*!
     106             :  * \brief Compute \f$\beta^{i}\f$, \f$\partial_i \beta^{j}\f$, and
     107             :  * \f$\partial_t \beta^i\f$ from input libsharp-compatible modal spatial
     108             :  * metric quantities.
     109             :  *
     110             :  * \details This function interpolates the modes of
     111             :  * input \f$\beta^i\f$, \f$\partial_r \beta^i\f$, and \f$\partial_r \beta^i\f$
     112             :  * to the libsharp-compatible grid. This function then applies the necessary
     113             :  * jacobian factors and angular derivatives to determine the full \f$\partial_i
     114             :  * \beta^i\f$.
     115             :  */
     116           1 : void cartesian_shift_and_derivatives_from_modes(
     117             :     gsl::not_null<tnsr::I<DataVector, 3>*> cartesian_shift,
     118             :     gsl::not_null<tnsr::iJ<DataVector, 3>*> d_cartesian_shift,
     119             :     gsl::not_null<tnsr::I<DataVector, 3>*> dt_cartesian_shift,
     120             :     gsl::not_null<Scalar<SpinWeighted<ComplexModalVector, 0>>*>
     121             :         interpolation_modal_buffer,
     122             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 0>>*>
     123             :         interpolation_buffer,
     124             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 1>>*> eth_buffer,
     125             :     const tnsr::I<ComplexModalVector, 3>& shift_coefficients,
     126             :     const tnsr::I<ComplexModalVector, 3>& dr_shift_coefficients,
     127             :     const tnsr::I<ComplexModalVector, 3>& dt_shift_coefficients,
     128             :     const CartesianiSphericalJ& inverse_cartesian_to_spherical_jacobian,
     129             :     size_t l_max);
     130             : 
     131             : /*!
     132             :  * \brief Compute \f$\alpha\f$, \f$\partial_i \alpha\f$, and
     133             :  * \f$\partial_t \beta^i\f$ from input libsharp-compatible modal spatial
     134             :  * metric quantities.
     135             :  *
     136             :  * \details This function interpolates the modes of input \f$\alpha\f$,
     137             :  * \f$\partial_r \alpha\f$, and \f$\partial_r \alpha\f$ to the
     138             :  * libsharp-compatible grid. This function then applies the necessary jacobian
     139             :  * factors and angular derivatives to determine the full \f$\partial_i
     140             :  * \alpha\f$.
     141             :  */
     142           1 : void cartesian_lapse_and_derivatives_from_modes(
     143             :     gsl::not_null<Scalar<DataVector>*> cartesian_lapse,
     144             :     gsl::not_null<tnsr::i<DataVector, 3>*> d_cartesian_lapse,
     145             :     gsl::not_null<Scalar<DataVector>*> dt_cartesian_lapse,
     146             :     gsl::not_null<Scalar<SpinWeighted<ComplexModalVector, 0>>*>
     147             :         interpolation_modal_buffer,
     148             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 0>>*>
     149             :         interpolation_buffer,
     150             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 1>>*> eth_buffer,
     151             :     const Scalar<ComplexModalVector>& lapse_coefficients,
     152             :     const Scalar<ComplexModalVector>& dr_lapse_coefficients,
     153             :     const Scalar<ComplexModalVector>& dt_lapse_coefficients,
     154             :     const CartesianiSphericalJ& inverse_cartesian_to_spherical_jacobian,
     155             :     size_t l_max);
     156             : 
     157             : /*!
     158             :  * \brief Computes spatial derivatives of cartesian metric, shift, and lapse
     159             :  * from nodal metric quantities on a spherical worldtube.
     160             :  *
     161             :  * \details See the details for
     162             :  * `cartesian_spatial_metric_and_derivatives_from_modes`,
     163             :  * `cartesian_shift_and_derivatives_from_modes`, and
     164             :  * `cartesian_lapse_and_derivatives_from_modes` ignoring the transformation from
     165             :  * modal to nodal (since the metric quantities are already in nodal form).
     166             :  */
     167           1 : void deriv_cartesian_metric_lapse_shift_from_nodes(
     168             :     gsl::not_null<tnsr::ijj<DataVector, 3>*> d_cartesian_spatial_metric,
     169             :     gsl::not_null<tnsr::iJ<DataVector, 3>*> d_cartesian_shift,
     170             :     gsl::not_null<tnsr::i<DataVector, 3>*> d_cartesian_lapse,
     171             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 0>>*> buffer,
     172             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 1>>*> eth_buffer,
     173             :     const tnsr::ii<DataVector, 3>& cartesian_spatial_metric,
     174             :     const tnsr::ii<DataVector, 3>& dr_cartesian_spatial_metric,
     175             :     const tnsr::I<DataVector, 3>& cartesian_shift,
     176             :     const tnsr::I<DataVector, 3>& dr_cartesian_shift,
     177             :     const Scalar<DataVector>& cartesian_lapse,
     178             :     const Scalar<DataVector>& dr_cartesian_lapse,
     179             :     const CartesianiSphericalJ& inverse_cartesian_to_spherical_jacobian,
     180             :     size_t l_max);
     181             : 
     182             : /*!
     183             :  * \brief Computes the spacetime metric and its first derivative in the
     184             :  * intermediate radial null coordinates
     185             :  *
     186             :  * \details These components are obtained by the steps in
     187             :  * Section II-A of \cite Barkett2019uae, which is based on the computation from
     188             :  * Section 4.3 of \cite Bishop1998uk. The most direct comparison is to be made
     189             :  * with equation (31) of \cite Barkett2019uae, which gives the null metric
     190             :  * components explicitly. The time derivative is then (using notation from
     191             :  * equation (31)  of \cite Barkett2019uae):
     192             :  *
     193             :  * \f{align}{
     194             :  * \partial_{\bar u} g_{\bar u \bar \lambda} =
     195             :  * \partial_{\bar u} g_{\bar \lambda \bar \lambda} =
     196             :  * \partial_{\bar u} g_{\bar \lambda \bar A} &= 0 \\
     197             :  * \partial_{\bar u} g_{\bar u \bar u} &=
     198             :  * \partial_{\breve t} g_{\breve t \breve t} \\
     199             :  * \partial_{\bar u} g_{\bar u \bar A} &=
     200             :  * \frac{\partial \breve x^{\breve i}}{\partial \bar x^{\bar A}}\\
     201             :  * g_{\breve i \breve t}
     202             :  * \partial_{\bar u} g_{\bar A \bar B}
     203             :  * &= \frac{\partial \breve x^{\breve i}}{\partial \bar x^{\bar A}}
     204             :  * \frac{\partial \breve x^{\breve j}}{\partial \bar x^{\bar B}}
     205             :  * g_{\breve i \breve j}
     206             :  * \f}
     207             :  */
     208           1 : void null_metric_and_derivative(
     209             :     gsl::not_null<tnsr::aa<DataVector, 3, Frame::RadialNull>*> du_null_metric,
     210             :     gsl::not_null<tnsr::aa<DataVector, 3, Frame::RadialNull>*> null_metric,
     211             :     const SphericaliCartesianJ& cartesian_to_spherical_jacobian,
     212             :     const tnsr::aa<DataVector, 3>& dt_spacetime_metric,
     213             :     const tnsr::aa<DataVector, 3>& spacetime_metric);
     214             : 
     215             : /*!
     216             :  * \brief Computes the spatial unit normal vector \f$s^i\f$ to the spherical
     217             :  * worldtube surface and its first time derivative.
     218             :  *
     219             :  * \details Refer to equation (20) of \cite Barkett2019uae for the expression of
     220             :  * the spatial unit normal vector, and equation (23) of \cite Barkett2019uae for
     221             :  * the first time derivative. Refer to \cite Bishop1998uk for more exposition
     222             :  * about the overall construction of the coordinate transformations used for the
     223             :  * intermediate null coordinates.
     224             :  */
     225           1 : void worldtube_normal_and_derivatives(
     226             :     gsl::not_null<tnsr::I<DataVector, 3>*> worldtube_normal,
     227             :     gsl::not_null<tnsr::I<DataVector, 3>*> dt_worldtube_normal,
     228             :     const Scalar<DataVector>& cos_phi, const Scalar<DataVector>& cos_theta,
     229             :     const tnsr::aa<DataVector, 3>& spacetime_metric,
     230             :     const tnsr::aa<DataVector, 3>& dt_spacetime_metric,
     231             :     const Scalar<DataVector>& sin_phi, const Scalar<DataVector>& sin_theta,
     232             :     const tnsr::II<DataVector, 3>& inverse_spatial_metric);
     233             : 
     234             : /*!
     235             :  * \brief Computes the null 4-vector \f$l^\mu\f$ on the worldtube surface that
     236             :  * is to be used as the CCE hypersurface generator, and the first time
     237             :  * derivative \f$\partial_u l^\mu\f$.
     238             :  *
     239             :  * \details For mathematical description of our choice of the null generator,
     240             :  * refer to equation (22) of \cite Barkett2019uae, and for the first time
     241             :  * derivative see (25) of \cite Barkett2019uae.  Refer to \cite Bishop1998uk for
     242             :  * more exposition about the overall construction of the coordinate
     243             :  * transformations used for the intermediate null coordinates.
     244             :  */
     245           1 : void null_vector_l_and_derivatives(
     246             :     gsl::not_null<tnsr::A<DataVector, 3>*> du_null_l,
     247             :     gsl::not_null<tnsr::A<DataVector, 3>*> null_l,
     248             :     const tnsr::I<DataVector, 3>& dt_worldtube_normal,
     249             :     const Scalar<DataVector>& dt_lapse,
     250             :     const tnsr::aa<DataVector, 3>& dt_spacetime_metric,
     251             :     const tnsr::I<DataVector, 3>& dt_shift, const Scalar<DataVector>& lapse,
     252             :     const tnsr::aa<DataVector, 3>& spacetime_metric,
     253             :     const tnsr::I<DataVector, 3>& shift,
     254             :     const tnsr::I<DataVector, 3>& worldtube_normal);
     255             : 
     256             : /*!
     257             :  * \brief Computes the partial derivative of the spacetime metric and inverse
     258             :  * spacetime metric in the intermediate null radial coordinates with respect to
     259             :  * the null generator \f$l^\mu\f$
     260             :  *
     261             :  * \details For full expressions of the \f$l^\mu \partial_\mu g_{a b}\f$ and
     262             :  * \f$l^\mu \partial_\mu g^{a b}\f$ computed in this function, see equation (31)
     263             :  * and (32) of \cite Barkett2019uae.  Refer to \cite Bishop1998uk for more
     264             :  * exposition about the overall construction of the coordinate transformations
     265             :  * used for the intermediate null coordinates.
     266             :  */
     267           1 : void dlambda_null_metric_and_inverse(
     268             :     gsl::not_null<tnsr::aa<DataVector, 3, Frame::RadialNull>*>
     269             :         dlambda_null_metric,
     270             :     gsl::not_null<tnsr::AA<DataVector, 3, Frame::RadialNull>*>
     271             :         dlambda_inverse_null_metric,
     272             :     const AngulariCartesianA& angular_d_null_l,
     273             :     const SphericaliCartesianJ& cartesian_to_spherical_jacobian,
     274             :     const tnsr::iaa<DataVector, 3>& phi,
     275             :     const tnsr::aa<DataVector, 3>& dt_spacetime_metric,
     276             :     const tnsr::A<DataVector, 3>& du_null_l,
     277             :     const tnsr::AA<DataVector, 3, Frame::RadialNull>& inverse_null_metric,
     278             :     const tnsr::A<DataVector, 3>& null_l,
     279             :     const tnsr::aa<DataVector, 3>& spacetime_metric);
     280             : 
     281             : /*!
     282             :  * \brief Computes the Bondi radius of the worldtube.
     283             :  *
     284             :  * \details Note that unlike the Cauchy coordinate radius, the Bondi radius is
     285             :  * not constant over the worldtube. Instead, it is obtained by the determinant
     286             :  * of the angular part of the metric in the intermediate null coordinates (see
     287             :  * \cite Barkett2019uae).
     288             :  *
     289             :  * \f[
     290             :  *  r = \left(\frac{\det g_{A B}}{ q_{A B}}\right)^{1/4},
     291             :  * \f]
     292             :  *
     293             :  * where \f$q_{A B}\f$ is the unit sphere metric.
     294             :  */
     295           1 : void bondi_r(gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 0>>*> bondi_r,
     296             :              const tnsr::aa<DataVector, 3, Frame::RadialNull>& null_metric);
     297             : 
     298             : /*!
     299             :  * \brief Computes the full 4-dimensional partial of the Bondi radius with
     300             :  * respect to the intermediate null coordinates.
     301             :  *
     302             :  * \details The expression evaluated is obtained from differentiating the
     303             :  * determinant equation for `bondi_r`, from (35) of \cite Barkett2019uae :
     304             :  *
     305             :  * \f[
     306             :  * \partial_\alpha r = \frac{r}{4} \left(g^{A B} \partial_\alpha g_{A B}
     307             :  * - \frac{\partial_\alpha \det q_{A B}}{\det q_{A B}}\right)
     308             :  * \f]
     309             :  *
     310             :  * Note that for the angular derivatives, we just numerically differentiate
     311             :  * using the utilities in `Spectral::Swsh::angular_derivative()`. For the time
     312             :  * and radial derivatives, the second term in the above equation vanishes.
     313             :  */
     314           1 : void d_bondi_r(
     315             :     gsl::not_null<tnsr::a<DataVector, 3, Frame::RadialNull>*> d_bondi_r,
     316             :     const Scalar<SpinWeighted<ComplexDataVector, 0>>& bondi_r,
     317             :     const tnsr::aa<DataVector, 3, Frame::RadialNull>& dlambda_null_metric,
     318             :     const tnsr::aa<DataVector, 3, Frame::RadialNull>& du_null_metric,
     319             :     const tnsr::AA<DataVector, 3, Frame::RadialNull>& inverse_null_metric,
     320             :     size_t l_max);
     321             : 
     322             : /*!
     323             :  * \brief Compute the complex angular dyads used to define the spin-weighted
     324             :  * scalars in the CCE system.
     325             :  *
     326             :  * \details We use the typically chosen angular dyads in CCE
     327             :  * \cite Barkett2019uae \cite Bishop1997ik :
     328             :  *
     329             :  * \f{align*}{
     330             :  * q_A &= \{-1, -i \sin(\theta)\}\\
     331             :  * q^A &= \left\{-1, -i \frac{1}{\sin \theta}\right\}
     332             :  * \f}
     333             :  *
     334             :  * However, to maintain regularity and for compatibility with the more regular
     335             :  * Jacobians from `Cce::cartesian_to_spherical_coordinates_and_jacobians()`, in
     336             :  * the code we omit the factors of \f$\sin \theta\f$ from the above equations.
     337             :  */
     338           1 : void dyads(
     339             :     gsl::not_null<tnsr::i<ComplexDataVector, 2, Frame::RadialNull>*> down_dyad,
     340             :     gsl::not_null<tnsr::I<ComplexDataVector, 2, Frame::RadialNull>*> up_dyad);
     341             : 
     342             : /*!
     343             :  * \brief Compute the \f$\beta\f$ (lapse) function for the CCE Bondi-like
     344             :  * metric.
     345             :  *
     346             :  * \details The Bondi-like metric has \f$g^{u r} = - e^{2 \beta}\f$, and the
     347             :  * value of \f$\beta\f$ is obtained from the intermediate null metric by (see
     348             :  * equation (51) of \cite Barkett2019uae) using:
     349             :  *
     350             :  * \f[
     351             :  * \beta = -\frac{1}{2} \ln \partial_{\lambda} r
     352             :  * \f]
     353             :  */
     354           1 : void beta_worldtube_data(
     355             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 0>>*> beta,
     356             :     const tnsr::a<DataVector, 3, Frame::RadialNull>& d_bondi_r);
     357             : 
     358             : /*!
     359             :  * \brief Compute the \f$U\f$ (shift) function for the CCE Bondi-like metric.
     360             :  *
     361             :  * \details The Bondi-like metric has \f$g^{r A} = -e^{-2 \beta} U^A\f$, and the
     362             :  * spin-weighted vector \f$U = U^A q_A\f$. The value of \f$U^A\f$ can be
     363             :  * computed from the intermediate null metric quantities (see equation (54) of
     364             :  * \cite Barkett2019uae) using:
     365             :  *
     366             :  * \f[
     367             :  * U = -(\partial_\lambda r g^{\lambda A} + \partial_B r g^{A B}) q_A
     368             :  * / \partial_\lambda r \f]
     369             :  *
     370             :  */
     371           1 : void bondi_u_worldtube_data(
     372             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 1>>*> bondi_u,
     373             :     const tnsr::i<ComplexDataVector, 2, Frame::RadialNull>& dyad,
     374             :     const tnsr::a<DataVector, 3, Frame::RadialNull>& d_bondi_r,
     375             :     const tnsr::AA<DataVector, 3, Frame::RadialNull>& inverse_null_metric);
     376             : 
     377             : /*!
     378             :  * \brief Compute the \f$W\f$ (mass aspect) function for the CCE Bondi-like
     379             :  * metric.
     380             :  *
     381             :  * \details The Bondi-like metric has \f$g^{rr} = e^{-2 \beta}(1 + r W)\f$. The
     382             :  * value of \f$W\f$ can be computed from the null metric quantities (see
     383             :  * equation (55) of \cite Barkett2019uae) using:
     384             :  *
     385             :  * \f[
     386             :  * W = \frac{1}{r} \left(-1
     387             :  * + \frac{g^{\lambda \lambda} (\partial_\lambda r)^2
     388             :  * + 2 \partial_\lambda r \left(\partial_A r g^{\lambda A}
     389             :  * - \partial_u r\right) + \partial_A r \partial_B r g^{A B}}
     390             :  * {\partial_\lambda r}\right) \f]
     391             :  */
     392           1 : void bondi_w_worldtube_data(
     393             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 0>>*> bondi_w,
     394             :     const tnsr::a<DataVector, 3, Frame::RadialNull>& d_bondi_r,
     395             :     const tnsr::AA<DataVector, 3, Frame::RadialNull>& inverse_null_metric,
     396             :     const Scalar<SpinWeighted<ComplexDataVector, 0>>& bondi_r);
     397             : 
     398             : /*!
     399             :  * \brief Compute the \f$J\f$ (intuitively similar to the transverse-traceless
     400             :  * part of the angular metric) function for the CCE Bondi-like metric.
     401             :  *
     402             :  * \details The Bondi-like metric has \f$J = \frac{1}{2 r^2} q^A q^B g_{A B}\f$.
     403             :  * This expression holds both for the right-hand side in the Bondi coordinates
     404             :  * and for the right-hand side in the intermediate null coordinates (see
     405             :  * equation (45) of \cite Barkett2019uae).
     406             :  */
     407           1 : void bondi_j_worldtube_data(
     408             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 2>>*> bondi_j,
     409             :     const tnsr::aa<DataVector, 3, Frame::RadialNull>& null_metric,
     410             :     const Scalar<SpinWeighted<ComplexDataVector, 0>>& bondi_r,
     411             :     const tnsr::I<ComplexDataVector, 2, Frame::RadialNull>& dyad);
     412             : 
     413             : /*!
     414             :  * \brief Compute the radial derivative of the angular metric spin-weighted
     415             :  * scalar \f$\partial_r J\f$ in the CCE Bondi-like metric.
     416             :  *
     417             :  * \details The radial derivative of the angular spin-weighted scalar \f$J\f$
     418             :  * can be computed from the null metric components by (c.f. equation (47) of
     419             :  * \cite Barkett2019uae):
     420             :  *
     421             :  * \f[
     422             :  * \partial_r J = \frac{\partial_\lambda J}{\partial_\lambda r} =
     423             :  *  \frac{q^A q^B \partial_\lambda g_{A B} / (2 r^2)
     424             :  * - 2 \partial_\lambda r J / r}{\partial_\lambda r}
     425             :  * \f]
     426             :  */
     427           1 : void dr_bondi_j(
     428             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 2>>*> dr_bondi_j,
     429             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 0>>*>
     430             :         denominator_buffer,
     431             :     const tnsr::aa<DataVector, 3, Frame::RadialNull>& dlambda_null_metric,
     432             :     const tnsr::a<DataVector, 3, Frame::RadialNull>& d_bondi_r,
     433             :     const Scalar<SpinWeighted<ComplexDataVector, 2>>& bondi_j,
     434             :     const Scalar<SpinWeighted<ComplexDataVector, 0>>& bondi_r,
     435             :     const tnsr::I<ComplexDataVector, 2, Frame::RadialNull>& dyad);
     436             : 
     437             : /*!
     438             :  * \brief Compute the second derivative of the Bondi radius with respect to the
     439             :  * intermediate null coordinate radius \f$\partial_\lambda^2 r\f$.
     440             :  *
     441             :  * \details To determine this second derivative quantity without resorting to
     442             :  * depending on second-derivative metric inputs, we need to take advantage of
     443             :  * one of the Einstein field equations. Combining equations (53) and (52) of
     444             :  * \cite Barkett2019uae, we have:
     445             :  *
     446             :  * \f[
     447             :  * \partial_\lambda^2 r = \frac{-r}{4} \left(
     448             :  * \partial_\lambda J \partial_\lambda \bar J - (\partial_\lambda K)^2\right)
     449             :  * \f],
     450             :  *
     451             :  * where the first derivative of \f$K\f$ can be obtained from \f$K = \sqrt{1 + J
     452             :  * \bar J}\f$ and the first derivative of \f$J\f$ can be obtained from (47) of
     453             :  * \cite Barkett2019uae
     454             :  */
     455           1 : void d2lambda_bondi_r(
     456             :     gsl::not_null<Scalar<DataVector>*> d2lambda_bondi_r,
     457             :     const tnsr::a<DataVector, 3, Frame::RadialNull>& d_bondi_r,
     458             :     const Scalar<SpinWeighted<ComplexDataVector, 2>>& dr_bondi_j,
     459             :     const Scalar<SpinWeighted<ComplexDataVector, 2>>& bondi_j,
     460             :     const Scalar<SpinWeighted<ComplexDataVector, 0>>& bondi_r);
     461             : 
     462             : /*!
     463             :  * \brief Compute the Bondi metric contribution \f$Q\f$ (radial derivative of
     464             :  * shift).
     465             :  *
     466             :  * \details The definition of \f$Q\f$ in terms of the Bondi metric components is
     467             :  *
     468             :  * \f[
     469             :  *  Q = q^A e^{-2 \beta} g_{A B} \partial_r U^B.
     470             :  * \f]
     471             :  *
     472             :  * $Q$ can be derived from the intermediate null metric quantities via (see
     473             :  * equations (56) and (57) of \cite Barkett2019uae)
     474             :  *
     475             :  * \f[
     476             :  * \partial_\lambda U = - \left(\partial_\lambda g^{\lambda A}
     477             :  * + \frac{\partial_A \partial_\lambda r}{\partial_\lambda r} g^{A B}
     478             :  * + \frac{\partial_B r}{\partial_\lambda r} \partial_\lambda g^{A B}\right) q_A
     479             :  * + 2 \partial_\lambda \beta (U + g^{\lambda A} q_A)
     480             :  * \f]
     481             :  *
     482             :  * and
     483             :  *
     484             :  * \f[
     485             :  * Q = r^2 (J \partial_\lambda \bar U + K \partial_\lambda U)
     486             :  * \f]
     487             :  *
     488             :  * also provided is \f$\partial_r U\f$, which is separately useful to cache for
     489             :  * other intermediate steps in the CCE computation.
     490             :  */
     491           1 : void bondi_q_worldtube_data(
     492             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 1>>*> bondi_q,
     493             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 1>>*> dr_bondi_u,
     494             :     const Scalar<DataVector>& d2lambda_r,
     495             :     const tnsr::AA<DataVector, 3, Frame::RadialNull>&
     496             :         dlambda_inverse_null_metric,
     497             :     const tnsr::a<DataVector, 3, Frame::RadialNull>& d_bondi_r,
     498             :     const tnsr::i<ComplexDataVector, 2, Frame::RadialNull>& dyad,
     499             :     const tnsr::i<DataVector, 2, Frame::RadialNull>& angular_d_dlambda_r,
     500             :     const tnsr::AA<DataVector, 3, Frame::RadialNull>& inverse_null_metric,
     501             :     const Scalar<SpinWeighted<ComplexDataVector, 2>>& bondi_j,
     502             :     const Scalar<SpinWeighted<ComplexDataVector, 0>>& bondi_r,
     503             :     const Scalar<SpinWeighted<ComplexDataVector, 1>>& bondi_u);
     504             : 
     505             : /*!
     506             :  * \brief Compute the Bondi metric contribution \f$(\partial_u J)_{y} \equiv
     507             :  * H\f$ (the retarded time derivative evaluated at fixed $y$ coordinate) on the
     508             :  * worldtube boundary.
     509             :  *
     510             :  * \details The numerical time derivative (along the worldtube, rather than
     511             :  * along the surface of constant Bondi \f$r\f$) is computed by (see equation
     512             :  * (48) of \cite Barkett2019uae)
     513             :  *
     514             :  * \f[
     515             :  * (\partial_u J)_y = \frac{1}{2 r^2} q^A q^B \partial_u g_{A B}
     516             :  * - \frac{2 \partial_u r}{r} J
     517             :  * \f]
     518             :  *
     519             :  * \note There is the regrettable notation difference with the primary reference
     520             :  * for these formulas \cite Barkett2019uae in that we denote with \f$H\f$ the
     521             :  * time derivative at constant numerical radius, where \cite Barkett2019uae uses
     522             :  * \f$H\f$ to denote the time derivative at constant Bondi radius.
     523             :  */
     524           1 : void bondi_h_worldtube_data(
     525             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 2>>*> bondi_h,
     526             :     const tnsr::a<DataVector, 3, Frame::RadialNull>& d_bondi_r,
     527             :     const Scalar<SpinWeighted<ComplexDataVector, 2>>& bondi_j,
     528             :     const tnsr::aa<DataVector, 3, Frame::RadialNull>& du_null_metric,
     529             :     const Scalar<SpinWeighted<ComplexDataVector, 0>>& bondi_r,
     530             :     const tnsr::I<ComplexDataVector, 2, Frame::RadialNull>& dyad);
     531             : 
     532             : /*!
     533             :  * \brief Compute the Bondi metric contribution \f$(\partial_u J)_r\f$ (the
     534             :  * retarded time derivative at fixed coordinate $r$) on the worldtube boundary.
     535             :  *
     536             :  * \details The numerical time derivative (along the surface of constant r, not
     537             :  * along the worldtube) is computed by (see equation (50) of
     538             :  * \cite Barkett2019uae)
     539             :  *
     540             :  * \f[
     541             :  * \partial_u J = \frac{1}{2 r^2} q^A q^B \left(\partial_u g_{A B}
     542             :  * - \frac{ \partial_u r}{ \partial_\lambda r} \partial_\lambda g_{A B}\right)
     543             :  * \f]
     544             :  *
     545             :  * \note There is the regrettable notation difference with the primary reference
     546             :  * for these formulas \cite Barkett2019uae in that we denote with \f$H\f$ the
     547             :  * time derivative at constant numerical radius, where \cite Barkett2019uae uses
     548             :  * \f$H\f$ to denote the time derivative at constant Bondi radius.
     549             :  */
     550           1 : void du_j_worldtube_data(
     551             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 2>>*> du_bondi_j,
     552             :     const tnsr::a<DataVector, 3, Frame::RadialNull>& d_bondi_r,
     553             :     const Scalar<SpinWeighted<ComplexDataVector, 2>>& bondi_j,
     554             :     const tnsr::aa<DataVector, 3, Frame::RadialNull>& du_null_metric,
     555             :     const tnsr::aa<DataVector, 3, Frame::RadialNull>& dlambda_null_metric,
     556             :     const Scalar<SpinWeighted<ComplexDataVector, 0>>& bondi_r,
     557             :     const tnsr::I<ComplexDataVector, 2, Frame::RadialNull>& dyad);
     558             : 
     559             : /*!
     560             :  * \brief Convert real scalar to complex spinweighted scalar
     561             :  */
     562           1 : void klein_gordon_psi_worldtube_data(
     563             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 0>>*> kg_psi,
     564             :     const Scalar<DataVector>& csw_psi);
     565             : 
     566             : /*!
     567             :  * \brief Compute the time derivative of the scalar for cce and store as a
     568             :  * complex spinweighted scalar
     569             :  */
     570           1 : void klein_gordon_pi_worldtube_data(
     571             :     gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 0>>*> kg_pi,
     572             :     const Scalar<DataVector>& csw_pi, const tnsr::i<DataVector, 3>& csw_phi,
     573             :     const Scalar<DataVector>& lapse, const tnsr::I<DataVector, 3>& shift);
     574             : 
     575             : namespace Tags {
     576             : /*!
     577             :  * \brief The collection of tags mutated by `create_bondi_boundary_data` (and
     578             :  * `create_klein_gordon_boundary_data` if Klein-Gordon variables are included)
     579             :  *
     580             :  * \details This list is used in the evolution of `CharacteristicExtract`
     581             :  */
     582             : template <template <typename> class BoundaryPrefix,
     583             :           bool IncludeKleinGordon = false>
     584           1 : using characteristic_worldtube_boundary_tags = db::wrap_tags_in<
     585             :     BoundaryPrefix,
     586             :     tmpl::append<
     587             :         tmpl::list<Tags::BondiBeta, Tags::BondiU, Tags::Dr<Tags::BondiU>,
     588             :                    Tags::BondiQ, Tags::BondiW, Tags::BondiJ,
     589             :                    Tags::Dr<Tags::BondiJ>, Tags::BondiH, Tags::Du<Tags::BondiJ>,
     590             :                    Tags::BondiR, Tags::Du<Tags::BondiR>, Tags::DuRDividedByR>,
     591             :         tmpl::conditional_t<
     592             :             IncludeKleinGordon,
     593             :             tmpl::list<Cce::Tags::KleinGordonPsi, Cce::Tags::KleinGordonPi>,
     594             :             tmpl::list<>>>>;
     595             : 
     596             : /*!
     597             :  * \brief The collection of tags for worldtube quantities that need to be
     598             :  * written to disk during the Cauchy evolution that the `CharacateristicExtract`
     599             :  * need.
     600             :  *
     601             :  * \details This list is used when writing Bondi quantities to disk. For the
     602             :  * combined ScalarTensor system, this list also includes the Klein-Gordon scalar
     603             :  * variables.
     604             :  */
     605             : template <template <typename> class BoundaryPrefix = Cce::Tags::BoundaryValue,
     606             :           bool IncludeKleinGordon = false>
     607           1 : using worldtube_boundary_tags_for_writing = db::wrap_tags_in<
     608             :     BoundaryPrefix,
     609             :     tmpl::append<
     610             :         tmpl::list<Cce::Tags::BondiBeta, Cce::Tags::Dr<Cce::Tags::BondiJ>,
     611             :                    Cce::Tags::Du<Cce::Tags::BondiR>, Cce::Tags::BondiJ,
     612             :                    Cce::Tags::Du<Cce::Tags::BondiJ>, Cce::Tags::BondiQ,
     613             :                    Cce::Tags::BondiR, Cce::Tags::BondiU, Cce::Tags::BondiW>,
     614             :         tmpl::conditional_t<
     615             :             IncludeKleinGordon,
     616             :             tmpl::list<Cce::Tags::KleinGordonPsi, Cce::Tags::KleinGordonPi>,
     617             :             tmpl::list<>>>>;
     618             : 
     619           0 : using klein_gordon_worldtube_boundary_tags =
     620             :     tmpl::list<Tags::BoundaryValue<Tags::KleinGordonPsi>,
     621             :                Tags::BoundaryValue<Tags::KleinGordonPi>>;
     622             : }  // namespace Tags
     623             : 
     624             : /*!
     625             :  * \brief Process the worldtube data from generalized harmonic quantities
     626             :  *  to desired Bondi quantities, placing the result in the passed
     627             :  * `Variables`.
     628             :  *
     629             :  * \details
     630             :  * The mathematics are a bit complicated for all of the coordinate
     631             :  * transformations that are necessary to obtain the Bondi gauge quantities.
     632             :  * For full mathematical details, see the documentation for functions in
     633             :  * `BoundaryData.hpp` and \cite Barkett2019uae \cite Bishop1998uk.
     634             :  *
     635             :  * This function takes as input the full set of Generalized harmonic metric data
     636             :  * on a two-dimensional surface of constant \f$r\f$ and \f$t\f$ in numerical
     637             :  * coordinates.
     638             :  *
     639             :  * Sufficient tags to provide full worldtube boundary data at a particular
     640             :  * time are set in `bondi_boundary_data`. In particular, the set of tags in
     641             :  * `Tags::characteristic_worldtube_boundary_tags` in the provided `Variables`
     642             :  * are assigned to the worldtube boundary values associated with the input
     643             :  * metric components.
     644             :  *
     645             :  * The majority of the mathematical transformations are implemented as a set of
     646             :  * individual cascaded functions below. The details of the manipulations that
     647             :  * are performed to the input data may be found in the individual functions
     648             :  * themselves, which are called in the following order:
     649             :  * - `trigonometric_functions_on_swsh_collocation()`
     650             :  * - `gr::shift()`
     651             :  * - `gr::lapse()`
     652             :  * - `worldtube_normal_and_derivatives()`
     653             :  * - `gr::spacetime_normal_vector()`
     654             :  * - `gh::time_deriv_of_lapse()`
     655             :  * - `gh::time_deriv_of_shift()`
     656             :  * - `null_vector_l_and_derivatives()`
     657             :  * - `cartesian_to_spherical_coordinates_and_jacobians()`
     658             :  * - `null_metric_and_derivative()`
     659             :  * - `dlambda_null_metric_and_inverse()`
     660             :  * - `bondi_r()`
     661             :  * - `d_bondi_r()`
     662             :  * - `dyads()`
     663             :  * - `beta_worldtube_data()`
     664             :  * - `bondi_u_worldtube_data()`
     665             :  * - `bondi_w_worldtube_data()`
     666             :  * - `bondi_j_worldtube_data()`
     667             :  * - `dr_bondi_j()`
     668             :  * - `d2lambda_bondi_r()`
     669             :  * - `bondi_q_worldtube_data()`
     670             :  * - `bondi_h_worldtube_data()`
     671             :  * - `du_j_worldtube_data()`
     672             :  */
     673           1 : void create_bondi_boundary_data(
     674             :     gsl::not_null<Variables<
     675             :         Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>>*>
     676             :         bondi_boundary_data,
     677             :     const tnsr::iaa<DataVector, 3>& phi, const tnsr::aa<DataVector, 3>& pi,
     678             :     const tnsr::aa<DataVector, 3>& spacetime_metric, double extraction_radius,
     679             :     size_t l_max);
     680             : 
     681             : /*!
     682             :  * \brief Process the worldtube data from modal metric components and
     683             :  * derivatives to desired Bondi quantities, placing the result in the passed
     684             :  * `Variables`.
     685             :  *
     686             :  * \details
     687             :  * The mathematics are a bit complicated for all of the coordinate
     688             :  * transformations that are necessary to obtain the Bondi gauge quantities.
     689             :  * For full mathematical details, see the documentation for functions in
     690             :  * `BoundaryData.hpp` and \cite Barkett2019uae \cite Bishop1998uk.
     691             :  *
     692             :  * This function takes as input the full set of ADM metric data and its radial
     693             :  * and time derivatives on a two-dimensional surface of constant \f$r\f$ and
     694             :  * \f$t\f$ in numerical coordinates. This data must be provided as spherical
     695             :  * harmonic coefficients in the libsharp format. This data is provided in nine
     696             :  * `Tensor`s.
     697             :  *
     698             :  * Sufficient tags to provide full worldtube boundary data at a particular
     699             :  * time are set in `bondi_boundary_data`. In particular, the set of tags in
     700             :  * `Tags::characteristic_worldtube_boundary_tags` in the provided `Variables`
     701             :  * are assigned to the worldtube boundary values associated with the input
     702             :  * metric components.
     703             :  *
     704             :  * The majority of the mathematical transformations are implemented as a set of
     705             :  * individual cascaded functions below. The details of the manipulations that
     706             :  * are performed to the input data may be found in the individual functions
     707             :  * themselves, which are called in the following order:
     708             :  * - `trigonometric_functions_on_swsh_collocation()`
     709             :  * - `cartesian_to_spherical_coordinates_and_jacobians()`
     710             :  * - `cartesian_spatial_metric_and_derivatives_from_modes()`
     711             :  * - `cartesian_shift_and_derivatives_from_modes()`
     712             :  * - `cartesian_lapse_and_derivatives_from_modes()`
     713             :  * - `gh::phi()`
     714             :  * - `gr::time_derivative_of_spacetime_metric`
     715             :  * - `gr::spacetime_metric`
     716             :  * - `generalized_harmonic_quantities()`
     717             :  * - `worldtube_normal_and_derivatives()`
     718             :  * - `null_vector_l_and_derivatives()`
     719             :  * - `null_metric_and_derivative()`
     720             :  * - `dlambda_null_metric_and_inverse()`
     721             :  * - `bondi_r()`
     722             :  * - `d_bondi_r()`
     723             :  * - `dyads()`
     724             :  * - `beta_worldtube_data()`
     725             :  * - `bondi_u_worldtube_data()`
     726             :  * - `bondi_w_worldtube_data()`
     727             :  * - `bondi_j_worldtube_data()`
     728             :  * - `dr_bondi_j()`
     729             :  * - `d2lambda_bondi_r()`
     730             :  * - `bondi_q_worldtube_data()`
     731             :  * - `bondi_h_worldtube_data()`
     732             :  * - `du_j_worldtube_data()`
     733             :  */
     734           1 : void create_bondi_boundary_data(
     735             :     gsl::not_null<Variables<
     736             :         Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>>*>
     737             :         bondi_boundary_data,
     738             :     const tnsr::ii<ComplexModalVector, 3>& spatial_metric_coefficients,
     739             :     const tnsr::ii<ComplexModalVector, 3>& dt_spatial_metric_coefficients,
     740             :     const tnsr::ii<ComplexModalVector, 3>& dr_spatial_metric_coefficients,
     741             :     const tnsr::I<ComplexModalVector, 3>& shift_coefficients,
     742             :     const tnsr::I<ComplexModalVector, 3>& dt_shift_coefficients,
     743             :     const tnsr::I<ComplexModalVector, 3>& dr_shift_coefficients,
     744             :     const Scalar<ComplexModalVector>& lapse_coefficients,
     745             :     const Scalar<ComplexModalVector>& dt_lapse_coefficients,
     746             :     const Scalar<ComplexModalVector>& dr_lapse_coefficients,
     747             :     double extraction_radius, size_t l_max);
     748             : 
     749             : /*!
     750             :  * \brief Process the worldtube data from nodal metric components and
     751             :  * derivatives to desired Bondi quantities, placing the result in the passed
     752             :  * `Variables`.
     753             :  *
     754             :  * \details
     755             :  * The mathematics are a bit complicated for all of the coordinate
     756             :  * transformations that are necessary to obtain the Bondi gauge quantities.
     757             :  * For full mathematical details, see the documentation for functions in
     758             :  * `BoundaryData.hpp` and \cite Barkett2019uae \cite Bishop1998uk.
     759             :  *
     760             :  * This function takes as input the full set of ADM metric data and its radial
     761             :  * and time derivatives on a two-dimensional surface of constant \f$r\f$ and
     762             :  * \f$t\f$ in numerical coordinates. This data must be provided as values at
     763             :  * the collocation points compatible with the libsharp format. This data is
     764             :  * provided in nine `Tensor`s.
     765             :  *
     766             :  * Sufficient tags to provide full worldtube boundary data at a particular
     767             :  * time are set in `bondi_boundary_data`. In particular, the set of tags in
     768             :  * `Tags::characteristic_worldtube_boundary_tags` in the provided `Variables`
     769             :  * are assigned to the worldtube boundary values associated with the input
     770             :  * metric components.
     771             :  *
     772             :  * The majority of the mathematical transformations are implemented as a set of
     773             :  * individual cascaded functions below. The details of the manipulations that
     774             :  * are performed to the input data may be found in the individual functions
     775             :  * themselves, which are called in the following order:
     776             :  * - `trigonometric_functions_on_swsh_collocation()`
     777             :  * - `gh::phi()`
     778             :  * - `gr::time_derivative_of_spacetime_metric`
     779             :  * - `gr::spacetime_metric`
     780             :  * - `worldtube_normal_and_derivatives()`
     781             :  * - `null_vector_l_and_derivatives()`
     782             :  * - `cartesian_to_spherical_coordinates_and_jacobians()`
     783             :  * - `null_metric_and_derivative()`
     784             :  * - `dlambda_null_metric_and_inverse()`
     785             :  * - `bondi_r()`
     786             :  * - `d_bondi_r()`
     787             :  * - `dyads()`
     788             :  * - `beta_worldtube_data()`
     789             :  * - `bondi_u_worldtube_data()`
     790             :  * - `bondi_w_worldtube_data()`
     791             :  * - `bondi_j_worldtube_data()`
     792             :  * - `dr_bondi_j()`
     793             :  * - `d2lambda_bondi_r()`
     794             :  * - `bondi_q_worldtube_data()`
     795             :  * - `bondi_h_worldtube_data()`
     796             :  * - `du_j_worldtube_data()`
     797             :  */
     798           1 : void create_bondi_boundary_data(
     799             :     gsl::not_null<Variables<
     800             :         Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>>*>
     801             :         bondi_boundary_data,
     802             :     const tnsr::ii<DataVector, 3>& cartesian_spatial_metric,
     803             :     const tnsr::ii<DataVector, 3>& cartesian_dt_spatial_metric,
     804             :     const tnsr::ii<DataVector, 3>& cartesian_dr_spatial_metric,
     805             :     const tnsr::I<DataVector, 3>& cartesian_shift,
     806             :     const tnsr::I<DataVector, 3>& cartesian_dt_shift,
     807             :     const tnsr::I<DataVector, 3>& cartesian_dr_shift,
     808             :     const Scalar<DataVector>& cartesian_lapse,
     809             :     const Scalar<DataVector>& cartesian_dt_lapse,
     810             :     const Scalar<DataVector>& cartesian_dr_lapse, double extraction_radius,
     811             :     size_t l_max);
     812             : 
     813             : /*!
     814             :  * \brief Process the worldtube data from CurvedScalarWave quantities
     815             :  *  to desired cce scalar quantities
     816             :  */
     817           1 : void create_klein_gordon_boundary_data(
     818             :     gsl::not_null<Variables<Tags::characteristic_worldtube_boundary_tags<
     819             :         Tags::BoundaryValue, true>>*>
     820             :         bondi_boundary_data,
     821             :     const tnsr::i<DataVector, 3>& csw_phi, const Scalar<DataVector>& csw_pi,
     822             :     const Scalar<DataVector>& csw_psi, const Scalar<DataVector>& lapse,
     823             :     const tnsr::I<DataVector, 3>& shift);
     824             : 
     825             : /*!
     826             :  * \brief Process the worldtube data from modal metric components and
     827             :  * derivatives with incorrectly normalized radial derivatives from an old
     828             :  * version of SpEC to desired Bondi quantities, placing the result in the passed
     829             :  * \ref DataBoxGroup.
     830             :  *
     831             :  * \details
     832             :  * The mathematics are a bit complicated for all of the coordinate
     833             :  * transformations that are necessary to obtain the Bondi gauge quantities.
     834             :  * For full mathematical details, see the documentation for functions in
     835             :  * `BoundaryData.hpp` and \cite Barkett2019uae \cite Bishop1998uk.
     836             :  *
     837             :  * This function takes as input the full set of ADM metric data and its radial
     838             :  * and time derivatives on a two-dimensional surface of constant \f$r\f$ and
     839             :  * \f$t\f$ in numerical coordinates. This data must be provided as spherical
     840             :  * harmonic coefficients in the libsharp format. This data is provided in nine
     841             :  * `Tensor`s.
     842             :  *
     843             :  * Sufficient tags to provide full worldtube boundary data at a particular
     844             :  * time are set in `bondi_boundary_data`. In particular, the set of tags in
     845             :  * `Tags::characteristic_worldtube_boundary_tags` in the provided \ref
     846             :  * DataBoxGroup are assigned to the worldtube boundary values associated with
     847             :  * the input metric components.
     848             :  *
     849             :  * The majority of the mathematical transformations are implemented as a set of
     850             :  * individual cascaded functions below. The details of the manipulations that
     851             :  * are performed to the input data may be found in the individual functions
     852             :  * themselves, which are called in the following order:
     853             :  * - `trigonometric_functions_on_swsh_collocation()`
     854             :  * - `cartesian_to_spherical_coordinates_and_jacobians()`
     855             :  * - `cartesian_spatial_metric_and_derivatives_from_unnormalized_spec_modes()`
     856             :  * - `cartesian_shift_and_derivatives_from_unnormalized_spec_modes()`
     857             :  * - `cartesian_lapse_and_derivatives_from_unnormalized_spec_modes()`
     858             :  * - `gh::phi()`
     859             :  * - `gr::time_derivative_of_spacetime_metric`
     860             :  * - `gr::spacetime_metric`
     861             :  * - `generalized_harmonic_quantities()`
     862             :  * - `worldtube_normal_and_derivatives()`
     863             :  * - `null_vector_l_and_derivatives()`
     864             :  * - `null_metric_and_derivative()`
     865             :  * - `dlambda_null_metric_and_inverse()`
     866             :  * - `bondi_r()`
     867             :  * - `d_bondi_r()`
     868             :  * - `dyads()`
     869             :  * - `beta_worldtube_data()`
     870             :  * - `bondi_u_worldtube_data()`
     871             :  * - `bondi_w_worldtube_data()`
     872             :  * - `bondi_j_worldtube_data()`
     873             :  * - `dr_bondi_j()`
     874             :  * - `d2lambda_bondi_r()`
     875             :  * - `bondi_q_worldtube_data()`
     876             :  * - `bondi_h_worldtube_data()`
     877             :  * - `du_j_worldtube_data()`
     878             :  */
     879           1 : void create_bondi_boundary_data_from_unnormalized_spec_modes(
     880             :     gsl::not_null<Variables<
     881             :         Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>>*>
     882             :         bondi_boundary_data,
     883             :     const tnsr::ii<ComplexModalVector, 3>& spatial_metric_coefficients,
     884             :     const tnsr::ii<ComplexModalVector, 3>& dt_spatial_metric_coefficients,
     885             :     const tnsr::ii<ComplexModalVector, 3>& dr_spatial_metric_coefficients,
     886             :     const tnsr::I<ComplexModalVector, 3>& shift_coefficients,
     887             :     const tnsr::I<ComplexModalVector, 3>& dt_shift_coefficients,
     888             :     const tnsr::I<ComplexModalVector, 3>& dr_shift_coefficients,
     889             :     const Scalar<ComplexModalVector>& lapse_coefficients,
     890             :     const Scalar<ComplexModalVector>& dt_lapse_coefficients,
     891             :     const Scalar<ComplexModalVector>& dr_lapse_coefficients,
     892             :     double extraction_radius, size_t l_max);
     893             : }  // namespace Cce

Generated by: LCOV version 1.14