SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/AnalyticSolutions/GeneralRelativity - WrappedGr.cpp Hit Total Coverage
Commit: 2db722c93a8e9b106e406b439b79c8e05c2057fb Lines: 0 1 0.0 %
Date: 2021-03-03 22:01:00
Legend: Lines: hit not hit

          Line data    Source code
       1           0 : // Distributed under the MIT License.
       2             : // See LICENSE.txt for details.
       3             : 
       4             : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/WrappedGr.hpp"
       5             : 
       6             : #include "DataStructures/DataBox/Prefixes.hpp"  // IWYU pragma: keep
       7             : #include "DataStructures/DataVector.hpp"        // IWYU pragma: keep
       8             : #include "DataStructures/Tensor/Tensor.hpp"     // IWYU pragma: keep
       9             : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/GaugeWave.hpp"
      10             : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/KerrSchild.hpp"  // IWYU pragma: keep
      11             : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/Minkowski.hpp"  // IWYU pragma: keep
      12             : #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/Phi.hpp"
      13             : #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/Pi.hpp"
      14             : #include "PointwiseFunctions/GeneralRelativity/SpacetimeMetric.hpp"
      15             : #include "Utilities/GenerateInstantiations.hpp"
      16             : // IWYU pragma: no_forward_declare ::Tags::deriv
      17             : 
      18             : /// \cond
      19             : namespace GeneralizedHarmonic::Solutions {
      20             : // Preprocessor logic to avoid defining variables() functions for
      21             : // tags other than the three the wrapper adds (i.e., other than
      22             : // gr::Tags::SpacetimeMetric, GeneralizedHarmonic::Tags::Pi, and
      23             : // GeneralizedHarmonic:Tags::Phi)
      24             : #define FUNC_DEF(r, data, elem)                                            \
      25             :   template <typename SolutionType>                                         \
      26             :   auto WrappedGr<SolutionType>::variables(                                 \
      27             :       const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr< \
      28             :                                     SolutionType>::volume_dim>& /*x*/,     \
      29             :       double /*t*/, tmpl::list<elem> /*meta*/,                             \
      30             :       const IntermediateVars& intermediate_vars)                           \
      31             :       const noexcept->tuples::TaggedTuple<elem> {                          \
      32             :     return {get<elem>(intermediate_vars)};                                 \
      33             :   }
      34             : 
      35             : #define MY_LIST                                                              \
      36             :   BOOST_PP_TUPLE_TO_LIST(                                                    \
      37             :       (gr::Tags::Lapse<DataVector>, TimeDerivLapse, DerivLapse, TagShift,    \
      38             :        TimeDerivShift, DerivShift, TagSpatialMetric, TimeDerivSpatialMetric, \
      39             :        DerivSpatialMetric, TagInverseSpatialMetric, TagExCurvature,          \
      40             :        gr::Tags::SqrtDetSpatialMetric<DataVector>))
      41             : 
      42             : BOOST_PP_LIST_FOR_EACH(FUNC_DEF, _, MY_LIST)
      43             : #undef MY_LIST
      44             : #undef FUNC_DEF
      45             : 
      46             : template <typename SolutionType>
      47             : tuples::TaggedTuple<gr::Tags::SpacetimeMetric<
      48             :     GeneralizedHarmonic::Solutions::WrappedGr<SolutionType>::volume_dim,
      49             :     Frame::Inertial, DataVector>>
      50             : WrappedGr<SolutionType>::variables(
      51             :     const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<
      52             :                                   SolutionType>::volume_dim>& /*x*/,
      53             :     double /*t*/,
      54             :     tmpl::list<gr::Tags::SpacetimeMetric<
      55             :         GeneralizedHarmonic::Solutions::WrappedGr<SolutionType>::volume_dim,
      56             :         Frame::Inertial, DataVector>> /*meta*/,
      57             :     const IntermediateVars& intermediate_vars) const noexcept {
      58             :   const auto& lapse = get<gr::Tags::Lapse<DataVector>>(intermediate_vars);
      59             :   const auto& shift = get<gr::Tags::Shift<
      60             :       GeneralizedHarmonic::Solutions::WrappedGr<SolutionType>::volume_dim,
      61             :       Frame::Inertial, DataVector>>(intermediate_vars);
      62             :   const auto& spatial_metric = get<gr::Tags::SpatialMetric<
      63             :       GeneralizedHarmonic::Solutions::WrappedGr<SolutionType>::volume_dim,
      64             :       Frame::Inertial, DataVector>>(intermediate_vars);
      65             : 
      66             :   return {gr::spacetime_metric(lapse, shift, spatial_metric)};
      67             : }
      68             : 
      69             : template <typename SolutionType>
      70             : tuples::TaggedTuple<GeneralizedHarmonic::Tags::Phi<
      71             :     GeneralizedHarmonic::Solutions::WrappedGr<SolutionType>::volume_dim,
      72             :     Frame::Inertial>>
      73             : WrappedGr<SolutionType>::variables(
      74             :     const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<
      75             :                                   SolutionType>::volume_dim>& /*x*/,
      76             :     double /*t*/,
      77             :     tmpl::list<GeneralizedHarmonic::Tags::Phi<
      78             :         GeneralizedHarmonic::Solutions::WrappedGr<SolutionType>::volume_dim,
      79             :         Frame::Inertial>> /*meta*/,
      80             :     const IntermediateVars& intermediate_vars) const noexcept {
      81             :   const auto& lapse = get<gr::Tags::Lapse<DataVector>>(intermediate_vars);
      82             :   const auto& deriv_lapse =
      83             :       get<typename WrappedGr<SolutionType>::DerivLapse>(intermediate_vars);
      84             : 
      85             :   const auto& shift = get<gr::Tags::Shift<
      86             :       GeneralizedHarmonic::Solutions::WrappedGr<SolutionType>::volume_dim,
      87             :       Frame::Inertial, DataVector>>(intermediate_vars);
      88             :   const auto& deriv_shift =
      89             :       get<typename WrappedGr<SolutionType>::DerivShift>(intermediate_vars);
      90             : 
      91             :   const auto& spatial_metric = get<gr::Tags::SpatialMetric<
      92             :       GeneralizedHarmonic::Solutions::WrappedGr<SolutionType>::volume_dim,
      93             :       Frame::Inertial, DataVector>>(intermediate_vars);
      94             :   const auto& deriv_spatial_metric =
      95             :       get<typename WrappedGr<SolutionType>::DerivSpatialMetric>(
      96             :           intermediate_vars);
      97             : 
      98             :   return {GeneralizedHarmonic::phi(lapse, deriv_lapse, shift, deriv_shift,
      99             :                                    spatial_metric, deriv_spatial_metric)};
     100             : }
     101             : 
     102             : template <typename SolutionType>
     103             : tuples::TaggedTuple<GeneralizedHarmonic::Tags::Pi<
     104             :     GeneralizedHarmonic::Solutions::WrappedGr<SolutionType>::volume_dim,
     105             :     Frame::Inertial>>
     106             : WrappedGr<SolutionType>::variables(
     107             :     const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<
     108             :                                   SolutionType>::volume_dim>& /*x*/,
     109             :     double /*t*/,
     110             :     tmpl::list<GeneralizedHarmonic::Tags::Pi<
     111             :         GeneralizedHarmonic::Solutions::WrappedGr<SolutionType>::volume_dim,
     112             :         Frame::Inertial>> /*meta*/,
     113             :     const IntermediateVars& intermediate_vars) const noexcept {
     114             :   const auto& lapse = get<gr::Tags::Lapse<DataVector>>(intermediate_vars);
     115             :   const auto& dt_lapse =
     116             :       get<typename WrappedGr<SolutionType>::TimeDerivLapse>(intermediate_vars);
     117             :   const auto& deriv_lapse =
     118             :       get<typename WrappedGr<SolutionType>::DerivLapse>(intermediate_vars);
     119             : 
     120             :   const auto& shift = get<gr::Tags::Shift<
     121             :       GeneralizedHarmonic::Solutions::WrappedGr<SolutionType>::volume_dim,
     122             :       Frame::Inertial, DataVector>>(intermediate_vars);
     123             :   const auto& dt_shift =
     124             :       get<typename WrappedGr<SolutionType>::TimeDerivShift>(intermediate_vars);
     125             :   const auto& deriv_shift =
     126             :       get<typename WrappedGr<SolutionType>::DerivShift>(intermediate_vars);
     127             : 
     128             :   const auto& spatial_metric = get<gr::Tags::SpatialMetric<
     129             :       GeneralizedHarmonic::Solutions::WrappedGr<SolutionType>::volume_dim,
     130             :       Frame::Inertial, DataVector>>(intermediate_vars);
     131             :   const auto& dt_spatial_metric =
     132             :       get<typename WrappedGr<SolutionType>::TimeDerivSpatialMetric>(
     133             :           intermediate_vars);
     134             :   const auto& deriv_spatial_metric =
     135             :       get<typename WrappedGr<SolutionType>::DerivSpatialMetric>(
     136             :           intermediate_vars);
     137             : 
     138             :   const auto phi =
     139             :       GeneralizedHarmonic::phi(lapse, deriv_lapse, shift, deriv_shift,
     140             :                                spatial_metric, deriv_spatial_metric);
     141             : 
     142             :   return {GeneralizedHarmonic::pi(lapse, dt_lapse, shift, dt_shift,
     143             :                                   spatial_metric, dt_spatial_metric, phi)};
     144             : }
     145             : }  // namespace GeneralizedHarmonic::Solutions
     146             : 
     147             : #define STYPE(data) BOOST_PP_TUPLE_ELEM(0, data)
     148             : 
     149             : #define INSTANTIATE(_, data)                                                   \
     150             :   template tuples::TaggedTuple<gr::Tags::Lapse<DataVector>>                    \
     151             :   GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::variables(           \
     152             :       const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<     \
     153             :                                     STYPE(data)>::volume_dim>& /*x*/,          \
     154             :       double /*t*/, tmpl::list<gr::Tags::Lapse<DataVector>> /*meta*/,          \
     155             :       const IntermediateVars& intermediate_vars) const noexcept;               \
     156             :   template tuples::TaggedTuple<typename GeneralizedHarmonic::Solutions::       \
     157             :                                    WrappedGr<STYPE(data)>::TimeDerivLapse>     \
     158             :   GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::variables(           \
     159             :       const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<     \
     160             :                                     STYPE(data)>::volume_dim>& /*x*/,          \
     161             :       double /*t*/,                                                            \
     162             :       tmpl::list<typename GeneralizedHarmonic::Solutions::WrappedGr<STYPE(     \
     163             :           data)>::TimeDerivLapse> /*meta*/,                                    \
     164             :       const IntermediateVars& intermediate_vars) const noexcept;               \
     165             :   template tuples::TaggedTuple<typename GeneralizedHarmonic::Solutions::       \
     166             :                                    WrappedGr<STYPE(data)>::DerivLapse>         \
     167             :   GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::variables(           \
     168             :       const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<     \
     169             :                                     STYPE(data)>::volume_dim>& /*x*/,          \
     170             :       double /*t*/,                                                            \
     171             :       tmpl::list<typename GeneralizedHarmonic::Solutions::WrappedGr<STYPE(     \
     172             :           data)>::DerivLapse> /*meta*/,                                        \
     173             :       const IntermediateVars& intermediate_vars) const noexcept;               \
     174             :   template tuples::TaggedTuple<gr::Tags::Shift<                                \
     175             :       GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::volume_dim,      \
     176             :       Frame::Inertial, DataVector>>                                            \
     177             :   GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::variables(           \
     178             :       const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<     \
     179             :                                     STYPE(data)>::volume_dim>& /*x*/,          \
     180             :       double /*t*/,                                                            \
     181             :       tmpl::list<gr::Tags::Shift<                                              \
     182             :           GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::volume_dim,  \
     183             :           Frame::Inertial, DataVector>> /*meta*/,                              \
     184             :       const IntermediateVars& intermediate_vars) const noexcept;               \
     185             :   template tuples::TaggedTuple<typename GeneralizedHarmonic::Solutions::       \
     186             :                                    WrappedGr<STYPE(data)>::TimeDerivShift>     \
     187             :   GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::variables(           \
     188             :       const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<     \
     189             :                                     STYPE(data)>::volume_dim>& /*x*/,          \
     190             :       double /*t*/,                                                            \
     191             :       tmpl::list<typename GeneralizedHarmonic::Solutions::WrappedGr<STYPE(     \
     192             :           data)>::TimeDerivShift> /*meta*/,                                    \
     193             :       const IntermediateVars& intermediate_vars) const noexcept;               \
     194             :   template tuples::TaggedTuple<typename GeneralizedHarmonic::Solutions::       \
     195             :                                    WrappedGr<STYPE(data)>::DerivShift>         \
     196             :   GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::variables(           \
     197             :       const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<     \
     198             :                                     STYPE(data)>::volume_dim>& /*x*/,          \
     199             :       double /*t*/,                                                            \
     200             :       tmpl::list<typename GeneralizedHarmonic::Solutions::WrappedGr<STYPE(     \
     201             :           data)>::DerivShift> /*meta*/,                                        \
     202             :       const IntermediateVars& intermediate_vars) const noexcept;               \
     203             :   template tuples::TaggedTuple<gr::Tags::SpatialMetric<                        \
     204             :       GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::volume_dim,      \
     205             :       Frame::Inertial, DataVector>>                                            \
     206             :   GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::variables(           \
     207             :       const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<     \
     208             :                                     STYPE(data)>::volume_dim>& /*x*/,          \
     209             :       double /*t*/,                                                            \
     210             :       tmpl::list<gr::Tags::SpatialMetric<                                      \
     211             :           GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::volume_dim,  \
     212             :           Frame::Inertial, DataVector>> /*meta*/,                              \
     213             :       const IntermediateVars& intermediate_vars) const noexcept;               \
     214             :   template tuples::TaggedTuple<                                                \
     215             :       typename GeneralizedHarmonic::Solutions::WrappedGr<STYPE(                \
     216             :           data)>::TimeDerivSpatialMetric>                                      \
     217             :   GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::variables(           \
     218             :       const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<     \
     219             :                                     STYPE(data)>::volume_dim>& /*x*/,          \
     220             :       double /*t*/,                                                            \
     221             :       tmpl::list<typename GeneralizedHarmonic::Solutions::WrappedGr<STYPE(     \
     222             :           data)>::TimeDerivSpatialMetric> /*meta*/,                            \
     223             :       const IntermediateVars& intermediate_vars) const noexcept;               \
     224             :   template tuples::TaggedTuple<typename GeneralizedHarmonic::Solutions::       \
     225             :                                    WrappedGr<STYPE(data)>::DerivSpatialMetric> \
     226             :   GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::variables(           \
     227             :       const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<     \
     228             :                                     STYPE(data)>::volume_dim>& /*x*/,          \
     229             :       double /*t*/,                                                            \
     230             :       tmpl::list<typename GeneralizedHarmonic::Solutions::WrappedGr<STYPE(     \
     231             :           data)>::DerivSpatialMetric> /*meta*/,                                \
     232             :       const IntermediateVars& intermediate_vars) const noexcept;               \
     233             :   template tuples::TaggedTuple<gr::Tags::InverseSpatialMetric<                 \
     234             :       GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::volume_dim,      \
     235             :       Frame::Inertial, DataVector>>                                            \
     236             :   GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::variables(           \
     237             :       const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<     \
     238             :                                     STYPE(data)>::volume_dim>& /*x*/,          \
     239             :       double /*t*/,                                                            \
     240             :       tmpl::list<gr::Tags::InverseSpatialMetric<                               \
     241             :           GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::volume_dim,  \
     242             :           Frame::Inertial, DataVector>> /*meta*/,                              \
     243             :       const IntermediateVars& intermediate_vars) const noexcept;               \
     244             :   template tuples::TaggedTuple<gr::Tags::ExtrinsicCurvature<                   \
     245             :       GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::volume_dim,      \
     246             :       Frame::Inertial, DataVector>>                                            \
     247             :   GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::variables(           \
     248             :       const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<     \
     249             :                                     STYPE(data)>::volume_dim>& /*x*/,          \
     250             :       double /*t*/,                                                            \
     251             :       tmpl::list<gr::Tags::ExtrinsicCurvature<                                 \
     252             :           GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::volume_dim,  \
     253             :           Frame::Inertial, DataVector>> /*meta*/,                              \
     254             :       const IntermediateVars& intermediate_vars) const noexcept;               \
     255             :   template tuples::TaggedTuple<gr::Tags::SqrtDetSpatialMetric<DataVector>>     \
     256             :   GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::variables(           \
     257             :       const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<     \
     258             :                                     STYPE(data)>::volume_dim>& /*x*/,          \
     259             :       double /*t*/,                                                            \
     260             :       tmpl::list<gr::Tags::SqrtDetSpatialMetric<DataVector>> /*meta*/,         \
     261             :       const IntermediateVars& intermediate_vars) const noexcept;               \
     262             :   template tuples::TaggedTuple<gr::Tags::SpacetimeMetric<                      \
     263             :       GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::volume_dim,      \
     264             :       Frame::Inertial, DataVector>>                                            \
     265             :   GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::variables(           \
     266             :       const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<     \
     267             :                                     STYPE(data)>::volume_dim>& /*x*/,          \
     268             :       double /*t*/,                                                            \
     269             :       tmpl::list<gr::Tags::SpacetimeMetric<                                    \
     270             :           GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::volume_dim,  \
     271             :           Frame::Inertial, DataVector>> /*meta*/,                              \
     272             :       const IntermediateVars& intermediate_vars) const noexcept;               \
     273             :   template tuples::TaggedTuple<GeneralizedHarmonic::Tags::Pi<                  \
     274             :       GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::volume_dim,      \
     275             :       Frame::Inertial>>                                                        \
     276             :   GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::variables(           \
     277             :       const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<     \
     278             :                                     STYPE(data)>::volume_dim>& /*x*/,          \
     279             :       double /*t*/,                                                            \
     280             :       tmpl::list<GeneralizedHarmonic::Tags::Pi<                                \
     281             :           GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::volume_dim,  \
     282             :           Frame::Inertial>> /*meta*/,                                          \
     283             :       const IntermediateVars& intermediate_vars) const noexcept;               \
     284             :   template tuples::TaggedTuple<GeneralizedHarmonic::Tags::Phi<                 \
     285             :       GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::volume_dim,      \
     286             :       Frame::Inertial>>                                                        \
     287             :   GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::variables(           \
     288             :       const tnsr::I<DataVector, GeneralizedHarmonic::Solutions::WrappedGr<     \
     289             :                                     STYPE(data)>::volume_dim>& /*x*/,          \
     290             :       double /*t*/,                                                            \
     291             :       tmpl::list<GeneralizedHarmonic::Tags::Phi<                               \
     292             :           GeneralizedHarmonic::Solutions::WrappedGr<STYPE(data)>::volume_dim,  \
     293             :           Frame::Inertial>> /*meta*/,                                          \
     294             :       const IntermediateVars& intermediate_vars) const noexcept;
     295             : 
     296             : GENERATE_INSTANTIATIONS(
     297             :     INSTANTIATE, (gr::Solutions::GaugeWave<1>, gr::Solutions::GaugeWave<2>,
     298             :                   gr::Solutions::GaugeWave<3>, gr::Solutions::Minkowski<1>,
     299             :                   gr::Solutions::Minkowski<2>, gr::Solutions::Minkowski<3>,
     300             :                   gr::Solutions::KerrSchild))
     301             : 
     302             : #undef DIM
     303             : #undef STYPE
     304             : #undef INSTANTIATE
     305             : /// \endcond

Generated by: LCOV version 1.14