SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/ScalarTensor - StressEnergy.hpp Hit Total Coverage
Commit: 965048f86d23c819715b3af1ca3f880c8145d4bb Lines: 3 9 33.3 %
Date: 2024-05-16 17:00:40
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/DataVector.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 "Utilities/Gsl.hpp"
      12             : 
      13             : namespace ScalarTensor {
      14             : 
      15             : /*!
      16             :  * \brief Add in the trace-reversed stress-energy source term to the \f$\Pi\f$
      17             :  * evolved variable of the ::gh system.
      18             :  *
      19             :  * \details The only stress energy source term in the Generalized Harmonic
      20             :  * evolution equations is in the equation for \f$\Pi_{a b}\f$:
      21             :  * \f[
      22             :  * \partial_t \Pi_{ab} + \text{\{spatial derivative terms\}} =
      23             :  * \text{\{GH source terms\}}
      24             :  * - 16 \pi \alpha (T^{(\Psi)}_{ab} - \frac{1}{2} g_{a b} g^{cd}T^{(\Psi)}_{cd})
      25             :  * ~.
      26             :  * \f]
      27             :  *
      28             :  * (note that this function takes as argument the trace-reversed stress-energy
      29             :  * tensor)
      30             :  *
      31             :  * This function adds that contribution to the existing value of `dt_pi`. The
      32             :  * spacetime terms in the GH equation should be computed before passing the
      33             :  * `dt_pi` to this function for updating.
      34             :  *
      35             :  * \param dt_pi Time derivative of the $\Pi_{ab}$ variable in the ::gh system.
      36             :  * The vacuum part should be computed before with ::gh::TimeDerivative
      37             :  * \param trace_reversed_stress_energy Trace-reversed stress energy tensor of
      38             :  * the scalar $T^{(\Psi), \text{TR}}_{a b} \equiv T^{(\Psi)}_{ab} - \frac{1}{2}
      39             :  *  g_{a b} g^{cd}T^{(\Psi)}_{cd} = \partial_a \Psi \partial_b \Psi $.
      40             :  * \param lapse Lapse $\alpha$.
      41             :  *
      42             :  * \see `gh::TimeDerivative` for details about the spacetime
      43             :  * part of the time derivative calculation.
      44             :  */
      45           1 : void add_stress_energy_term_to_dt_pi(
      46             :     gsl::not_null<tnsr::aa<DataVector, 3_st>*> dt_pi,
      47             :     const tnsr::aa<DataVector, 3_st>& trace_reversed_stress_energy,
      48             :     const Scalar<DataVector>& lapse);
      49             : 
      50             : /*!
      51             :  * \brief Compute the trace-reversed stress-energy tensor of the scalar field.
      52             :  *
      53             :  * \details The trace-reversed stress energy tensor is needed to compute the
      54             :  * backreaction of the scalar to the spacetime evolution and is given by
      55             :  * \f{align*}{
      56             :  * T^{(\Psi), \text{TR}}_{a b} &\equiv T^{(\Psi)}_{ab} - \frac{1}{2}
      57             :  *  g_{a b} g^{cd}T^{(\Psi)}_{cd} \\
      58             :  *  &= \partial_a \Psi \partial_b \Psi ~,
      59             :  * \f}
      60             :  *
      61             :  * where \f$T^{(\Psi)}_{ab}\f$ is the standard stress-energy tensor of the
      62             :  * scalar.
      63             :  *
      64             :  * In terms of the evolved variables of the scalar,
      65             :  * \f{align*}{
      66             :     T^{(\Psi), \text{TR}}_{00} &= \alpha^2 \Pi^2 ~, \\
      67             :     T^{(\Psi), \text{TR}}_{j 0} &= T^{(\Psi), \text{TR}}_{0j}
      68             :                                  = - \alpha \Pi \Phi_j ~, \\
      69             :     T^{(\Psi), \text{TR}}_{ij} &= \Phi_i \Phi_j ~,
      70             :  * \f}
      71             :  *
      72             :  * where \f$\alpha\f$ is the lapse.
      73             :  *
      74             :  * \param stress_energy Trace-reversed stress energy tensor of
      75             :  * the scalar $T^{(\Psi), \text{TR}}_{a b} \equiv T^{(\Psi)}_{ab} - \frac{1}{2}
      76             :  *  g_{a b} g^{cd}T^{(\Psi)}_{cd} = \partial_a \Psi \partial_b \Psi $.
      77             :  * \param pi_scalar Scalar evolution variable $\Pi$.
      78             :  * \param phi_scalar Scalar evolution variable $\Phi_i$.
      79             :  * \param lapse Lapse $\alpha$.
      80             :  */
      81           1 : void trace_reversed_stress_energy(
      82             :     gsl::not_null<tnsr::aa<DataVector, 3_st>*> stress_energy,
      83             :     const Scalar<DataVector>& pi_scalar,
      84             :     const tnsr::i<DataVector, 3_st>& phi_scalar,
      85             :     const Scalar<DataVector>& lapse);
      86             : 
      87             : namespace Tags {
      88             : 
      89             : /*!
      90             :  * \brief Compute tag for the trace reversed stress energy tensor.
      91             :  *
      92             :  * \details Compute using ScalarTensor::trace_reversed_stress_energy.
      93             :  */
      94           1 : struct TraceReversedStressEnergyCompute
      95             :     : TraceReversedStressEnergy<DataVector, 3_st, Frame::Inertial>,
      96             :       db::ComputeTag {
      97           0 :   static constexpr size_t Dim = 3;
      98           0 :   using argument_tags =
      99             :       tmpl::list<CurvedScalarWave::Tags::Pi, CurvedScalarWave::Tags::Phi<Dim>,
     100             :                  gr::Tags::Lapse<DataVector>>;
     101           0 :   using return_type = tnsr::aa<DataVector, Dim, Frame::Inertial>;
     102           0 :   static constexpr void (*function)(
     103             :       const gsl::not_null<tnsr::aa<DataVector, Dim>*> result,
     104             :       const Scalar<DataVector>&, const tnsr::i<DataVector, Dim>&,
     105             :       const Scalar<DataVector>&) = &trace_reversed_stress_energy;
     106           0 :   using base = TraceReversedStressEnergy<DataVector, Dim, Frame::Inertial>;
     107             : };
     108             : }  // namespace Tags
     109             : 
     110             : }  // namespace ScalarTensor

Generated by: LCOV version 1.14