SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic - DerivSpatialMetric.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 37.5 % 8 3
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/Prefixes.hpp"
       9              : #include "DataStructures/DataBox/Tag.hpp"
      10              : #include "DataStructures/DataVector.hpp"
      11              : #include "DataStructures/Tensor/TypeAliases.hpp"
      12              : #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp"
      13              : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
      14              : #include "Utilities/Gsl.hpp"
      15              : #include "Utilities/TMPL.hpp"
      16              : 
      17              : /// \cond
      18              : class DataVector;
      19              : /// \endcond
      20              : 
      21              : namespace gh {
      22              : /// @{
      23              : /*!
      24              :  * \ingroup GeneralRelativityGroup
      25              :  * \brief Computes spatial derivatives of the spatial metric from
      26              :  *        the generalized harmonic spatial derivative variable.
      27              :  *
      28              :  * \details If \f$ \Phi_{kab} \f$ is the generalized
      29              :  * harmonic spatial derivative variable, then the derivatives of the
      30              :  * spatial metric are
      31              :  * \f[
      32              :  *      \partial_k \gamma_{ij} = \Phi_{kij}
      33              :  * \f]
      34              :  *
      35              :  * This quantity is needed for computing spatial Christoffel symbols.
      36              :  */
      37              : template <typename DataType, size_t SpatialDim, typename Frame>
      38            1 : void deriv_spatial_metric(
      39              :     gsl::not_null<tnsr::ijj<DataType, SpatialDim, Frame>*> d_spatial_metric,
      40              :     const tnsr::iaa<DataType, SpatialDim, Frame>& phi);
      41              : 
      42              : template <typename DataType, size_t SpatialDim, typename Frame>
      43            1 : tnsr::ijj<DataType, SpatialDim, Frame> deriv_spatial_metric(
      44              :     const tnsr::iaa<DataType, SpatialDim, Frame>& phi);
      45              : /// @}
      46              : 
      47              : namespace Tags {
      48              : /*!
      49              :  * \brief Compute item to get spatial derivatives of the spatial metric from
      50              :  *        the generalized harmonic spatial derivative variable.
      51              :  *
      52              :  * \details See `deriv_spatial_metric()`. Can be retrieved using
      53              :  * `gr::Tags::SpatialMetric` wrapped in `::Tags::deriv`.
      54              :  */
      55              : template <size_t SpatialDim, typename Frame>
      56            1 : struct DerivSpatialMetricCompute
      57              :     : ::Tags::deriv<gr::Tags::SpatialMetric<DataVector, SpatialDim, Frame>,
      58              :                     tmpl::size_t<SpatialDim>, Frame>,
      59              :       db::ComputeTag {
      60            0 :   using argument_tags = tmpl::list<Phi<DataVector, SpatialDim, Frame>>;
      61              : 
      62            0 :   using return_type = tnsr::ijj<DataVector, SpatialDim, Frame>;
      63              : 
      64            0 :   static constexpr auto function = static_cast<void (*)(
      65              :       gsl::not_null<tnsr::ijj<DataVector, SpatialDim, Frame>*>,
      66              :       const tnsr::iaa<DataVector, SpatialDim, Frame>&)>(
      67              :       &deriv_spatial_metric<DataVector, SpatialDim, Frame>);
      68              : 
      69            0 :   using base =
      70              :       ::Tags::deriv<gr::Tags::SpatialMetric<DataVector, SpatialDim, Frame>,
      71              :                     tmpl::size_t<SpatialDim>, Frame>;
      72              : };
      73              : }  // namespace Tags
      74              : }  // namespace gh
        

Generated by: LCOV version 2.0-1