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/Prefixes.hpp"
9 : #include "DataStructures/DataBox/Tag.hpp"
10 : #include "DataStructures/DataVector.hpp"
11 : #include "DataStructures/Tensor/Tensor.hpp"
12 : #include "Domain/Tags.hpp"
13 : #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp"
14 : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
15 : #include "Utilities/ContainerHelpers.hpp"
16 : #include "Utilities/Gsl.hpp"
17 : #include "Utilities/TMPL.hpp"
18 :
19 : /// \cond
20 : namespace domain::Tags {
21 : template <size_t Dim, typename Frame>
22 : struct Coordinates;
23 : } // namespace domain::Tags
24 : class DataVector;
25 : template <typename X, typename Symm, typename IndexList>
26 : class Tensor;
27 : /// \endcond
28 :
29 : namespace gh {
30 : /// @{
31 : /*!
32 : * \ingroup GeneralRelativityGroup
33 : * \brief Computes the expansion \f$\Theta\f$ for 1D apparent horizon finding.
34 : *
35 : * \details Calculate the expansion to find apparent horizon for 1D
36 : * cartoon domain. Implements Eq. (7.41) of \cite BaumgarteShapiro,
37 : * \f$\Theta\ = -\frac{1}{\sqrt{2}} m^{ij} \Big( s_k \Gamma^k_{ij}
38 : * + K_{ij} \Big) \f$, assuming the calculations are performed on the Cartesian
39 : * x axis.
40 : */
41 : template <typename DataType, typename Frame>
42 1 : void expansion1D(gsl::not_null<Scalar<DataType>*> expansion,
43 : const tnsr::ii<DataType, 3, Frame>& spatial_metric,
44 : const tnsr::ijj<DataType, 3, Frame>& deriv_spatial_metric,
45 : const tnsr::ii<DataType, 3, Frame>& ext_curvature,
46 : const tnsr::I<DataType, 3, Frame>& coords);
47 :
48 : template <typename DataType, typename Frame>
49 1 : Scalar<DataType> expansion1D(
50 : const tnsr::ii<DataType, 3, Frame>& spatial_metric,
51 : const tnsr::ijj<DataType, 3, Frame>& deriv_spatial_metric,
52 : const tnsr::ii<DataType, 3, Frame>& ext_curvature,
53 : const tnsr::I<DataType, 3, Frame>& coords);
54 : /// @}
55 :
56 : namespace Tags {
57 : template <typename DataType>
58 0 : struct Expansion1D : db::SimpleTag {
59 0 : using type = Scalar<DataType>;
60 : };
61 :
62 : /*!
63 : * \brief Compute item for the 1D expansion.
64 : *
65 : * \details Calculate the expansion for spherically symmetric cartoon horizon
66 : * finding. See `expansion1D()`. Can be retrieved using
67 : * `gh::Tags::Expansion1D`.
68 : */
69 : template <typename Frame>
70 1 : struct Expansion1DCompute : Expansion1D<DataVector>, db::ComputeTag {
71 0 : using argument_tags =
72 : tmpl::list<gr::Tags::SpatialMetric<DataVector, 3, Frame>,
73 : ::Tags::deriv<gr::Tags::SpatialMetric<DataVector, 3, Frame>,
74 : tmpl::size_t<3>, Frame>,
75 : gr::Tags::ExtrinsicCurvature<DataVector, 3, Frame>,
76 : domain::Tags::Coordinates<3, Frame> >;
77 :
78 0 : using return_type = Scalar<DataVector>;
79 :
80 0 : static constexpr auto function = static_cast<void (*)(
81 : gsl::not_null<Scalar<DataVector>*>, const tnsr::ii<DataVector, 3, Frame>&,
82 : const tnsr::ijj<DataVector, 3, Frame>&,
83 : const tnsr::ii<DataVector, 3, Frame>&,
84 : const tnsr::I<DataVector, 3, Frame>&)>(&expansion1D<DataVector, Frame>);
85 0 : using base = Expansion1D<DataVector>;
86 : };
87 : } // namespace Tags
88 : } // namespace gh
|