SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/GeneralRelativity - DerivativesOfSpacetimeMetric.hpp Hit Total Coverage
Commit: aabde07399ba7837e5db64eedfd0a21f31f96922 Lines: 3 8 37.5 %
Date: 2024-04-26 02:38:13
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 <cmath>
       7             : #include <cstddef>
       8             : #include <cstdint>
       9             : #include <utility>
      10             : 
      11             : #include "DataStructures/DataBox/Prefixes.hpp"
      12             : #include "DataStructures/DataBox/Tag.hpp"
      13             : #include "DataStructures/Tensor/Tensor.hpp"
      14             : #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp"
      15             : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
      16             : #include "Utilities/ContainerHelpers.hpp"
      17             : #include "Utilities/Gsl.hpp"
      18             : #include "Utilities/TMPL.hpp"
      19             : #include "Utilities/TaggedTuple.hpp"
      20             : 
      21             : /// \ingroup GeneralRelativityGroup
      22             : /// Holds functions related to general relativity.
      23             : namespace gr {
      24             : /// @{
      25             : /*!
      26             :  * \ingroup GeneralRelativityGroup
      27             :  * \brief Computes spacetime derivative of spacetime metric from spatial metric,
      28             :  * lapse, shift, and their space and time derivatives.
      29             :  *
      30             :  * \details Computes the derivatives as:
      31             :  * \f{align}
      32             :  *     \partial_\mu g_{tt} &= - 2 \alpha \partial_\mu \alpha
      33             :  *                 + 2 \gamma_{mn} \beta^m \partial_\mu \beta^n
      34             :  *                 + \beta^m \beta^n \partial_\mu \gamma_{mn} \\
      35             :  *     \partial_\mu g_{ti} &= \gamma_{mi} \partial_\mu \beta^m
      36             :  *                 + \beta^m \partial_\mu \gamma_{mi} \\
      37             :  *     \partial_\mu g_{ij} &= \partial_\mu \gamma_{ij}
      38             :  * \f}
      39             :  * where \f$ \alpha, \beta^i, \gamma_{ij} \f$ are the lapse, shift, and spatial
      40             :  * metric respectively.
      41             :  */
      42             : template <typename DataType, size_t SpatialDim, typename Frame>
      43           1 : void derivatives_of_spacetime_metric(
      44             :     gsl::not_null<tnsr::abb<DataType, SpatialDim, Frame>*>
      45             :         spacetime_deriv_spacetime_metric,
      46             :     const Scalar<DataType>& lapse, const Scalar<DataType>& dt_lapse,
      47             :     const tnsr::i<DataType, SpatialDim, Frame>& deriv_lapse,
      48             :     const tnsr::I<DataType, SpatialDim, Frame>& shift,
      49             :     const tnsr::I<DataType, SpatialDim, Frame>& dt_shift,
      50             :     const tnsr::iJ<DataType, SpatialDim, Frame>& deriv_shift,
      51             :     const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
      52             :     const tnsr::ii<DataType, SpatialDim, Frame>& dt_spatial_metric,
      53             :     const tnsr::ijj<DataType, SpatialDim, Frame>& deriv_spatial_metric);
      54             : 
      55             : template <typename DataType, size_t SpatialDim, typename Frame>
      56           1 : tnsr::abb<DataType, SpatialDim, Frame> derivatives_of_spacetime_metric(
      57             :     const Scalar<DataType>& lapse, const Scalar<DataType>& dt_lapse,
      58             :     const tnsr::i<DataType, SpatialDim, Frame>& deriv_lapse,
      59             :     const tnsr::I<DataType, SpatialDim, Frame>& shift,
      60             :     const tnsr::I<DataType, SpatialDim, Frame>& dt_shift,
      61             :     const tnsr::iJ<DataType, SpatialDim, Frame>& deriv_shift,
      62             :     const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
      63             :     const tnsr::ii<DataType, SpatialDim, Frame>& dt_spatial_metric,
      64             :     const tnsr::ijj<DataType, SpatialDim, Frame>& deriv_spatial_metric);
      65             : /// @}
      66             : 
      67             : namespace Tags {
      68             : /*!
      69             :  * \brief Compute item to get spacetime derivative of spacetime metric from
      70             :  * spatial metric, lapse, shift, and their space and time derivatives.
      71             :  *
      72             :  * \details See `derivatives_of_spacetime_metric()`. Can be retrieved using
      73             :  * `gr::Tags::DerivativesOfSpacetimeMetric`.
      74             :  */
      75             : template <size_t SpatialDim, typename Frame>
      76           1 : struct DerivativesOfSpacetimeMetricCompute
      77             :     : gr::Tags::DerivativesOfSpacetimeMetric<DataVector, SpatialDim, Frame>,
      78             :       db::ComputeTag {
      79           0 :   using argument_tags = tmpl::list<
      80             :       gr::Tags::Lapse<DataVector>, ::Tags::dt<gr::Tags::Lapse<DataVector>>,
      81             :       ::Tags::deriv<gr::Tags::Lapse<DataVector>, tmpl::size_t<SpatialDim>,
      82             :                     Frame>,
      83             :       gr::Tags::Shift<DataVector, SpatialDim, Frame>,
      84             :       ::Tags::dt<gr::Tags::Shift<DataVector, SpatialDim, Frame>>,
      85             :       ::Tags::deriv<gr::Tags::Shift<DataVector, SpatialDim, Frame>,
      86             :                     tmpl::size_t<SpatialDim>, Frame>,
      87             :       gr::Tags::SpatialMetric<DataVector, SpatialDim, Frame>,
      88             :       ::Tags::dt<gr::Tags::SpatialMetric<DataVector, SpatialDim, Frame>>,
      89             :       ::Tags::deriv<gr::Tags::SpatialMetric<DataVector, SpatialDim, Frame>,
      90             :                     tmpl::size_t<SpatialDim>, Frame>>;
      91             : 
      92           0 :   using return_type = tnsr::abb<DataVector, SpatialDim, Frame>;
      93             : 
      94           0 :   static constexpr auto function = static_cast<void (*)(
      95             :       gsl::not_null<tnsr::abb<DataVector, SpatialDim, Frame>*>
      96             :           spacetime_deriv_spacetime_metric,
      97             :       const Scalar<DataVector>&, const Scalar<DataVector>&,
      98             :       const tnsr::i<DataVector, SpatialDim, Frame>&,
      99             :       const tnsr::I<DataVector, SpatialDim, Frame>&,
     100             :       const tnsr::I<DataVector, SpatialDim, Frame>&,
     101             :       const tnsr::iJ<DataVector, SpatialDim, Frame>&,
     102             :       const tnsr::ii<DataVector, SpatialDim, Frame>&,
     103             :       const tnsr::ii<DataVector, SpatialDim, Frame>&,
     104             :       const tnsr::ijj<DataVector, SpatialDim, Frame>&)>(
     105             :       &gr::derivatives_of_spacetime_metric<DataVector, SpatialDim, Frame>);
     106             : 
     107           0 :   using base =
     108             :       gr::Tags::DerivativesOfSpacetimeMetric<DataVector, SpatialDim, Frame>;
     109             : };
     110             : }  // namespace Tags
     111             : }  // namespace gr

Generated by: LCOV version 1.14