SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/GeneralRelativity - Shift.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/EagerMath/DeterminantAndInverse.hpp"
      14             : #include "DataStructures/Tensor/Tensor.hpp"
      15             : #include "DataStructures/VariablesTag.hpp"
      16             : #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp"
      17             : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
      18             : #include "Utilities/ContainerHelpers.hpp"
      19             : #include "Utilities/Gsl.hpp"
      20             : #include "Utilities/TMPL.hpp"
      21             : #include "Utilities/TaggedTuple.hpp"
      22             : 
      23             : /// \ingroup GeneralRelativityGroup
      24             : /// Holds functions related to general relativity.
      25             : namespace gr {
      26             : /// @{
      27             : /*!
      28             :  * \ingroup GeneralRelativityGroup
      29             :  * \brief Compute shift from spacetime metric and inverse spatial metric.
      30             :  *
      31             :  * \details Computes
      32             :  * \f{align}
      33             :  *    \beta^i &= \gamma^{ij} g_{jt}
      34             :  * \f}
      35             :  * where \f$ \beta^i\f$, \f$ \gamma^{ij}\f$, and \f$g_{ab}\f$ are the shift,
      36             :  * inverse spatial metric, and spacetime metric.
      37             :  * This can be derived, e.g., from Eqs. 2.121--2.122 of Baumgarte & Shapiro.
      38             :  */
      39             : template <typename DataType, size_t SpatialDim, typename Frame>
      40           1 : tnsr::I<DataType, SpatialDim, Frame> shift(
      41             :     const tnsr::aa<DataType, SpatialDim, Frame>& spacetime_metric,
      42             :     const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric);
      43             : 
      44             : template <typename DataType, size_t SpatialDim, typename Frame>
      45           1 : void shift(gsl::not_null<tnsr::I<DataType, SpatialDim, Frame>*> shift,
      46             :            const tnsr::aa<DataType, SpatialDim, Frame>& spacetime_metric,
      47             :            const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric);
      48             : /// @}
      49             : 
      50             : namespace Tags {
      51             : /*!
      52             :  * \brief Compute item for shift \f$\beta^i\f$ from the spacetime metric
      53             :  * \f$g_{ab}\f$ and the inverse spatial metric \f$\gamma^{ij}\f$.
      54             :  *
      55             :  * \details Can be retrieved using `gr::Tags::Shift`.
      56             :  */
      57             : template <typename DataType, size_t SpatialDim, typename Frame>
      58           1 : struct ShiftCompute : Shift<DataType, SpatialDim, Frame>, db::ComputeTag {
      59           0 :   using argument_tags =
      60             :       tmpl::list<SpacetimeMetric<DataType, SpatialDim, Frame>,
      61             :                  InverseSpatialMetric<DataType, SpatialDim, Frame>>;
      62             : 
      63           0 :   using return_type = tnsr::I<DataType, SpatialDim, Frame>;
      64             : 
      65           0 :   static constexpr auto function = static_cast<void (*)(
      66             :       const gsl::not_null<tnsr::I<DataType, SpatialDim, Frame>*> shift,
      67             :       const tnsr::aa<DataType, SpatialDim, Frame>&,
      68             :       const tnsr::II<DataType, SpatialDim, Frame>&)>(
      69             :       &shift<DataType, SpatialDim, Frame>);
      70             : 
      71           0 :   using base = Shift<DataType, SpatialDim, Frame>;
      72             : };
      73             : }  // namespace Tags
      74             : }  // namespace gr

Generated by: LCOV version 1.14