SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/GeneralRelativity/Surfaces - ComputeItems.hpp Hit Total Coverage
Commit: 965048f86d23c819715b3af1ca3f880c8145d4bb Lines: 2 17 11.8 %
Date: 2024-05-16 17:00:40
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             : /// \cond
       9             : class DataVector;
      10             : /// \endcond
      11             : 
      12             : #include "DataStructures/DataBox/Tag.hpp"
      13             : #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp"
      14             : #include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp"
      15             : #include "DataStructures/Tensor/TypeAliases.hpp"
      16             : #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp"
      17             : #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp"
      18             : #include "PointwiseFunctions/GeneralRelativity/ExtrinsicCurvature.hpp"
      19             : #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/DerivSpatialMetric.hpp"
      20             : #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ExtrinsicCurvature.hpp"
      21             : #include "PointwiseFunctions/GeneralRelativity/Lapse.hpp"
      22             : #include "PointwiseFunctions/GeneralRelativity/Shift.hpp"
      23             : #include "PointwiseFunctions/GeneralRelativity/SpacetimeNormalVector.hpp"
      24             : #include "PointwiseFunctions/GeneralRelativity/SpatialMetric.hpp"
      25             : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
      26             : #include "Utilities/Gsl.hpp"
      27             : #include "Utilities/SetNumberOfGridPoints.hpp"
      28             : #include "Utilities/TMPL.hpp"
      29             : 
      30           1 : namespace gr::surfaces::Tags {
      31             : /// @{
      32             : /// These ComputeItems are different from those used in
      33             : /// GeneralizedHarmonic evolution because these live only on the
      34             : /// intrp::Actions::ApparentHorizon DataBox, not in the volume
      35             : /// DataBox.  And these ComputeItems can do fewer allocations than the
      36             : /// volume ones, because (for example) Lapse, SpaceTimeNormalVector,
      37             : /// etc.  can be inlined instead of being allocated as a separate
      38             : /// ComputeItem.
      39             : template <size_t Dim, typename Frame>
      40           1 : struct InverseSpatialMetricCompute
      41             :     : gr::Tags::InverseSpatialMetric<DataVector, Dim, Frame>,
      42             :       db::ComputeTag {
      43           0 :   using return_type = tnsr::II<DataVector, Dim, Frame>;
      44           0 :   static void function(
      45             :       const gsl::not_null<tnsr::II<DataVector, Dim, Frame>*> result,
      46             :       const tnsr::aa<DataVector, Dim, Frame>& psi) {
      47             :     *result = determinant_and_inverse(gr::spatial_metric(psi)).second;
      48             :   };
      49           0 :   using argument_tags =
      50             :       tmpl::list<gr::Tags::SpacetimeMetric<DataVector, Dim, Frame>>;
      51           0 :   using base = gr::Tags::InverseSpatialMetric<DataVector, Dim, Frame>;
      52             : };
      53             : template <size_t Dim, typename Frame>
      54           0 : struct ExtrinsicCurvatureCompute
      55             :     : gr::Tags::ExtrinsicCurvature<DataVector, Dim, Frame>,
      56             :       db::ComputeTag {
      57           0 :   using return_type = tnsr::ii<DataVector, Dim, Frame>;
      58           0 :   static void function(
      59             :       const gsl::not_null<tnsr::ii<DataVector, Dim, Frame>*> result,
      60             :       const tnsr::aa<DataVector, Dim, Frame>& psi,
      61             :       const tnsr::aa<DataVector, Dim, Frame>& pi,
      62             :       const tnsr::iaa<DataVector, Dim, Frame>& phi,
      63             :       const tnsr::II<DataVector, Dim, Frame>& inv_g) {
      64             :     const auto shift = gr::shift(psi, inv_g);
      65             :     set_number_of_grid_points(result, psi);
      66             :     gh::extrinsic_curvature(
      67             :         result, gr::spacetime_normal_vector(gr::lapse(shift, psi), shift), pi,
      68             :         phi);
      69             :   }
      70           0 :   using argument_tags =
      71             :       tmpl::list<gr::Tags::SpacetimeMetric<DataVector, Dim, Frame>,
      72             :                  gh::Tags::Pi<DataVector, Dim, Frame>,
      73             :                  gh::Tags::Phi<DataVector, Dim, Frame>,
      74             :                  gr::Tags::InverseSpatialMetric<DataVector, Dim, Frame>>;
      75           0 :   using base = gr::Tags::ExtrinsicCurvature<DataVector, Dim, Frame>;
      76             : };
      77             : template <size_t Dim, typename Frame>
      78           0 : struct SpatialChristoffelSecondKindCompute
      79             :     : ::gr::Tags::SpatialChristoffelSecondKind<DataVector, Dim, Frame>,
      80             :       db::ComputeTag {
      81           0 :   using return_type = tnsr::Ijj<DataVector, Dim, Frame>;
      82           0 :   static void function(
      83             :       const gsl::not_null<tnsr::Ijj<DataVector, Dim, Frame>*> result,
      84             :       const tnsr::iaa<DataVector, Dim, Frame>& phi,
      85             :       const tnsr::II<DataVector, Dim, Frame>& inv_g) {
      86             :     set_number_of_grid_points(result, phi);
      87             :     raise_or_lower_first_index(
      88             :         result, gr::christoffel_first_kind(gh::deriv_spatial_metric(phi)),
      89             :         inv_g);
      90             :   }
      91           0 :   using argument_tags =
      92             :       tmpl::list<gh::Tags::Phi<DataVector, Dim, Frame>,
      93             :                  gr::Tags::InverseSpatialMetric<DataVector, Dim, Frame>>;
      94           0 :   using base = ::gr::Tags::SpatialChristoffelSecondKind<DataVector, Dim, Frame>;
      95             : };
      96             : /// @}
      97             : }  // namespace gr::surfaces::Tags

Generated by: LCOV version 1.14