SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/GeneralRelativity - WeylElectric.hpp Hit Total Coverage
Commit: 9a905b0737f373631c1b8e8389b8f26e67fa5313 Lines: 6 15 40.0 %
Date: 2024-03-28 09:03:18
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/Tag.hpp"
       9             : #include "DataStructures/Tensor/TypeAliases.hpp"
      10             : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
      11             : 
      12             : /// \cond
      13             : namespace gsl {
      14             : template <typename>
      15             : struct not_null;
      16             : }  // namespace gsl
      17             : /// \endcond
      18             : 
      19             : namespace gr {
      20             : 
      21             : /// @{
      22             : /*!
      23             :  * \ingroup GeneralRelativityGroup
      24             :  * \brief Computes the electric part of the Weyl tensor in vacuum.
      25             :  *
      26             :  * \details Computes the electric part of the Weyl tensor in vacuum \f$E_{ij}\f$
      27             :  * as: \f$ E_{ij} = R_{ij} + KK_{ij} - K^m_{i}K_{mj}\f$ where \f$R_{ij}\f$ is
      28             :  * the spatial Ricci tensor, \f$K_{ij}\f$ is the extrinsic curvature, and
      29             :  * \f$K\f$ is the trace of \f$K_{ij}\f$. An additional definition is \f$E_{ij} =
      30             :  * n^a n^b C_{a i b j}\f$, where \f$n\f$ is the unit-normal to the hypersurface
      31             :  * and \f$C\f$ is the Weyl tensor consistent with the conventions
      32             :  * in \cite Boyle2019kee.
      33             :  * \note This needs additional terms for computations in a non-vacuum.
      34             :  */
      35             : template <typename DataType, size_t SpatialDim, typename Frame>
      36           1 : tnsr::ii<DataType, SpatialDim, Frame> weyl_electric(
      37             :     const tnsr::ii<DataType, SpatialDim, Frame>& spatial_ricci,
      38             :     const tnsr::ii<DataType, SpatialDim, Frame>& extrinsic_curvature,
      39             :     const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric);
      40             : 
      41             : template <typename DataType, size_t SpatialDim, typename Frame>
      42           1 : void weyl_electric(
      43             :     gsl::not_null<tnsr::ii<DataType, SpatialDim, Frame>*> weyl_electric_part,
      44             :     const tnsr::ii<DataType, SpatialDim, Frame>& spatial_ricci,
      45             :     const tnsr::ii<DataType, SpatialDim, Frame>& extrinsic_curvature,
      46             :     const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric);
      47             : /// @}
      48             : 
      49             : /// @{
      50             : /*!
      51             :  * \ingroup GeneralRelativityGroup
      52             :  * \brief Computes the scalar \f$E_{ij} E^{ij}\f$ from the electric
      53             :  * part of the Weyl tensor \f$E_{ij}\f$.
      54             :  *
      55             :  * \details Computes the scalar \f$E_{ij} E^{ij}\f$ from the electric part
      56             :  * of the Weyl tensor \f$E_{ij}\f$ and the inverse spatial metric
      57             :  * \f$\gamma^{ij}\f$, i.e. \f$E_{ij} = \gamma^{ik}\gamma^{jl}E_{ij}E_{kl}\f$.
      58             :  *
      59             :  * \note The electric part of the Weyl tensor in vacuum is available via
      60             :  * gr::weyl_electric(). The electric part of the Weyl tensor needs additional
      61             :  * terms for matter.
      62             :  */
      63             : template <typename DataType, size_t SpatialDim, typename Frame>
      64           1 : Scalar<DataType> weyl_electric_scalar(
      65             :     const tnsr::ii<DataType, SpatialDim, Frame>& weyl_electric,
      66             :     const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric);
      67             : 
      68             : template <typename DataType, size_t SpatialDim, typename Frame>
      69           1 : void weyl_electric_scalar(
      70             :     gsl::not_null<Scalar<DataType>*> weyl_electric_scalar_result,
      71             :     const tnsr::ii<DataType, SpatialDim, Frame>& weyl_electric,
      72             :     const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric);
      73             : /// @}
      74             : 
      75             : namespace Tags {
      76             : /// Compute item for the electric part of the weyl tensor in vacuum
      77             : /// Computed from the SpatialRicci, ExtrinsicCurvature, and InverseSpatialMetric
      78             : ///
      79             : /// Can be retrieved using gr::Tags::WeylElectric
      80             : template <typename DataType, size_t SpatialDim, typename Frame>
      81           1 : struct WeylElectricCompute : WeylElectric<DataType, SpatialDim, Frame>,
      82             :                              db::ComputeTag {
      83           0 :   using argument_tags =
      84             :       tmpl::list<gr::Tags::SpatialRicci<DataType, SpatialDim, Frame>,
      85             :                  gr::Tags::ExtrinsicCurvature<DataType, SpatialDim, Frame>,
      86             :                  gr::Tags::InverseSpatialMetric<DataType, SpatialDim, Frame>>;
      87             : 
      88           0 :   using return_type = tnsr::ii<DataType, SpatialDim, Frame>;
      89             : 
      90           0 :   static constexpr auto function = static_cast<void (*)(
      91             :       gsl::not_null<tnsr::ii<DataType, SpatialDim, Frame>*>,
      92             :       const tnsr::ii<DataType, SpatialDim, Frame>&,
      93             :       const tnsr::ii<DataType, SpatialDim, Frame>&,
      94             :       const tnsr::II<DataType, SpatialDim, Frame>&)>(
      95             :       &weyl_electric<DataType, SpatialDim, Frame>);
      96             : 
      97           0 :   using base = WeylElectric<DataType, SpatialDim, Frame>;
      98             : };
      99             : 
     100             : /// Can be retrieved using gr::Tags::WeylElectricScalar
     101             : template <typename DataType, size_t SpatialDim, typename Frame>
     102           1 : struct WeylElectricScalarCompute : WeylElectricScalar<DataType>,
     103             :                                    db::ComputeTag {
     104           0 :   using argument_tags =
     105             :       tmpl::list<gr::Tags::WeylElectricCompute<DataType, SpatialDim, Frame>,
     106             :                  gr::Tags::InverseSpatialMetric<DataType, SpatialDim, Frame>>;
     107             : 
     108           0 :   using return_type = Scalar<DataType>;
     109             : 
     110           0 :   static constexpr auto function =
     111             :       static_cast<void (*)(gsl::not_null<Scalar<DataType>*>,
     112             :                            const tnsr::ii<DataType, SpatialDim, Frame>&,
     113             :                            const tnsr::II<DataType, SpatialDim, Frame>&)>(
     114             :           &gr::weyl_electric_scalar<DataType, SpatialDim, Frame>);
     115             : 
     116           0 :   using base = WeylElectricScalar<DataType>;
     117             : };
     118             : }  // namespace Tags
     119             : }  // namespace gr

Generated by: LCOV version 1.14