SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/ScalarTensor - TimeDerivative.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 5.6 % 18 1
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/DataBox/PrefixHelpers.hpp"
       9              : #include "DataStructures/DataBox/Prefixes.hpp"
      10              : #include "DataStructures/DataVector.hpp"
      11              : #include "DataStructures/TaggedContainers.hpp"
      12              : #include "DataStructures/Tensor/Tensor.hpp"
      13              : #include "Evolution/DiscontinuousGalerkin/TimeDerivativeDecisions.hpp"
      14              : #include "Evolution/Systems/CurvedScalarWave/System.hpp"
      15              : #include "Evolution/Systems/CurvedScalarWave/TimeDerivative.hpp"
      16              : #include "Evolution/Systems/GeneralizedHarmonic/System.hpp"
      17              : #include "Evolution/Systems/GeneralizedHarmonic/TimeDerivative.hpp"
      18              : #include "Evolution/Systems/ScalarTensor/Tags.hpp"
      19              : #include "PointwiseFunctions/AnalyticData/GhScalarTensor/Factory.hpp"
      20              : #include "PointwiseFunctions/ScalarTensor/ScalarSource.hpp"
      21              : #include "PointwiseFunctions/ScalarTensor/StressEnergy.hpp"
      22              : #include "Time/Tags/Time.hpp"
      23              : #include "Utilities/Gsl.hpp"
      24              : #include "Utilities/TMPL.hpp"
      25              : 
      26              : namespace ScalarTensor {
      27              : /*!
      28              :  * \brief Compute the RHS terms of the evolution equations for the scalar tensor
      29              :  * system.
      30              :  *
      31              :  * \details The bulk of the computations in this class dispatch to
      32              :  * `GeneralizedHarmonic::TimeDerivative` and
      33              :  * `CurvedScalarWave::TimeDerivative` as a 'product system' -- each
      34              :  * independently operating on its own subset of the supplied variable
      35              :  * collections.
      36              :  * The additional steps taken are to compute the trace-reversed stress energy
      37              :  * tensor associated with the scalar part of the system and add its contribution
      38              :  * to the \f$\partial_t \Pi_{a b}\f$ variable in the Generalized Harmonic
      39              :  * system, as well as adding any scalar sources to the variable \f$\partial_t
      40              :  * \Pi\f$.
      41              :  *
      42              :  * \warning Backreaction of the scalar field onto the metric is currently
      43              :  * disabled and the system is evolved in the test-field (or decoupling)
      44              :  * approximation.
      45              :  */
      46            1 : struct TimeDerivative {
      47            0 :   static constexpr size_t dim = 3;
      48            0 :   static constexpr bool backreaction_is_enabled = false;
      49            0 :   using gh_dt_tags =
      50              :       db::wrap_tags_in<::Tags::dt,
      51              :                        typename gh::System<dim>::variables_tag::tags_list>;
      52            0 :   using scalar_dt_tags = db::wrap_tags_in<
      53              :       ::Tags::dt,
      54              :       typename CurvedScalarWave::System<dim>::variables_tag::tags_list>;
      55            0 :   using dt_tags = tmpl::append<gh_dt_tags, scalar_dt_tags>;
      56            0 :   using gh_temp_tags = typename gh::TimeDerivative<
      57              :       gh::ScalarTensor::AnalyticData::all_analytic_data, dim>::temporary_tags;
      58            0 :   using gh_gradient_tags = typename gh::System<dim>::gradients_tags;
      59            0 :   using gh_arg_tags = typename gh::TimeDerivative<
      60              :       gh::ScalarTensor::AnalyticData::all_analytic_data, dim>::argument_tags;
      61            0 :   using scalar_temp_tags =
      62              :       typename CurvedScalarWave::TimeDerivative<dim>::temporary_tags;
      63            0 :   using scalar_extra_temp_tags =
      64              :       tmpl::list<ScalarTensor::Tags::TraceReversedStressEnergy<
      65              :           DataVector, dim, ::Frame::Inertial>>;
      66            0 :   using scalar_gradient_tags =
      67              :       typename CurvedScalarWave::System<dim>::gradients_tags;
      68            0 :   using gradient_tags = tmpl::append<gh_gradient_tags, scalar_gradient_tags>;
      69            0 :   using scalar_arg_tags =
      70              :       typename CurvedScalarWave::TimeDerivative<dim>::argument_tags;
      71            0 :   using temporary_tags = tmpl::remove_duplicates<
      72              :       tmpl::append<gh_temp_tags, scalar_temp_tags, scalar_extra_temp_tags>>;
      73            0 :   using argument_tags =
      74              :       tmpl::append<gh_arg_tags, scalar_arg_tags,
      75              :                    tmpl::list<ScalarTensor::Tags::ScalarSource>>;
      76              : 
      77            0 :   static evolution::dg::TimeDerivativeDecisions<3> apply(
      78              :       // GH dt variables
      79              :       gsl::not_null<tnsr::aa<DataVector, dim>*> dt_spacetime_metric,
      80              :       gsl::not_null<tnsr::aa<DataVector, dim>*> dt_pi,
      81              :       gsl::not_null<tnsr::iaa<DataVector, dim>*> dt_phi,
      82              :       // Scalar dt variables
      83              :       gsl::not_null<Scalar<DataVector>*> dt_psi_scalar,
      84              :       gsl::not_null<Scalar<DataVector>*> dt_pi_scalar,
      85              :       gsl::not_null<tnsr::i<DataVector, dim, Frame::Inertial>*> dt_phi_scalar,
      86              : 
      87              :       // GH temporal variables
      88              :       gsl::not_null<Scalar<DataVector>*> temp_gamma1,
      89              :       gsl::not_null<Scalar<DataVector>*> temp_gamma2,
      90              :       gsl::not_null<tnsr::a<DataVector, dim>*> temp_gauge_function,
      91              :       gsl::not_null<tnsr::ab<DataVector, dim>*>
      92              :           temp_spacetime_deriv_gauge_function,
      93              :       gsl::not_null<Scalar<DataVector>*> gamma1gamma2,
      94              :       gsl::not_null<Scalar<DataVector>*> half_half_pi_two_normals,
      95              :       gsl::not_null<Scalar<DataVector>*> normal_dot_gauge_constraint,
      96              :       gsl::not_null<Scalar<DataVector>*> gamma1_plus_1,
      97              :       gsl::not_null<tnsr::a<DataVector, dim>*> pi_one_normal,
      98              :       gsl::not_null<tnsr::a<DataVector, dim>*> gauge_constraint,
      99              :       gsl::not_null<tnsr::i<DataVector, dim>*> half_phi_two_normals,
     100              :       gsl::not_null<tnsr::aa<DataVector, dim>*>
     101              :           shift_dot_three_index_constraint,
     102              :       gsl::not_null<tnsr::aa<DataVector, dim>*>
     103              :           mesh_velocity_dot_three_index_constraint,
     104              :       gsl::not_null<tnsr::ia<DataVector, dim>*> phi_one_normal,
     105              :       gsl::not_null<tnsr::aB<DataVector, dim>*> pi_2_up,
     106              :       gsl::not_null<tnsr::iaa<DataVector, dim>*> three_index_constraint,
     107              :       gsl::not_null<tnsr::Iaa<DataVector, dim>*> phi_1_up,
     108              :       gsl::not_null<tnsr::iaB<DataVector, dim>*> phi_3_up,
     109              :       gsl::not_null<tnsr::abC<DataVector, dim>*> christoffel_first_kind_3_up,
     110              :       gsl::not_null<Scalar<DataVector>*> lapse,
     111              :       gsl::not_null<tnsr::I<DataVector, dim>*> shift,
     112              :       gsl::not_null<tnsr::II<DataVector, dim>*> inverse_spatial_metric,
     113              :       gsl::not_null<Scalar<DataVector>*> det_spatial_metric,
     114              :       gsl::not_null<Scalar<DataVector>*> sqrt_det_spatial_metric,
     115              :       gsl::not_null<tnsr::AA<DataVector, dim>*> inverse_spacetime_metric,
     116              :       gsl::not_null<tnsr::abb<DataVector, dim>*> christoffel_first_kind,
     117              :       gsl::not_null<tnsr::A<DataVector, dim>*> two_gauge_h_up,
     118              :       gsl::not_null<tnsr::A<DataVector, dim>*> normal_spacetime_vector,
     119              : 
     120              :       // Scalar temporal variables
     121              :       gsl::not_null<Scalar<DataVector>*> result_gamma1_scalar,
     122              :       gsl::not_null<Scalar<DataVector>*> result_gamma2_scalar,
     123              : 
     124              :       // Extra temporal tags
     125              :       gsl::not_null<tnsr::aa<DataVector, dim>*> stress_energy,
     126              : 
     127              :       // GH spatial derivatives
     128              :       const tnsr::iaa<DataVector, dim>& d_spacetime_metric,
     129              :       const tnsr::iaa<DataVector, dim>& d_pi,
     130              :       const tnsr::ijaa<DataVector, dim>& d_phi,
     131              : 
     132              :       // scalar spatial derivatives
     133              :       const tnsr::i<DataVector, dim>& d_psi_scalar,
     134              :       const tnsr::i<DataVector, dim>& d_pi_scalar,
     135              :       const tnsr::ij<DataVector, dim>& d_phi_scalar,
     136              : 
     137              :       // GH argument variables
     138              :       const tnsr::aa<DataVector, dim>& spacetime_metric,
     139              :       const tnsr::aa<DataVector, dim>& pi,
     140              :       const tnsr::iaa<DataVector, dim>& phi, const Scalar<DataVector>& gamma0,
     141              :       const Scalar<DataVector>& gamma1, const Scalar<DataVector>& gamma2,
     142              :       const gh::gauges::GaugeCondition& gauge_condition, const Mesh<dim>& mesh,
     143              :       double time,
     144              :       const tnsr::I<DataVector, dim, Frame::Inertial>& inertial_coords,
     145              :       const InverseJacobian<DataVector, dim, Frame::ElementLogical,
     146              :                             Frame::Inertial>& inverse_jacobian,
     147              :       const std::optional<tnsr::I<DataVector, dim, Frame::Inertial>>&
     148              :           mesh_velocity,
     149              : 
     150              :       // Scalar argument variables
     151              :       const Scalar<DataVector>& pi_scalar,
     152              :       const tnsr::i<DataVector, dim>& phi_scalar,
     153              :       const Scalar<DataVector>& lapse_scalar,
     154              :       const tnsr::I<DataVector, dim>& shift_scalar,
     155              :       const tnsr::i<DataVector, dim>& deriv_lapse,
     156              :       const tnsr::iJ<DataVector, dim>& deriv_shift,
     157              :       const tnsr::II<DataVector, dim>& upper_spatial_metric,
     158              :       const tnsr::I<DataVector, dim>& trace_spatial_christoffel,
     159              :       const Scalar<DataVector>& trace_extrinsic_curvature,
     160              :       const Scalar<DataVector>& gamma1_scalar,
     161              :       const Scalar<DataVector>& gamma2_scalar,
     162              : 
     163              :       const Scalar<DataVector>& scalar_source);
     164              : };
     165              : }  // namespace ScalarTensor
        

Generated by: LCOV version 2.0-1