ExtrinsicCurvature.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cmath>
7 #include <cstddef>
8 #include <cstdint>
9 #include <utility>
10 
12 #include "DataStructures/DataBox/Tag.hpp"
15 #include "DataStructures/VariablesTag.hpp"
17 #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
18 #include "Utilities/ContainerHelpers.hpp"
19 #include "Utilities/Gsl.hpp"
20 #include "Utilities/TMPL.hpp"
21 #include "Utilities/TaggedTuple.hpp"
22 
23 /// \ingroup GeneralRelativityGroup
24 /// Holds functions related to general relativity.
25 namespace gr {
26 //@{
27 /*!
28  * \ingroup GeneralRelativityGroup
29  * \brief Computes extrinsic curvature from metric and derivatives.
30  * \details Uses the ADM evolution equation for the spatial metric,
31  * \f[ K_{ij} = \frac{1}{2N} \left ( -\partial_0 g_{ij}
32  * + N^k \partial_k g_{ij} + g_{ki} \partial_j N^k
33  * + g_{kj} \partial_i N^k \right ) \f]
34  * where \f$K_{ij}\f$ is the extrinsic curvature, \f$N\f$ is the lapse,
35  * \f$N^i\f$ is the shift, and \f$g_{ij}\f$ is the spatial metric. In terms
36  * of the Lie derivative of the spatial metric with respect to a unit timelike
37  * vector \f$t^a\f$ normal to the spatial slice, this corresponds to the sign
38  * convention
39  * \f[ K_{ab} = - \frac{1}{2} \mathcal{L}_{\mathbf{t}} g_{ab} \f]
40  */
41 template <size_t SpatialDim, typename Frame, typename DataType>
42 tnsr::ii<DataType, SpatialDim, Frame> extrinsic_curvature(
43  const Scalar<DataType>& lapse,
44  const tnsr::I<DataType, SpatialDim, Frame>& shift,
45  const tnsr::iJ<DataType, SpatialDim, Frame>& deriv_shift,
46  const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
47  const tnsr::ii<DataType, SpatialDim, Frame>& dt_spatial_metric,
48  const tnsr::ijj<DataType, SpatialDim, Frame>&
49  deriv_spatial_metric) noexcept;
50 
51 template <size_t SpatialDim, typename Frame, typename DataType>
53  gsl::not_null<tnsr::ii<DataType, SpatialDim, Frame>*> ex_curvature,
54  const Scalar<DataType>& lapse,
55  const tnsr::I<DataType, SpatialDim, Frame>& shift,
56  const tnsr::iJ<DataType, SpatialDim, Frame>& deriv_shift,
57  const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric,
58  const tnsr::ii<DataType, SpatialDim, Frame>& dt_spatial_metric,
59  const tnsr::ijj<DataType, SpatialDim, Frame>&
60  deriv_spatial_metric) noexcept;
61 //@}
62 } // namespace gr
utility
DeterminantAndInverse.hpp
cmath
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
cstdint
GeneralizedHarmonic::deriv_spatial_metric
void deriv_spatial_metric(gsl::not_null< tnsr::ijj< DataType, SpatialDim, Frame > * > d_spatial_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi) noexcept
Computes spatial derivatives of the spatial metric from the generalized harmonic spatial derivative v...
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
gr
Definition: GaugeWave.hpp:27
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.
gr::extrinsic_curvature
tnsr::ii< DataType, SpatialDim, Frame > extrinsic_curvature(const Scalar< DataType > &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::ii< DataType, SpatialDim, Frame > &dt_spatial_metric, const tnsr::ijj< DataType, SpatialDim, Frame > &deriv_spatial_metric) noexcept
Computes extrinsic curvature from metric and derivatives.
PartialDerivatives.hpp
Prefixes.hpp
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: Gsl.hpp:183