SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/ScalarTensor - ScalarSource.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 66.7 % 3 2
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 "DataStructures/Tensor/Tensor.hpp"
       7              : #include "Utilities/Gsl.hpp"
       8              : 
       9              : namespace ScalarTensor {
      10              : 
      11              : /*!
      12              :  * \brief Add in the source term to the \f$\Pi\f$
      13              :  * evolved variable of the ::CurvedScalarWave system.
      14              :  *
      15              :  * \details The only source term in the wave equation
      16              :  * \f[
      17              :  *  \Box \Psi = \mathcal{S} ~,
      18              :  *  \f]
      19              :  *
      20              :  * is in the equation for \f$\Pi\f$:
      21              :  * \f[
      22              :  *  \partial_t \Pi + \text{\{spatial derivative
      23              :  * terms\}} = \alpha \mathcal{S}
      24              :  * ~,
      25              :  * \f]
      26              :  *
      27              :  * where \f$\mathcal{S}\f$ is the source term (e. g. in the Klein-Gordon
      28              :  * equation, the source term is the derivative of the scalar potential
      29              :  * \f$\mathcal{S} \equiv \partial V / \partial \Psi \f$.)
      30              :  *
      31              :  * This function adds that contribution to the existing value of `dt_pi_scalar`.
      32              :  * The wave equation terms in the scalar equation should be computed before
      33              :  * passing the `dt_pi_scalar` to this function for updating.
      34              :  *
      35              :  * \param dt_pi_scalar Time derivative terms of $\Pi$. The sourceless part
      36              :  * should be computed before with ::CurvedScalarWave::TimeDerivative.
      37              :  * \param scalar_source Source term $\mathcal{S}$ for the scalar equation.
      38              :  * \param lapse Lapse $\alpha$.
      39              :  *
      40              :  * \see `CurvedScalarWave::TimeDerivative` for details about the source-less
      41              :  * part of the time derivative calculation.
      42              :  */
      43            1 : void add_scalar_source_to_dt_pi_scalar(
      44              :     gsl::not_null<Scalar<DataVector>*> dt_pi_scalar,
      45              :     const Scalar<DataVector>& scalar_source, const Scalar<DataVector>& lapse);
      46              : 
      47              : /*!
      48              :  * \brief Computes the source term given by the mass of the scalar.
      49              :  *
      50              :  * \details For a scalar field with mass parameter \f$ m_\Psi \f$,
      51              :  * the wave equation takes the form
      52              :  * \f[
      53              :  *   \Box \Psi = \mathcal{S} ~,
      54              :  * \f]
      55              :  *
      56              :  * where the source is given by
      57              :  * \f[
      58              :  *   \mathcal{S} \equiv m^2_\Psi \Psi~.
      59              :  * \f]
      60              :  *
      61              :  * Here the mass parameter value is an option that needs to be specified in the
      62              :  * input file.
      63              :  *
      64              :  * \param scalar_source Source term $\mathcal{S}$ for the scalar equation.
      65              :  * \param psi Scalar field $\Psi$.
      66              :  * \param mass_psi Mass of the scalar field $m_\Psi$.
      67              :  *
      68              :  * \see `ScalarTensor::Tags::ScalarMass` for details about the mass.
      69              :  */
      70            1 : void mass_source(gsl::not_null<Scalar<DataVector>*> scalar_source,
      71              :                  const Scalar<DataVector>& psi, double mass_psi);
      72              : 
      73              : }  // namespace ScalarTensor
        

Generated by: LCOV version 2.0-1