SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/Cce - BoundaryData.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 90.9 % 33 30
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 <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              :                    Tags::Du<Tags::Dr<Tags::BondiJ>>>,
     592              :         tmpl::conditional_t<
     593              :             IncludeKleinGordon,
     594              :             tmpl::list<Cce::Tags::KleinGordonPsi, Cce::Tags::KleinGordonPi>,
     595              :             tmpl::list<>>>>;
     596              : 
     597              : /*!
     598              :  * \brief The collection of tags for worldtube quantities that need to be
     599              :  * written to disk during the Cauchy evolution that the `CharacateristicExtract`
     600              :  * need.
     601              :  *
     602              :  * \details This list is used when writing Bondi quantities to disk. For the
     603              :  * combined ScalarTensor system, this list also includes the Klein-Gordon scalar
     604              :  * variables.
     605              :  */
     606              : template <template <typename> class BoundaryPrefix = Cce::Tags::BoundaryValue,
     607              :           bool IncludeKleinGordon = false>
     608            1 : using worldtube_boundary_tags_for_writing = db::wrap_tags_in<
     609              :     BoundaryPrefix,
     610              :     tmpl::append<
     611              :         tmpl::list<Cce::Tags::BondiBeta, Cce::Tags::Dr<Cce::Tags::BondiJ>,
     612              :                    Cce::Tags::Du<Cce::Tags::BondiR>, Cce::Tags::BondiJ,
     613              :                    Cce::Tags::Du<Cce::Tags::BondiJ>, Cce::Tags::BondiQ,
     614              :                    Cce::Tags::BondiR, Cce::Tags::BondiU, Cce::Tags::BondiW>,
     615              :         tmpl::conditional_t<
     616              :             IncludeKleinGordon,
     617              :             tmpl::list<Cce::Tags::KleinGordonPsi, Cce::Tags::KleinGordonPi>,
     618              :             tmpl::list<>>>>;
     619              : 
     620            0 : using klein_gordon_worldtube_boundary_tags =
     621              :     tmpl::list<Tags::BoundaryValue<Tags::KleinGordonPsi>,
     622              :                Tags::BoundaryValue<Tags::KleinGordonPi>>;
     623              : }  // namespace Tags
     624              : 
     625              : /*!
     626              :  * \brief Process the worldtube data from generalized harmonic quantities
     627              :  *  to desired Bondi quantities, placing the result in the passed
     628              :  * `Variables`.
     629              :  *
     630              :  * \details
     631              :  * The mathematics are a bit complicated for all of the coordinate
     632              :  * transformations that are necessary to obtain the Bondi gauge quantities.
     633              :  * For full mathematical details, see the documentation for functions in
     634              :  * `BoundaryData.hpp` and \cite Barkett2019uae \cite Bishop1998uk.
     635              :  *
     636              :  * This function takes as input the full set of Generalized harmonic metric data
     637              :  * on a two-dimensional surface of constant \f$r\f$ and \f$t\f$ in numerical
     638              :  * coordinates.
     639              :  *
     640              :  * Sufficient tags to provide full worldtube boundary data at a particular
     641              :  * time are set in `bondi_boundary_data`. In particular, the set of tags in
     642              :  * `Tags::characteristic_worldtube_boundary_tags` in the provided `Variables`
     643              :  * are assigned to the worldtube boundary values associated with the input
     644              :  * metric components.
     645              :  *
     646              :  * The majority of the mathematical transformations are implemented as a set of
     647              :  * individual cascaded functions below. The details of the manipulations that
     648              :  * are performed to the input data may be found in the individual functions
     649              :  * themselves, which are called in the following order:
     650              :  * - `trigonometric_functions_on_swsh_collocation()`
     651              :  * - `gr::shift()`
     652              :  * - `gr::lapse()`
     653              :  * - `worldtube_normal_and_derivatives()`
     654              :  * - `gr::spacetime_normal_vector()`
     655              :  * - `gh::time_deriv_of_lapse()`
     656              :  * - `gh::time_deriv_of_shift()`
     657              :  * - `null_vector_l_and_derivatives()`
     658              :  * - `cartesian_to_spherical_coordinates_and_jacobians()`
     659              :  * - `null_metric_and_derivative()`
     660              :  * - `dlambda_null_metric_and_inverse()`
     661              :  * - `bondi_r()`
     662              :  * - `d_bondi_r()`
     663              :  * - `dyads()`
     664              :  * - `beta_worldtube_data()`
     665              :  * - `bondi_u_worldtube_data()`
     666              :  * - `bondi_w_worldtube_data()`
     667              :  * - `bondi_j_worldtube_data()`
     668              :  * - `dr_bondi_j()`
     669              :  * - `d2lambda_bondi_r()`
     670              :  * - `bondi_q_worldtube_data()`
     671              :  * - `bondi_h_worldtube_data()`
     672              :  * - `du_j_worldtube_data()`
     673              :  */
     674            1 : void create_bondi_boundary_data(
     675              :     gsl::not_null<Variables<
     676              :         Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>>*>
     677              :         bondi_boundary_data,
     678              :     const tnsr::iaa<DataVector, 3>& phi, const tnsr::aa<DataVector, 3>& pi,
     679              :     const tnsr::aa<DataVector, 3>& spacetime_metric, double extraction_radius,
     680              :     size_t l_max);
     681              : 
     682              : /*!
     683              :  * \brief Process the worldtube data from modal metric components and
     684              :  * derivatives to desired Bondi quantities, placing the result in the passed
     685              :  * `Variables`.
     686              :  *
     687              :  * \details
     688              :  * The mathematics are a bit complicated for all of the coordinate
     689              :  * transformations that are necessary to obtain the Bondi gauge quantities.
     690              :  * For full mathematical details, see the documentation for functions in
     691              :  * `BoundaryData.hpp` and \cite Barkett2019uae \cite Bishop1998uk.
     692              :  *
     693              :  * This function takes as input the full set of ADM metric data and its radial
     694              :  * and time derivatives on a two-dimensional surface of constant \f$r\f$ and
     695              :  * \f$t\f$ in numerical coordinates. This data must be provided as spherical
     696              :  * harmonic coefficients in the libsharp format. This data is provided in nine
     697              :  * `Tensor`s.
     698              :  *
     699              :  * Sufficient tags to provide full worldtube boundary data at a particular
     700              :  * time are set in `bondi_boundary_data`. In particular, the set of tags in
     701              :  * `Tags::characteristic_worldtube_boundary_tags` in the provided `Variables`
     702              :  * are assigned to the worldtube boundary values associated with the input
     703              :  * metric components.
     704              :  *
     705              :  * The majority of the mathematical transformations are implemented as a set of
     706              :  * individual cascaded functions below. The details of the manipulations that
     707              :  * are performed to the input data may be found in the individual functions
     708              :  * themselves, which are called in the following order:
     709              :  * - `trigonometric_functions_on_swsh_collocation()`
     710              :  * - `cartesian_to_spherical_coordinates_and_jacobians()`
     711              :  * - `cartesian_spatial_metric_and_derivatives_from_modes()`
     712              :  * - `cartesian_shift_and_derivatives_from_modes()`
     713              :  * - `cartesian_lapse_and_derivatives_from_modes()`
     714              :  * - `gh::phi()`
     715              :  * - `gr::time_derivative_of_spacetime_metric`
     716              :  * - `gr::spacetime_metric`
     717              :  * - `generalized_harmonic_quantities()`
     718              :  * - `worldtube_normal_and_derivatives()`
     719              :  * - `null_vector_l_and_derivatives()`
     720              :  * - `null_metric_and_derivative()`
     721              :  * - `dlambda_null_metric_and_inverse()`
     722              :  * - `bondi_r()`
     723              :  * - `d_bondi_r()`
     724              :  * - `dyads()`
     725              :  * - `beta_worldtube_data()`
     726              :  * - `bondi_u_worldtube_data()`
     727              :  * - `bondi_w_worldtube_data()`
     728              :  * - `bondi_j_worldtube_data()`
     729              :  * - `dr_bondi_j()`
     730              :  * - `d2lambda_bondi_r()`
     731              :  * - `bondi_q_worldtube_data()`
     732              :  * - `bondi_h_worldtube_data()`
     733              :  * - `du_j_worldtube_data()`
     734              :  */
     735            1 : void create_bondi_boundary_data(
     736              :     gsl::not_null<Variables<
     737              :         Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>>*>
     738              :         bondi_boundary_data,
     739              :     const tnsr::ii<ComplexModalVector, 3>& spatial_metric_coefficients,
     740              :     const tnsr::ii<ComplexModalVector, 3>& dt_spatial_metric_coefficients,
     741              :     const tnsr::ii<ComplexModalVector, 3>& dr_spatial_metric_coefficients,
     742              :     const tnsr::I<ComplexModalVector, 3>& shift_coefficients,
     743              :     const tnsr::I<ComplexModalVector, 3>& dt_shift_coefficients,
     744              :     const tnsr::I<ComplexModalVector, 3>& dr_shift_coefficients,
     745              :     const Scalar<ComplexModalVector>& lapse_coefficients,
     746              :     const Scalar<ComplexModalVector>& dt_lapse_coefficients,
     747              :     const Scalar<ComplexModalVector>& dr_lapse_coefficients,
     748              :     double extraction_radius, size_t l_max);
     749              : 
     750              : /*!
     751              :  * \brief Process the worldtube data from nodal metric components and
     752              :  * derivatives to desired Bondi quantities, placing the result in the passed
     753              :  * `Variables`.
     754              :  *
     755              :  * \details
     756              :  * The mathematics are a bit complicated for all of the coordinate
     757              :  * transformations that are necessary to obtain the Bondi gauge quantities.
     758              :  * For full mathematical details, see the documentation for functions in
     759              :  * `BoundaryData.hpp` and \cite Barkett2019uae \cite Bishop1998uk.
     760              :  *
     761              :  * This function takes as input the full set of ADM metric data and its radial
     762              :  * and time derivatives on a two-dimensional surface of constant \f$r\f$ and
     763              :  * \f$t\f$ in numerical coordinates. This data must be provided as values at
     764              :  * the collocation points compatible with the libsharp format. This data is
     765              :  * provided in nine `Tensor`s.
     766              :  *
     767              :  * Sufficient tags to provide full worldtube boundary data at a particular
     768              :  * time are set in `bondi_boundary_data`. In particular, the set of tags in
     769              :  * `Tags::characteristic_worldtube_boundary_tags` in the provided `Variables`
     770              :  * are assigned to the worldtube boundary values associated with the input
     771              :  * metric components.
     772              :  *
     773              :  * The majority of the mathematical transformations are implemented as a set of
     774              :  * individual cascaded functions below. The details of the manipulations that
     775              :  * are performed to the input data may be found in the individual functions
     776              :  * themselves, which are called in the following order:
     777              :  * - `trigonometric_functions_on_swsh_collocation()`
     778              :  * - `gh::phi()`
     779              :  * - `gr::time_derivative_of_spacetime_metric`
     780              :  * - `gr::spacetime_metric`
     781              :  * - `worldtube_normal_and_derivatives()`
     782              :  * - `null_vector_l_and_derivatives()`
     783              :  * - `cartesian_to_spherical_coordinates_and_jacobians()`
     784              :  * - `null_metric_and_derivative()`
     785              :  * - `dlambda_null_metric_and_inverse()`
     786              :  * - `bondi_r()`
     787              :  * - `d_bondi_r()`
     788              :  * - `dyads()`
     789              :  * - `beta_worldtube_data()`
     790              :  * - `bondi_u_worldtube_data()`
     791              :  * - `bondi_w_worldtube_data()`
     792              :  * - `bondi_j_worldtube_data()`
     793              :  * - `dr_bondi_j()`
     794              :  * - `d2lambda_bondi_r()`
     795              :  * - `bondi_q_worldtube_data()`
     796              :  * - `bondi_h_worldtube_data()`
     797              :  * - `du_j_worldtube_data()`
     798              :  */
     799            1 : void create_bondi_boundary_data(
     800              :     gsl::not_null<Variables<
     801              :         Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>>*>
     802              :         bondi_boundary_data,
     803              :     const tnsr::ii<DataVector, 3>& cartesian_spatial_metric,
     804              :     const tnsr::ii<DataVector, 3>& cartesian_dt_spatial_metric,
     805              :     const tnsr::ii<DataVector, 3>& cartesian_dr_spatial_metric,
     806              :     const tnsr::I<DataVector, 3>& cartesian_shift,
     807              :     const tnsr::I<DataVector, 3>& cartesian_dt_shift,
     808              :     const tnsr::I<DataVector, 3>& cartesian_dr_shift,
     809              :     const Scalar<DataVector>& cartesian_lapse,
     810              :     const Scalar<DataVector>& cartesian_dt_lapse,
     811              :     const Scalar<DataVector>& cartesian_dr_lapse, double extraction_radius,
     812              :     size_t l_max);
     813              : 
     814              : /*!
     815              :  * \brief Process the worldtube data from CurvedScalarWave quantities
     816              :  *  to desired cce scalar quantities
     817              :  */
     818            1 : void create_klein_gordon_boundary_data(
     819              :     gsl::not_null<Variables<Tags::characteristic_worldtube_boundary_tags<
     820              :         Tags::BoundaryValue, true>>*>
     821              :         bondi_boundary_data,
     822              :     const tnsr::i<DataVector, 3>& csw_phi, const Scalar<DataVector>& csw_pi,
     823              :     const Scalar<DataVector>& csw_psi, const Scalar<DataVector>& lapse,
     824              :     const tnsr::I<DataVector, 3>& shift);
     825              : 
     826              : /*!
     827              :  * \brief Process the worldtube data from modal metric components and
     828              :  * derivatives with incorrectly normalized radial derivatives from an old
     829              :  * version of SpEC to desired Bondi quantities, placing the result in the passed
     830              :  * \ref DataBoxGroup.
     831              :  *
     832              :  * \details
     833              :  * The mathematics are a bit complicated for all of the coordinate
     834              :  * transformations that are necessary to obtain the Bondi gauge quantities.
     835              :  * For full mathematical details, see the documentation for functions in
     836              :  * `BoundaryData.hpp` and \cite Barkett2019uae \cite Bishop1998uk.
     837              :  *
     838              :  * This function takes as input the full set of ADM metric data and its radial
     839              :  * and time derivatives on a two-dimensional surface of constant \f$r\f$ and
     840              :  * \f$t\f$ in numerical coordinates. This data must be provided as spherical
     841              :  * harmonic coefficients in the libsharp format. This data is provided in nine
     842              :  * `Tensor`s.
     843              :  *
     844              :  * Sufficient tags to provide full worldtube boundary data at a particular
     845              :  * time are set in `bondi_boundary_data`. In particular, the set of tags in
     846              :  * `Tags::characteristic_worldtube_boundary_tags` in the provided \ref
     847              :  * DataBoxGroup are assigned to the worldtube boundary values associated with
     848              :  * the input metric components.
     849              :  *
     850              :  * The majority of the mathematical transformations are implemented as a set of
     851              :  * individual cascaded functions below. The details of the manipulations that
     852              :  * are performed to the input data may be found in the individual functions
     853              :  * themselves, which are called in the following order:
     854              :  * - `trigonometric_functions_on_swsh_collocation()`
     855              :  * - `cartesian_to_spherical_coordinates_and_jacobians()`
     856              :  * - `cartesian_spatial_metric_and_derivatives_from_unnormalized_spec_modes()`
     857              :  * - `cartesian_shift_and_derivatives_from_unnormalized_spec_modes()`
     858              :  * - `cartesian_lapse_and_derivatives_from_unnormalized_spec_modes()`
     859              :  * - `gh::phi()`
     860              :  * - `gr::time_derivative_of_spacetime_metric`
     861              :  * - `gr::spacetime_metric`
     862              :  * - `generalized_harmonic_quantities()`
     863              :  * - `worldtube_normal_and_derivatives()`
     864              :  * - `null_vector_l_and_derivatives()`
     865              :  * - `null_metric_and_derivative()`
     866              :  * - `dlambda_null_metric_and_inverse()`
     867              :  * - `bondi_r()`
     868              :  * - `d_bondi_r()`
     869              :  * - `dyads()`
     870              :  * - `beta_worldtube_data()`
     871              :  * - `bondi_u_worldtube_data()`
     872              :  * - `bondi_w_worldtube_data()`
     873              :  * - `bondi_j_worldtube_data()`
     874              :  * - `dr_bondi_j()`
     875              :  * - `d2lambda_bondi_r()`
     876              :  * - `bondi_q_worldtube_data()`
     877              :  * - `bondi_h_worldtube_data()`
     878              :  * - `du_j_worldtube_data()`
     879              :  */
     880            1 : void create_bondi_boundary_data_from_unnormalized_spec_modes(
     881              :     gsl::not_null<Variables<
     882              :         Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>>*>
     883              :         bondi_boundary_data,
     884              :     const tnsr::ii<ComplexModalVector, 3>& spatial_metric_coefficients,
     885              :     const tnsr::ii<ComplexModalVector, 3>& dt_spatial_metric_coefficients,
     886              :     const tnsr::ii<ComplexModalVector, 3>& dr_spatial_metric_coefficients,
     887              :     const tnsr::I<ComplexModalVector, 3>& shift_coefficients,
     888              :     const tnsr::I<ComplexModalVector, 3>& dt_shift_coefficients,
     889              :     const tnsr::I<ComplexModalVector, 3>& dr_shift_coefficients,
     890              :     const Scalar<ComplexModalVector>& lapse_coefficients,
     891              :     const Scalar<ComplexModalVector>& dt_lapse_coefficients,
     892              :     const Scalar<ComplexModalVector>& dr_lapse_coefficients,
     893              :     double extraction_radius, size_t l_max);
     894              : }  // namespace Cce
        

Generated by: LCOV version 2.0-1