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 "Evolution/Systems/GeneralizedHarmonic/Tags.hpp" 13 : #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.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 { 21 : namespace Tags { 22 : template <size_t Dim, typename Frame> 23 : struct Coordinates; 24 : } // namespace Tags 25 : } // namespace domain 26 : class DataVector; 27 : template <typename X, typename Symm, typename IndexList> 28 : class Tensor; 29 : /// \endcond 30 : 31 : namespace gh { 32 : /// @{ 33 : /*! 34 : * \ingroup GeneralRelativityGroup 35 : * \brief Computes spatial derivatives of the spatial metric from 36 : * the generalized harmonic spatial derivative variable. 37 : * 38 : * \details If \f$ \Phi_{kab} \f$ is the generalized 39 : * harmonic spatial derivative variable, then the derivatives of the 40 : * spatial metric are 41 : * \f[ 42 : * \partial_k \gamma_{ij} = \Phi_{kij} 43 : * \f] 44 : * 45 : * This quantity is needed for computing spatial Christoffel symbols. 46 : */ 47 : template <typename DataType, size_t SpatialDim, typename Frame> 48 1 : void deriv_spatial_metric( 49 : gsl::not_null<tnsr::ijj<DataType, SpatialDim, Frame>*> d_spatial_metric, 50 : const tnsr::iaa<DataType, SpatialDim, Frame>& phi); 51 : 52 : template <typename DataType, size_t SpatialDim, typename Frame> 53 1 : tnsr::ijj<DataType, SpatialDim, Frame> deriv_spatial_metric( 54 : const tnsr::iaa<DataType, SpatialDim, Frame>& phi); 55 : /// @} 56 : 57 : namespace Tags { 58 : /*! 59 : * \brief Compute item to get spatial derivatives of the spatial metric from 60 : * the generalized harmonic spatial derivative variable. 61 : * 62 : * \details See `deriv_spatial_metric()`. Can be retrieved using 63 : * `gr::Tags::SpatialMetric` wrapped in `::Tags::deriv`. 64 : */ 65 : template <size_t SpatialDim, typename Frame> 66 1 : struct DerivSpatialMetricCompute 67 : : ::Tags::deriv<gr::Tags::SpatialMetric<DataVector, SpatialDim, Frame>, 68 : tmpl::size_t<SpatialDim>, Frame>, 69 : db::ComputeTag { 70 0 : using argument_tags = tmpl::list<Phi<DataVector, SpatialDim, Frame>>; 71 : 72 0 : using return_type = tnsr::ijj<DataVector, SpatialDim, Frame>; 73 : 74 0 : static constexpr auto function = static_cast<void (*)( 75 : gsl::not_null<tnsr::ijj<DataVector, SpatialDim, Frame>*>, 76 : const tnsr::iaa<DataVector, SpatialDim, Frame>&)>( 77 : &deriv_spatial_metric<DataVector, SpatialDim, Frame>); 78 : 79 0 : using base = 80 : ::Tags::deriv<gr::Tags::SpatialMetric<DataVector, SpatialDim, Frame>, 81 : tmpl::size_t<SpatialDim>, Frame>; 82 : }; 83 : } // namespace Tags 84 : } // namespace gh