SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/CurvedScalarWave/Worldtube - SelfForce.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 90.9 % 11 10
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/Tensor/Tensor.hpp"
       9              : #include "Utilities/Gsl.hpp"
      10              : 
      11              : namespace CurvedScalarWave::Worldtube {
      12              : 
      13              : namespace detail {
      14              : void check_positive_time_and_timescale(double t_minus_turn_on,
      15              :                                        double turn_on_timescale);
      16              : 
      17              : }  // namespace detail
      18              : 
      19              : /// @{
      20              : /*!
      21              :  * \brief Computes the coordinate acceleration due to the scalar self-force onto
      22              :  * the charge.
      23              :  *
      24              :  * \details It is given by
      25              :  *
      26              :  * \begin{equation}
      27              :  * (u^0)^2 \ddot{x}^i_p  = \frac{q}{\mu}(g^{i
      28              :  * \alpha} - \dot{x}^i_p g^{0 \alpha} ) \partial_\alpha \Psi^R
      29              :  * \end{equation}
      30              :  *
      31              :  * where $\dot{x}^i_p$ is the position of the scalar charge, $\Psi^R$ is the
      32              :  * regular field, $q$ is the particle's charge, $\mu$ is the particle's mass,
      33              :  * $u^\alpha$ is the four-velocity and $g^{\alpha \beta}$ is the inverse
      34              :  * spacetime metric in the inertial frame, evaluated at the position of the
      35              :  * particle. An overdot denotes a derivative with respect to coordinate time.
      36              :  * Greek indices are spacetime indices and Latin indices are purely spatial.
      37              :  * Note that the coordinate geodesic acceleration is NOT included.
      38              :  */
      39              : template <size_t Dim>
      40            1 : void self_force_acceleration(
      41              :     gsl::not_null<tnsr::I<double, Dim>*> self_force_acc,
      42              :     const Scalar<double>& dt_psi_monopole,
      43              :     const tnsr::i<double, Dim>& psi_dipole,
      44              :     const tnsr::I<double, Dim>& particle_velocity, double particle_charge,
      45              :     double particle_mass, const tnsr::AA<double, Dim>& inverse_metric,
      46              :     const Scalar<double>& dilation_factor);
      47              : 
      48              : template <size_t Dim>
      49            1 : tnsr::I<double, Dim> self_force_acceleration(
      50              :     const Scalar<double>& dt_psi_monopole,
      51              :     const tnsr::i<double, Dim>& psi_dipole,
      52              :     const tnsr::I<double, Dim>& particle_velocity, double particle_charge,
      53              :     double particle_mass, const tnsr::AA<double, Dim>& inverse_metric,
      54              :     const Scalar<double>& dilation_factor);
      55              : 
      56              : /// @}
      57              : /*!
      58              :  * \brief Computes the scalar self-force per unit mass
      59              :  *
      60              :  * \details It is given by
      61              :  * \begin{equation}
      62              :  * f^\alpha = \frac{q}{\mu} (g^{\alpha \beta} + u^\alpha u^\beta) \partial_\beta
      63              :  * \Psi^R
      64              :  * \end{equation}
      65              :  * where $\Psi^R$ is the regular field at the position of the particle, $q$ is
      66              :  * the particle's charge, $\mu$ is the particle's mass, $u^\alpha$ is the
      67              :  * four-velocity and $g^{\alpha \beta}$ is the inverse spacetime metric in the
      68              :  * inertial frame, evaluated at the position of the particle.
      69              :  */
      70              : template <size_t Dim>
      71            1 : tnsr::A<double, Dim> self_force_per_mass(
      72              :     const tnsr::a<double, Dim>& d_psi,
      73              :     const tnsr::A<double, Dim>& four_velocity, double particle_charge,
      74              :     double particle_mass, const tnsr::AA<double, Dim>& inverse_metric);
      75              : 
      76              : /*!
      77              :  * \brief Computes the first time derivative of scalar self-force per unit mass,
      78              :  * see `self_force_per_mass`, by applying the chain rule.
      79              :  */
      80              : template <size_t Dim>
      81            1 : tnsr::A<double, Dim> dt_self_force_per_mass(
      82              :     const tnsr::a<double, Dim>& d_psi, const tnsr::a<double, Dim>& dt_d_psi,
      83              :     const tnsr::A<double, Dim>& four_velocity,
      84              :     const tnsr::A<double, Dim>& dt_four_velocity, double particle_charge,
      85              :     double particle_mass, const tnsr::AA<double, Dim>& inverse_metric,
      86              :     const tnsr::AA<double, Dim>& dt_inverse_metric);
      87              : 
      88              : /*!
      89              :  * \brief Computes the second time derivative of scalar self-force per unit
      90              :  * mass, see `self_force_per_mass`, by applying the chain rule.
      91              :  */
      92              : template <size_t Dim>
      93            1 : tnsr::A<double, Dim> dt2_self_force_per_mass(
      94              :     const tnsr::a<double, Dim>& d_psi, const tnsr::a<double, Dim>& dt_d_psi,
      95              :     const tnsr::a<double, Dim>& dt2_d_psi,
      96              :     const tnsr::A<double, Dim>& four_velocity,
      97              :     const tnsr::A<double, Dim>& dt_four_velocity,
      98              :     const tnsr::A<double, Dim>& dt2_four_velocity, double particle_charge,
      99              :     double particle_mass, const tnsr::AA<double, Dim>& inverse_metric,
     100              :     const tnsr::AA<double, Dim>& dt_inverse_metric,
     101              :     const tnsr::AA<double, Dim>& dt2_inverse_metric);
     102              : 
     103              : /*!
     104              :  * \brief Computes the covariant derivative of the scalar self-force per unit
     105              :  * mass $f^\alpha$, see `self_force_per_mass`, along the four velocity
     106              :  * $u^\beta$, i.e. $u^\beta \nabla_\beta f^\alpha$.
     107              :  */
     108              : template <size_t Dim>
     109            1 : tnsr::A<double, Dim> Du_self_force_per_mass(
     110              :     const tnsr::A<double, Dim>& self_force,
     111              :     const tnsr::A<double, Dim>& dt_self_force,
     112              :     const tnsr::A<double, Dim>& four_velocity,
     113              :     const tnsr::Abb<double, Dim>& christoffel);
     114              : /*!
     115              :  * \brief Computes the time derivative of the covariant derivative of the scalar
     116              :  * self-force per unit mass $f^\alpha$, see `Du_self_force_per_mass`, along the
     117              :  * four velocity $u^\beta$, i.e.
     118              :  * $\frac{d}{dt}u^\beta \nabla_\beta f^\alpha$.
     119              :  */
     120              : template <size_t Dim>
     121            1 : tnsr::A<double, Dim> dt_Du_self_force_per_mass(
     122              :     const tnsr::A<double, Dim>& self_force,
     123              :     const tnsr::A<double, Dim>& dt_self_force,
     124              :     const tnsr::A<double, Dim>& dt2_self_force,
     125              :     const tnsr::A<double, Dim>& four_velocity,
     126              :     const tnsr::A<double, Dim>& dt_four_velocity,
     127              :     const tnsr::Abb<double, Dim>& christoffel,
     128              :     const tnsr::Abb<double, Dim>& dt_christoffel);
     129              : 
     130              : /*!
     131              :  * \brief A function used to roll-on the self-force continuously from 0 to 1
     132              :  *
     133              :  * \details It is given by Eq.(60) of \cite Wittek:2024gxn
     134              :  * \begin{equation}
     135              :  * w(t) = 1 - \exp \left( - \left( (t - t_{\mathrm{turn_on}}) / \sigma \right)^4
     136              :  * \right), \end{equation} where $t$ is the current simulation time,
     137              :  * $t_{\mathrm{turn_on}}$ is the time where the self-force is turned on and
     138              :  * $\sigma$ dictates the timescale over which it is turned on. The function is
     139              :  * $\mathcal{C}^3$, i.e. three times continuously differentiable, assuming $w(t)
     140              :  * = 0$ for $t < t_{\mathrm{turn_on}}$.
     141              :  */
     142            1 : double turn_on_function(double t_minus_turn_on, double turn_on_timescale);
     143              : 
     144              : /*!
     145              :  * \brief The first derivative of `turn_on_function`
     146              :  */
     147            1 : double dt_turn_on_function(double t_minus_turn_on, double turn_on_timescale);
     148              : 
     149              : /*!
     150              :  * \brief The second derivative of `turn_on_function`
     151              :  */
     152            1 : double dt2_turn_on_function(double t_minus_turn_on, double turn_on_timescale);
     153              : 
     154              : }  // namespace CurvedScalarWave::Worldtube
        

Generated by: LCOV version 2.0-1