SpacetimeDerivOfNormOfShift.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
9 #include "DataStructures/DataBox/Tag.hpp"
10 #include "DataStructures/DataVector.hpp"
12 #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 // IWYU pragma: no_forward_declare Tags::deriv
20 
21 /// \cond
22 namespace domain {
23 namespace Tags {
24 template <size_t Dim, typename Frame>
25 struct Coordinates;
26 } // namespace Tags
27 } // namespace domain
28 class DataVector;
29 template <typename X, typename Symm, typename IndexList>
30 class Tensor;
31 /// \endcond
32 
33 namespace GeneralizedHarmonic {
34 // @{
35 /*!
36  * \ingroup GeneralRelativityGroup
37  * \brief Computes spacetime derivatives of the norm of the shift vector.
38  *
39  * \details The same is computed as:
40  * \f{align*}
41  * \partial_a (N^i N_i) = (N_i \partial_0 N^i + N^i \partial_0 N_i,
42  * N_i \partial_j N^i + N^i \partial_j N_i)
43  * \f}
44  */
45 template <size_t SpatialDim, typename Frame, typename DataType>
47  gsl::not_null<tnsr::a<DataType, SpatialDim, Frame>*> d4_norm_of_shift,
48  const Scalar<DataType>& lapse,
49  const tnsr::I<DataType, SpatialDim, Frame>& shift,
50  const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
51  const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
52  const tnsr::AA<DataType, SpatialDim, Frame>& inverse_spacetime_metric,
53  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
54  const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
55  const tnsr::aa<DataType, SpatialDim, Frame>& pi) noexcept;
56 
57 template <size_t SpatialDim, typename Frame, typename DataType>
58 tnsr::a<DataType, SpatialDim, Frame> spacetime_deriv_of_norm_of_shift(
59  const Scalar<DataType>& lapse,
60  const tnsr::I<DataType, SpatialDim, Frame>& shift,
61  const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
62  const tnsr::II<DataType, SpatialDim, Frame>& inverse_spatial_metric,
63  const tnsr::AA<DataType, SpatialDim, Frame>& inverse_spacetime_metric,
64  const tnsr::A<DataType, SpatialDim, Frame>& spacetime_unit_normal,
65  const tnsr::iaa<DataType, SpatialDim, Frame>& phi,
66  const tnsr::aa<DataType, SpatialDim, Frame>& pi) noexcept;
67 // @}
68 } // namespace GeneralizedHarmonic
GeneralizedHarmonic::pi
void pi(gsl::not_null< tnsr::aa< DataType, SpatialDim, Frame > * > pi, const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::ii< DataType, SpatialDim, Frame > &dt_spatial_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi) noexcept
Computes the conjugate momentum of the spacetime metric .
GeneralizedHarmonic
Items related to evolving the first-order generalized harmonic system.
Definition: Characteristics.cpp:21
gr::lapse
Scalar< DataType > lapse(const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric) noexcept
Compute lapse from shift and spacetime metric.
cstddef
DataVector
Stores a collection of function values.
Definition: DataVector.hpp:42
GeneralizedHarmonic::spacetime_deriv_of_norm_of_shift
void spacetime_deriv_of_norm_of_shift(gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * > d4_norm_of_shift, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi) noexcept
Computes spacetime derivatives of the norm of the shift vector.
GeneralizedHarmonic::phi
void phi(gsl::not_null< tnsr::iaa< DataType, SpatialDim, Frame > * > phi, const Scalar< DataType > &lapse, const tnsr::i< DataType, SpatialDim, Frame > &deriv_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::iJ< DataType, SpatialDim, Frame > &deriv_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::ijj< DataType, SpatialDim, Frame > &deriv_spatial_metric) noexcept
Computes the auxiliary variable used by the generalized harmonic formulation of Einstein's equations...
gr::shift
tnsr::I< DataType, SpatialDim, Frame > shift(const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric) noexcept
Compute shift from spacetime metric and inverse spatial metric.
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
Gsl.hpp
Tensor.hpp
gr::spatial_metric
tnsr::ii< DataType, SpatialDim, Frame > spatial_metric(const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric) noexcept
Compute spatial metric from spacetime metric.
PartialDerivatives.hpp
Prefixes.hpp
gr::inverse_spacetime_metric
void inverse_spacetime_metric(gsl::not_null< tnsr::AA< DataType, SpatialDim, Frame > * > inverse_spacetime_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric) noexcept
Compute inverse spacetime metric from inverse spatial metric, lapse and shift.
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: Gsl.hpp:183