SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic - TimeDerivOfSpatialMetric.hpp Hit Total Coverage
Commit: f23e75c235cae5144b8ac7ce01280be5b8cd2c8a Lines: 3 8 37.5 %
Date: 2024-09-07 06:21:00
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/Prefixes.hpp"
       9             : #include "DataStructures/DataBox/Tag.hpp"
      10             : #include "DataStructures/Tensor/TypeAliases.hpp"
      11             : #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp"
      12             : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
      13             : #include "Utilities/Gsl.hpp"
      14             : #include "Utilities/TMPL.hpp"
      15             : 
      16             : /// \cond
      17             : class DataVector;
      18             : /// \endcond
      19             : 
      20             : namespace gh {
      21             : /// @{
      22             : /*!
      23             :  * \ingroup GeneralRelativityGroup
      24             :  * \brief Computes time derivative of the spatial metric.
      25             :  *
      26             :  * \details Let the generalized harmonic conjugate momentum and spatial
      27             :  * derivative variables be \f$\Pi_{ab} = -n^c \partial_c g_{ab} \f$ and
      28             :  * \f$\Phi_{iab} = \partial_i g_{ab} \f$. As \f$ n_i \equiv 0 \f$. The time
      29             :  * derivative of the spatial metric is given by the time derivative of the
      30             :  * spatial sector of the spacetime metric, i.e.
      31             :  * \f$ \partial_0 \gamma_{ij} = \partial_0 g_{ij} \f$.
      32             :  *
      33             :  * To compute the latter, we use the evolution equation for \f$ g_{ij} \f$,
      34             :  * c.f. eq.(35) of \cite Lindblom2005qh (with \f$\gamma_1 = -1\f$):
      35             :  *
      36             :  * \f[
      37             :  * \partial_0 g_{ab} = - \alpha \Pi_{ab} + \beta^k \Phi_{kab}
      38             :  * \f]
      39             :  */
      40             : template <typename DataType, size_t SpatialDim, typename Frame>
      41           1 : void time_deriv_of_spatial_metric(
      42             :     gsl::not_null<tnsr::ii<DataType, SpatialDim, Frame>*> dt_spatial_metric,
      43             :     const Scalar<DataType>& lapse,
      44             :     const tnsr::I<DataType, SpatialDim, Frame>& shift,
      45             :     const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
      46             :     const tnsr::aa<DataType, SpatialDim, Frame>& pi);
      47             : 
      48             : template <typename DataType, size_t SpatialDim, typename Frame>
      49           1 : tnsr::ii<DataType, SpatialDim, Frame> time_deriv_of_spatial_metric(
      50             :     const Scalar<DataType>& lapse,
      51             :     const tnsr::I<DataType, SpatialDim, Frame>& shift,
      52             :     const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
      53             :     const tnsr::aa<DataType, SpatialDim, Frame>& pi);
      54             : /// @}
      55             : 
      56             : namespace Tags {
      57             : /*!
      58             :  * \brief Compute item to get time derivative of the spatial metric from
      59             :  *        generalized harmonic and geometric variables
      60             :  *
      61             :  * \details See `time_deriv_of_spatial_metric()`. Can be retrieved using
      62             :  * `gr::Tags::SpatialMetric` wrapped in `Tags::dt`.
      63             :  */
      64             : template <size_t SpatialDim, typename Frame>
      65           1 : struct TimeDerivSpatialMetricCompute
      66             :     : ::Tags::dt<gr::Tags::SpatialMetric<DataVector, SpatialDim, Frame>>,
      67             :       db::ComputeTag {
      68           0 :   using argument_tags =
      69             :       tmpl::list<gr::Tags::Lapse<DataVector>,
      70             :                  gr::Tags::Shift<DataVector, SpatialDim, Frame>,
      71             :                  Phi<DataVector, SpatialDim, Frame>,
      72             :                  Pi<DataVector, SpatialDim, Frame>>;
      73             : 
      74           0 :   using return_type = tnsr::ii<DataVector, SpatialDim, Frame>;
      75             : 
      76           0 :   static constexpr auto function = static_cast<void (*)(
      77             :       gsl::not_null<tnsr::ii<DataVector, SpatialDim, Frame>*>,
      78             :       const Scalar<DataVector>&, const tnsr::I<DataVector, SpatialDim, Frame>&,
      79             :       const tnsr::iaa<DataVector, SpatialDim, Frame>&,
      80             :       const tnsr::aa<DataVector, SpatialDim, Frame>&)>(
      81             :       &time_deriv_of_spatial_metric<DataVector, SpatialDim, Frame>);
      82             : 
      83           0 :   using base =
      84             :       ::Tags::dt<gr::Tags::SpatialMetric<DataVector, SpatialDim, Frame>>;
      85             : };
      86             : }  // namespace Tags
      87             : }  // namespace gh

Generated by: LCOV version 1.14