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/Psi4.hpp"
11 : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
12 :
13 : /// \cond
14 : namespace domain::Tags {
15 : template <size_t Dim, typename Frame>
16 : struct Coordinates;
17 : } // namespace domain::Tags
18 : namespace gsl {
19 : template <typename>
20 : struct not_null;
21 : } // namespace gsl
22 : /// \endcond
23 :
24 : namespace gr {
25 :
26 : /// @{
27 : /*!
28 : * \ingroup GeneralRelativityGroup
29 : * \brief Computes the real part of the Newman Penrose quantity \f$\Psi_4\f$
30 : * using \f$\Psi_4[Real] = -0.5*U^{8+}_{ij}*(x^ix^j - y^iy^j)\f$.
31 : */
32 : template <typename Frame>
33 1 : void psi_4_real(
34 : const gsl::not_null<Scalar<DataVector>*> psi_4_real_result,
35 : const tnsr::ii<DataVector, 3, Frame>& spatial_ricci,
36 : const tnsr::ii<DataVector, 3, Frame>& extrinsic_curvature,
37 : const tnsr::ijj<DataVector, 3, Frame>& cov_deriv_extrinsic_curvature,
38 : const tnsr::ii<DataVector, 3, Frame>& spatial_metric,
39 : const tnsr::II<DataVector, 3, Frame>& inverse_spatial_metric,
40 : const tnsr::I<DataVector, 3, Frame>& inertial_coords);
41 :
42 : template <typename Frame>
43 1 : Scalar<DataVector> psi_4_real(
44 : const tnsr::ii<DataVector, 3, Frame>& spatial_ricci,
45 : const tnsr::ii<DataVector, 3, Frame>& extrinsic_curvature,
46 : const tnsr::ijj<DataVector, 3, Frame>& cov_deriv_extrinsic_curvature,
47 : const tnsr::ii<DataVector, 3, Frame>& spatial_metric,
48 : const tnsr::II<DataVector, 3, Frame>& inverse_spatial_metric,
49 : const tnsr::I<DataVector, 3, Frame>& inertial_coords);
50 :
51 : namespace Tags {
52 : /// Computes the real part of the Newman Penrose quantity \f$\Psi_4\f$ using
53 : /// \f$\Psi_4[Real] = -0.5*U^{8+}_{ij}*(x^ix^j - y^iy^j)\f$.
54 : ///
55 : /// Can be retrieved using `gr::Tags::Psi4Real`
56 : template <typename Frame>
57 1 : struct Psi4RealCompute : Psi4Real<DataVector>, db::ComputeTag {
58 0 : using argument_tags = tmpl::list<
59 : gr::Tags::SpatialRicci<DataVector, 3, Frame>,
60 : gr::Tags::ExtrinsicCurvature<DataVector, 3, Frame>,
61 : ::Tags::deriv<gr::Tags::ExtrinsicCurvature<DataVector, 3, Frame>,
62 : tmpl::size_t<3>, Frame>,
63 : gr::Tags::SpatialMetric<DataVector, 3, Frame>,
64 : gr::Tags::InverseSpatialMetric<DataVector, 3, Frame>,
65 : domain::Tags::Coordinates<3, Frame>>;
66 :
67 0 : using return_type = Scalar<DataVector>;
68 0 : static constexpr auto function = static_cast<void (*)(
69 : gsl::not_null<Scalar<DataVector>*>, const tnsr::ii<DataVector, 3, Frame>&,
70 : const tnsr::ii<DataVector, 3, Frame>&,
71 : const tnsr::ijj<DataVector, 3, Frame>&,
72 : const tnsr::ii<DataVector, 3, Frame>&,
73 : const tnsr::II<DataVector, 3, Frame>&,
74 : const tnsr::I<DataVector, 3, Frame>&)>(&psi_4_real<Frame>);
75 0 : using base = Psi4Real<DataVector>;
76 : };
77 : } // namespace Tags
78 : } // namespace gr
|