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 a quantity measuring how far from type D spacetime is.
25 : *
26 : * \details Computes a quantity measuring how far from type D spacetime is,
27 : * using measure D1 [Eq. (8) of \cite Bhagwat2017tkm]:
28 : *
29 : * \f{align}{
30 : * \frac{a}{12} \gamma_{ij} - \frac{b}{a} E_{ij} - 4
31 : * E_{i}^{k} E_{jk} = 0 \f}
32 : *
33 : * where \f$\gamma_{ij}\f$ is the spatial metric and \f$E_{ij}\f$ is the
34 : * electric part ofthe Weyl tensor.
35 : */
36 : template <typename DataType, size_t SpatialDim, typename Frame>
37 1 : tnsr::ii<DataType, SpatialDim, Frame> weyl_type_D1(
38 : const tnsr::ii<DataType, SpatialDim, Frame>& weyl_electric,
39 : const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
40 : const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric);
41 :
42 : template <typename DataType, size_t SpatialDim, typename Frame>
43 1 : void weyl_type_D1(
44 : const gsl::not_null<tnsr::ii<DataType, SpatialDim, Frame>*> weyl_type_D1,
45 : const tnsr::ii<DataType, SpatialDim, Frame>& weyl_electric,
46 : const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
47 : const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric);
48 : /// @}
49 :
50 : /// @{
51 : /*!
52 : * \ingroup GeneralRelativityGroup
53 : * \brief Computes the scalar \f$D_{ij} D^{ij}\f$ , a measure of a spacetime's
54 : * devitation from type D.
55 : *
56 : * \details Computes the scalar \f$D_{ij} D^{ij}\f$ from \f$D_{ij}\f$ (Eq. (8)
57 : * of \cite Bhagwat2017tkm] and the inverse spatial metric \f$\gamma^{ij}\f$,
58 : * i.e. \f$D = \gamma^{ik}\gamma^{jl}D_{ij}D_{kl}\f$.
59 : *
60 : * \note The Weyl Type D1 \f$D_{ij}\f$ is available via gr::weyl_type_D1.
61 : */
62 : template <typename DataType, size_t SpatialDim, typename Frame>
63 1 : void weyl_type_D1_scalar(
64 : const gsl::not_null<Scalar<DataType>*> weyl_type_D1_scalar_result,
65 : const tnsr::ii<DataType, SpatialDim, Frame>& weyl_type_D1,
66 : const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric);
67 :
68 : template <typename DataType, size_t SpatialDim, typename Frame>
69 1 : Scalar<DataType> weyl_type_D1_scalar(
70 : const tnsr::ii<DataType, SpatialDim, Frame>& weyl_type_D1,
71 : const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric);
72 :
73 : /// @}
74 :
75 : namespace Tags {
76 : /// Compute item for WeylTypeD1
77 : /// Computed from WeylElectric, SpatialMetric, and InverseSpatialMetric
78 : ///
79 : /// Can be retrieved using gr::Tags::WeylTypeD1
80 : template <typename DataType, size_t SpatialDim, typename Frame>
81 1 : struct WeylTypeD1Compute : WeylTypeD1<DataType, SpatialDim, Frame>,
82 : db::ComputeTag {
83 0 : using argument_tags =
84 : tmpl::list<gr::Tags::WeylElectric<DataType, SpatialDim, Frame>,
85 : gr::Tags::SpatialMetric<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_type_D1<DataType, SpatialDim, Frame>);
96 :
97 0 : using base = WeylTypeD1<DataType, SpatialDim, Frame>;
98 : };
99 :
100 : /// Can be retrieved using gr::Tags::WeylTypeD1Scalar
101 : template <typename DataType, size_t SpatialDim, typename Frame>
102 1 : struct WeylTypeD1ScalarCompute : WeylTypeD1Scalar<DataType>, db::ComputeTag {
103 0 : using argument_tags =
104 : tmpl::list<gr::Tags::WeylTypeD1Compute<DataType, SpatialDim, Frame>,
105 : gr::Tags::InverseSpatialMetric<DataType, SpatialDim, Frame>>;
106 :
107 0 : using return_type = Scalar<DataType>;
108 :
109 0 : static constexpr auto function =
110 : static_cast<void (*)(gsl::not_null<Scalar<DataType>*>,
111 : const tnsr::ii<DataType, SpatialDim, Frame>&,
112 : const tnsr::II<DataType, SpatialDim, Frame>&)>(
113 : &gr::weyl_type_D1_scalar<DataType, SpatialDim, Frame>);
114 :
115 0 : using base = WeylTypeD1Scalar<DataType>;
116 : };
117 : } // namespace Tags
118 : } // namespace gr
|