Line data Source code
1 0 : // 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 : 11 : #include "DataStructures/DataBox/Prefixes.hpp" 12 : #include "DataStructures/DataBox/Tag.hpp" 13 : #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" 14 : #include "DataStructures/Tensor/Tensor.hpp" 15 : #include "DataStructures/VariablesTag.hpp" 16 : #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.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 the time derivative of the spacetime metric from spatial 30 : * metric, lapse, shift, and their time derivatives. 31 : * 32 : * \details Computes the derivative as: 33 : * 34 : * \f{align}{ 35 : * \partial_t g_{tt} &= - 2 \alpha \partial_t \alpha 36 : * - 2 \gamma_{i j} \beta^i \partial_t \beta^j 37 : * + \beta^i \beta^j \partial_t \gamma_{i j}\\ 38 : * \partial_t g_{t i} &= \gamma_{j i} \partial_t \beta^j 39 : * + \beta^j \partial_t \gamma_{j i}\\ 40 : * \partial_t g_{i j} &= \partial_t \gamma_{i j}, 41 : * \f} 42 : * 43 : * where \f$\alpha, \beta^i, \gamma_{ij}\f$ are the lapse, shift, and spatial 44 : * metric respectively. 45 : */ 46 : template <typename DataType, size_t SpatialDim, typename Frame> 47 1 : void time_derivative_of_spacetime_metric( 48 : gsl::not_null<tnsr::aa<DataType, SpatialDim, Frame>*> dt_spacetime_metric, 49 : const Scalar<DataType>& lapse, const Scalar<DataType>& dt_lapse, 50 : const tnsr::I<DataType, SpatialDim, Frame>& shift, 51 : const tnsr::I<DataType, SpatialDim, Frame>& dt_shift, 52 : const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric, 53 : const tnsr::ii<DataType, SpatialDim, Frame>& dt_spatial_metric); 54 : 55 : template <typename DataType, size_t SpatialDim, typename Frame> 56 1 : tnsr::aa<DataType, SpatialDim, Frame> time_derivative_of_spacetime_metric( 57 : const Scalar<DataType>& lapse, const Scalar<DataType>& dt_lapse, 58 : const tnsr::I<DataType, SpatialDim, Frame>& shift, 59 : const tnsr::I<DataType, SpatialDim, Frame>& dt_shift, 60 : const tnsr::ii<DataType, SpatialDim, Frame>& spatial_metric, 61 : const tnsr::ii<DataType, SpatialDim, Frame>& dt_spatial_metric); 62 : /// @} 63 : namespace Tags {} // namespace Tags 64 : } // namespace gr