SpECTRE Documentation Coverage Report
 Current view: top level - PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic - SecondTimeDerivOfSpacetimeMetric.hpp Hit Total Coverage Commit: 664546099c4dbf27a1b708fac45e39c82dd743d2 Lines: 3 8 37.5 % Date: 2024-04-19 16:28:01 Legend: Lines: hit not hit
  Line data Source code  1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include 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 : class DataVector; 21 : template 22 : class Tensor; 23 : /// \endcond 24 : 25 : namespace gh { 26 : /// @{ 27 : /*! 28 : * \ingroup GeneralRelativityGroup 29 : * \brief Computes the second time derivative of the spacetime metric from the 30 : * generalized harmonic variables, lapse, shift, and the spacetime unit normal 31 : * 1-form. 32 : * 33 : * \details Let the generalized harmonic conjugate momentum and spatial 34 : * derivative variables be \f$\Pi_{ab} = -n^c \partial_c g_{ab} \f$ and 35 : * \f$\Phi_{iab} = \partial_i g_{ab} \f$. 36 : * 37 : * Using eq.(35) of \cite Lindblom2005qh (with \f$\gamma_1 = -1\f$) the first 38 : * time derivative of the spacetime metric may be expressed in terms of the 39 : * above variables: 40 : * 41 : * \f[ 42 : * \partial_0 g_{ab} = - \alpha \Pi_{ab} + \beta^k \Phi_{kab} 43 : * \f] 44 : * 45 : * As such, its second time derivative is simply the following: 46 : * 47 : * \f[ 48 : * \partial^2_0 g_{ab} 49 : * = - (\partial_0 \alpha) \Pi_{ab} - \alpha \partial_0 \Pi_{ab} 50 : * + (\partial_0 \beta^k) \Phi_{kab} + \beta^k \partial_0 \Phi_{kab} 51 : * \f] 52 : * 53 : */ 54 : template 55 1 : void second_time_deriv_of_spacetime_metric( 56 : gsl::not_null*> d2t2_spacetime_metric, 57 : const Scalar& lapse, const Scalar& dt_lapse, 58 : const tnsr::I& shift, 59 : const tnsr::I& dt_shift, 60 : const tnsr::iaa& phi, 61 : const tnsr::iaa& dt_phi, 62 : const tnsr::aa& pi, 63 : const tnsr::aa& dt_pi); 64 : 65 : template 66 1 : tnsr::aa second_time_deriv_of_spacetime_metric( 67 : const Scalar& lapse, const Scalar& dt_lapse, 68 : const tnsr::I& shift, 69 : const tnsr::I& dt_shift, 70 : const tnsr::iaa& phi, 71 : const tnsr::iaa& dt_phi, 72 : const tnsr::aa& pi, 73 : const tnsr::aa& dt_pi); 74 : /// @} 75 : 76 : namespace Tags { 77 : /*! 78 : * \brief Compute item to get second time derivative of the spacetime metric 79 : * from generalized harmonic and geometric variables 80 : * 81 : * \details See second_time_deriv_of_spacetime_metric(). Can be retrieved 82 : * using gr::Tags::SpacetimeMetric wrapped in Tags::dt>. 83 : */ 84 : template 85 1 : struct SecondTimeDerivOfSpacetimeMetricCompute 86 : : ::Tags::dt< 87 : ::Tags::dt>>, 88 : db::ComputeTag { 89 0 : using argument_tags = 90 : tmpl::list, 91 : ::Tags::dt>, 92 : gr::Tags::Shift, 93 : ::Tags::dt>, 94 : Phi, 95 : ::Tags::dt>, 96 : Pi, 97 : ::Tags::dt>>; 98 : 99 0 : using base = ::Tags::dt< 100 : ::Tags::dt>>; 101 0 : using return_type = typename base::type; 102 : 103 0 : static constexpr auto function = static_cast*>, 105 : const Scalar&, const Scalar&, 106 : const tnsr::I&, 107 : const tnsr::I&, 108 : const tnsr::iaa&, 109 : const tnsr::iaa&, 110 : const tnsr::aa&, 111 : const tnsr::aa&)>( 112 : &second_time_deriv_of_spacetime_metric); 113 : }; 114 : } // namespace Tags 115 : } // namespace gh 

 Generated by: LCOV version 1.14