SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/CurvedScalarWave - TimeDerivative.hpp Hit Total Coverage
Commit: 1f2210958b4f38fdc0400907ee7c6d5af5111418 Lines: 1 5 20.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 <cstddef>
       7             : 
       8             : #include "DataStructures/Tensor/TypeAliases.hpp"
       9             : #include "Evolution/DiscontinuousGalerkin/TimeDerivativeDecisions.hpp"
      10             : #include "Evolution/Systems/CurvedScalarWave/Characteristics.hpp"
      11             : #include "Evolution/Systems/CurvedScalarWave/Tags.hpp"
      12             : #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp"
      13             : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
      14             : #include "Utilities/Gsl.hpp"
      15             : #include "Utilities/TMPL.hpp"
      16             : 
      17             : /// \cond
      18             : class DataVector;
      19             : template <typename X, typename Symm, typename IndexList>
      20             : class Tensor;
      21             : /// \endcond
      22             : 
      23             : namespace CurvedScalarWave {
      24             : /*!
      25             :  * \brief Compute the time derivative of the evolved variables of the
      26             :  * first-order scalar wave system on a curved background.
      27             :  *
      28             :  * The evolution equations for the first-order scalar wave system are given by
      29             :  * \cite Holst2004wt :
      30             :  *
      31             :  * \f{align}
      32             :  * \partial_t\Psi = & - \alpha \Pi + \beta^k \partial_k \Psi
      33             :  * + \gamma_1 \beta^k (\partial_k \Psi - \Phi_k) \\
      34             :  *
      35             :  * \partial_t\Pi = & \alpha K \Pi + \beta^i \partial_i \Pi
      36             :  * + \alpha \Gamma^i \Phi_i
      37             :  * + \gamma_1 \gamma_2 \beta^i ( \partial_i \Psi - \Phi_i )
      38             :  * - \alpha \gamma^{ij} \partial_i\Phi_j
      39             :  * - \gamma^{ij} \Phi_i \partial_j \alpha \\
      40             :  *
      41             :  * \partial_t\Phi_i = & - \alpha \partial_i \Pi  + \beta^k \partial_k \Phi_i
      42             :  * + \gamma_2 \alpha ( \partial_i \Psi - \Phi_i )
      43             :  * - \Pi \partial_i \alpha + \Phi_j \partial_i \beta^j \\
      44             :  * \f}
      45             :  *
      46             :  * where \f$\Psi\f$ is the scalar field, \f$\Pi\f$ is the
      47             :  * conjugate momentum to \f$\Psi\f$, \f$\Phi_i=\partial_i\Psi\f$ is an
      48             :  * auxiliary variable, \f$\alpha\f$ is the lapse, \f$\beta^k\f$ is the shift,
      49             :  * \f$ \gamma_{ij} \f$ is the spatial metric, \f$ K \f$ is the trace of the
      50             :  * extrinsic curvature, and \f$ \Gamma^i \f$ is the trace of the spatial
      51             :  * Christoffel symbol of the second kind. \f$\gamma_1, \gamma_2\f$ are
      52             :  * constraint damping parameters.
      53             :  */
      54             : template <size_t Dim>
      55           1 : struct TimeDerivative {
      56             :  public:
      57           0 :   using temporary_tags =
      58             :       tmpl::list<gr::Tags::Lapse<DataVector>, gr::Tags::Shift<DataVector, Dim>,
      59             :                  gr::Tags::InverseSpatialMetric<DataVector, Dim>,
      60             :                  Tags::ConstraintGamma1, Tags::ConstraintGamma2>;
      61             : 
      62           0 :   using argument_tags =
      63             :       tmpl::list<Tags::Pi, Tags::Phi<Dim>, gr::Tags::Lapse<DataVector>,
      64             :                  gr::Tags::Shift<DataVector, Dim>,
      65             :                  ::Tags::deriv<gr::Tags::Lapse<DataVector>, tmpl::size_t<Dim>,
      66             :                                Frame::Inertial>,
      67             :                  ::Tags::deriv<gr::Tags::Shift<DataVector, Dim>,
      68             :                                tmpl::size_t<Dim>, Frame::Inertial>,
      69             :                  gr::Tags::InverseSpatialMetric<DataVector, Dim>,
      70             :                  gr::Tags::TraceSpatialChristoffelSecondKind<DataVector, Dim>,
      71             :                  gr::Tags::TraceExtrinsicCurvature<DataVector>,
      72             :                  Tags::ConstraintGamma1, Tags::ConstraintGamma2>;
      73             : 
      74           0 :   static evolution::dg::TimeDerivativeDecisions<Dim> apply(
      75             :       gsl::not_null<Scalar<DataVector>*> dt_psi,
      76             :       gsl::not_null<Scalar<DataVector>*> dt_pi,
      77             :       gsl::not_null<tnsr::i<DataVector, Dim, Frame::Inertial>*> dt_phi,
      78             : 
      79             :       gsl::not_null<Scalar<DataVector>*> result_lapse,
      80             :       gsl::not_null<tnsr::I<DataVector, Dim>*> result_shift,
      81             :       gsl::not_null<tnsr::II<DataVector, Dim>*> result_inverse_spatial_metric,
      82             :       gsl::not_null<Scalar<DataVector>*> result_gamma1,
      83             :       gsl::not_null<Scalar<DataVector>*> result_gamma2,
      84             : 
      85             :       const tnsr::i<DataVector, Dim>& d_psi,
      86             :       const tnsr::i<DataVector, Dim>& d_pi,
      87             :       const tnsr::ij<DataVector, Dim>& d_phi, const Scalar<DataVector>& pi,
      88             :       const tnsr::i<DataVector, Dim>& phi, const Scalar<DataVector>& lapse,
      89             :       const tnsr::I<DataVector, Dim>& shift,
      90             :       const tnsr::i<DataVector, Dim>& deriv_lapse,
      91             :       const tnsr::iJ<DataVector, Dim>& deriv_shift,
      92             :       const tnsr::II<DataVector, Dim>& upper_spatial_metric,
      93             :       const tnsr::I<DataVector, Dim>& trace_spatial_christoffel,
      94             :       const Scalar<DataVector>& trace_extrinsic_curvature,
      95             :       const Scalar<DataVector>& gamma1, const Scalar<DataVector>& gamma2);
      96             : };
      97             : }  // namespace CurvedScalarWave

Generated by: LCOV version 1.14