SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/ScalarTensor/ScalarGaussBonnet - ScalarSource.hpp Hit Total Coverage
Commit: 1f2210958b4f38fdc0400907ee7c6d5af5111418 Lines: 5 10 50.0 %
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 "DataStructures/DataBox/Tag.hpp"
       7             : #include "DataStructures/Tensor/Tensor.hpp"
       8             : #include "Evolution/Systems/CurvedScalarWave/Tags.hpp"
       9             : #include "Evolution/Systems/ScalarTensor/Tags.hpp"
      10             : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
      11             : #include "PointwiseFunctions/ScalarTensor/ScalarGaussBonnet/CouplingParameters.hpp"
      12             : #include "PointwiseFunctions/ScalarTensor/ScalarGaussBonnet/Tags.hpp"
      13             : #include "PointwiseFunctions/ScalarTensor/SourceTags.hpp"
      14             : #include "Time/Tags/Time.hpp"
      15             : #include "Utilities/Gsl.hpp"
      16             : 
      17             : namespace ScalarTensor {
      18             : /// @{
      19             : /*!
      20             :  * \brief Computes the source term given by the coupling of the scalar to
      21             :  * curvature.
      22             :  *
      23             :  * \details For a scalar field with mass parameter $ m_\Psi $,
      24             :  * the wave equation takes the form
      25             :  * \begin{align}
      26             :  *   \Box \Psi = \mathcal{S} ~,
      27             :  * \end{align}
      28             :  *
      29             :  * where the source is given by
      30             :  * \begin{align}
      31             :  *   \mathcal{S} \equiv m^2_\Psi \Psi - f'(\Psi) \mathcal{G}~,
      32             :  * \end{align}
      33             :  * where
      34             :  * \begin{align}
      35             :  *   \mathcal{G} \equiv 8 (E_{ab} E^{ab} - B_{ab} B^{ab}) ~,
      36             :  * \end{align}
      37             :  * is the Gauss-Bonnet scalar and the coupling function is given by
      38             :  * \begin{align}
      39             :  *   f(\Psi) \equiv \lambda \Psi
      40             :  *      + \dfrac{1}{16} \left( \eta \Psi^2 + 2 \zeta \Psi^4 \right) ~,
      41             :  * \end{align}
      42             :  * Here the Gauss-Bonnet scalar (in vacuum) is given in terms of the electric
      43             :  * ($ E_{ab} $) and magnetic ($ B_{ab} $) parts of the Weyl scalar.
      44             :  *
      45             :  */
      46           1 : void gauss_bonnet_scalar_source(
      47             :     gsl::not_null<Scalar<DataVector>*> scalar_source,
      48             :     const Scalar<DataVector>& weyl_electric_scalar,
      49             :     const Scalar<DataVector>& weyl_magnetic_scalar,
      50             :     const Scalar<DataVector>& psi,
      51             :     const CouplingParameterOptions& coupling_parameters, double mass_psi,
      52             :     std::pair<double, double> start_and_ramp_times, double time);
      53             : 
      54           1 : Scalar<DataVector> gauss_bonnet_scalar_source(
      55             :     const Scalar<DataVector>& weyl_electric_scalar,
      56             :     const Scalar<DataVector>& weyl_magnetic_scalar,
      57             :     const Scalar<DataVector>& psi,
      58             :     const CouplingParameterOptions& coupling_parameters, double mass_psi,
      59             :     std::pair<double, double> start_and_ramp_times, double time);
      60             : /// @}
      61             : 
      62             : /*!
      63             :  * \brief Multiplies by the coupling function.
      64             :  *
      65             :  * \details Multiply by the first derivative of the coupling function given by
      66             :  * \begin{align}
      67             :  *   f(\Psi) \equiv
      68             :  *      + \dfrac{1}{16} \left( 4 \lambda \Psi + 2 \eta \Psi^2 + \zeta \Psi^4
      69             :  * \right) ~.
      70             :  * \end{align}
      71             :  *
      72             :  */
      73           1 : void multiply_by_negative_deriv_of_coupling_func(
      74             :     gsl::not_null<Scalar<DataVector>*> scalar_source,
      75             :     const Scalar<DataVector>& psi,
      76             :     const CouplingParameterOptions& coupling_parameters,
      77             :     std::pair<double, double> start_and_ramp_times, double time);
      78             : 
      79             : /*!
      80             :  * \brief Multiplies by the coupling function.
      81             :  *
      82             :  * \details Multiply by the second derivative of the coupling function given by
      83             :  * \begin{align}
      84             :  *   f(\Psi) \equiv
      85             :  *      + \dfrac{1}{16} \left( 4 \lambda \Psi + 2 \eta \Psi^2 + \zeta \Psi^4
      86             :  * \right) ~.
      87             :  * \end{align}
      88             :  *
      89             :  */
      90           1 : void multiply_by_negative_second_deriv_of_coupling_func(
      91             :     gsl::not_null<Scalar<DataVector>*> scalar_source,
      92             :     const Scalar<DataVector>& psi,
      93             :     const CouplingParameterOptions& coupling_parameters,
      94             :     std::pair<double, double> start_and_ramp_times, double time);
      95             : 
      96             : namespace Tags {
      97             : /*!
      98             :  * \copydoc ScalarTensor::gauss_bonnet_scalar_source
      99             :  */
     100           1 : struct ScalarSourceCompute : ScalarSource, db::ComputeTag {
     101           0 :   using argument_tags = tmpl::list<
     102             :       gr::Tags::WeylElectricScalar<DataVector>,
     103             :       gr::Tags::WeylMagneticScalar<DataVector>, CurvedScalarWave::Tags::Psi,
     104             :       ScalarTensor::Tags::CouplingParameters, ScalarTensor::Tags::ScalarMass,
     105             :       ScalarTensor::Tags::RampUpParameters, ::Tags::Time>;
     106           0 :   using return_type = Scalar<DataVector>;
     107           0 :   static constexpr void (*function)(
     108             :       const gsl::not_null<Scalar<DataVector>*> /* scalar_source */,
     109             :       const Scalar<DataVector>& /* weyl_electric_scalar */,
     110             :       const Scalar<DataVector>& /* weyl_magnetic_scalar */,
     111             :       const Scalar<DataVector>& /* psi */,
     112             :       const CouplingParameterOptions& /* coupling_parameters */,
     113             :       const double /* mass_psi */,
     114             :       const std::pair<double, double> /* start_and_ramp_times */,
     115             :       const double /* time */) = &gauss_bonnet_scalar_source;
     116           0 :   using base = ScalarSource;
     117             : };
     118             : }  // namespace Tags
     119             : 
     120             : }  // namespace ScalarTensor

Generated by: LCOV version 1.14