SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic - Phi.hpp Hit Total Coverage
Commit: a6a8ee404306bec9d92da8ab89f636b037aefc25 Lines: 3 8 37.5 %
Date: 2024-07-26 22:35:59
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/Tensor.hpp"
      12             : #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp"
      13             : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
      14             : #include "Utilities/ContainerHelpers.hpp"
      15             : #include "Utilities/Gsl.hpp"
      16             : #include "Utilities/TMPL.hpp"
      17             : 
      18             : /// \cond
      19             : namespace domain {
      20             : namespace Tags {
      21             : template <size_t Dim, typename Frame>
      22             : struct Coordinates;
      23             : }  // namespace Tags
      24             : }  // namespace domain
      25             : class DataVector;
      26             : template <typename X, typename Symm, typename IndexList>
      27             : class Tensor;
      28             : /// \endcond
      29             : 
      30             : namespace gh {
      31             : /// @{
      32             : /*!
      33             :  * \ingroup GeneralRelativityGroup
      34             :  * \brief Computes the auxiliary variable \f$\Phi_{iab}\f$ used by the
      35             :  * generalized harmonic formulation of Einstein's equations.
      36             :  *
      37             :  * \details If \f$ \alpha, \beta^i\f$ and \f$ \gamma_{ij} \f$ are the lapse,
      38             :  * shift and spatial metric respectively, then \f$\Phi_{iab} \f$ is computed as
      39             :  *
      40             :  * \f{align}
      41             :  *     \Phi_{ktt} &= - 2 \alpha \partial_k \alpha
      42             :  *                 + 2 \gamma_{mn} \beta^m \partial_k \beta^n
      43             :  *                 + \beta^m \beta^n \partial_k \gamma_{mn} \\
      44             :  *     \Phi_{kti} &= \gamma_{mi} \partial_k \beta^m
      45             :  *                 + \beta^m \partial_k \gamma_{mi} \\
      46             :  *     \Phi_{kij} &= \partial_k \gamma_{ij}
      47             :  * \f}
      48             :  */
      49             : template <typename DataType, size_t SpatialDim, typename Frame>
      50           1 : void phi(gsl::not_null<tnsr::iaa<DataType, SpatialDim, Frame>*> phi,
      51             :          const Scalar<DataType>& lapse,
      52             :          const tnsr::i<DataType, SpatialDim, Frame>& deriv_lapse,
      53             :          const tnsr::I<DataType, SpatialDim, Frame>& shift,
      54             :          const tnsr::iJ<DataType, SpatialDim, Frame>& deriv_shift,
      55             :          const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
      56             :          const tnsr::ijj<DataType, SpatialDim, Frame>& deriv_spatial_metric);
      57             : 
      58             : template <typename DataType, size_t SpatialDim, typename Frame>
      59           1 : tnsr::iaa<DataType, SpatialDim, Frame> phi(
      60             :     const Scalar<DataType>& lapse,
      61             :     const tnsr::i<DataType, SpatialDim, Frame>& deriv_lapse,
      62             :     const tnsr::I<DataType, SpatialDim, Frame>& shift,
      63             :     const tnsr::iJ<DataType, SpatialDim, Frame>& deriv_shift,
      64             :     const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
      65             :     const tnsr::ijj<DataType, SpatialDim, Frame>& deriv_spatial_metric);
      66             : /// @}
      67             : 
      68             : namespace Tags {
      69             : /*!
      70             :  * \brief Compute item for the auxiliary variable \f$\Phi_{iab}\f$ used by the
      71             :  * generalized harmonic formulation of Einstein's equations.
      72             :  *
      73             :  * \details See `phi()`. Can be retrieved using
      74             :  * `gh::Tags::Phi`.
      75             :  */
      76             : template <size_t SpatialDim, typename Frame>
      77           1 : struct PhiCompute : Phi<DataVector, SpatialDim, Frame>, db::ComputeTag {
      78           0 :   using argument_tags = tmpl::list<
      79             :       gr::Tags::Lapse<DataVector>,
      80             :       ::Tags::deriv<gr::Tags::Lapse<DataVector>, tmpl::size_t<SpatialDim>,
      81             :                     Frame>,
      82             :       gr::Tags::Shift<DataVector, SpatialDim, Frame>,
      83             :       ::Tags::deriv<gr::Tags::Shift<DataVector, SpatialDim, Frame>,
      84             :                     tmpl::size_t<SpatialDim>, Frame>,
      85             :       gr::Tags::SpatialMetric<DataVector, SpatialDim, Frame>,
      86             :       ::Tags::deriv<gr::Tags::SpatialMetric<DataVector, SpatialDim, Frame>,
      87             :                     tmpl::size_t<SpatialDim>, Frame>>;
      88             : 
      89           0 :   using return_type = tnsr::iaa<DataVector, SpatialDim, Frame>;
      90             : 
      91           0 :   static constexpr auto function = static_cast<void (*)(
      92             :       gsl::not_null<tnsr::iaa<DataVector, SpatialDim, Frame>*>,
      93             :       const Scalar<DataVector>&, const tnsr::i<DataVector, SpatialDim, Frame>&,
      94             :       const tnsr::I<DataVector, SpatialDim, Frame>&,
      95             :       const tnsr::iJ<DataVector, SpatialDim, Frame>&,
      96             :       const tnsr::ii<DataVector, SpatialDim, Frame>&,
      97             :       const tnsr::ijj<DataVector, SpatialDim, Frame>&)>(
      98             :       &phi<DataVector, SpatialDim, Frame>);
      99             : 
     100           0 :   using base = Phi<DataVector, SpatialDim, Frame>;
     101             : };
     102             : }  // namespace Tags
     103             : }  // namespace gh

Generated by: LCOV version 1.14