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 : * \brief Computes spacetime normal one-form from lapse. 29 : * 30 : * \details If \f$\alpha\f$ is the lapse, then 31 : * 32 : * \f{align} 33 : * n_t &= - \alpha \\ 34 : * n_i &= 0 35 : * \f} 36 : * 37 : * is computed. 38 : */ 39 : template <typename DataType, size_t SpatialDim, typename Frame> 40 1 : void spacetime_normal_one_form( 41 : gsl::not_null<tnsr::a<DataType, SpatialDim, Frame>*> normal_one_form, 42 : const Scalar<DataType>& lapse); 43 : 44 : template <typename DataType, size_t SpatialDim, typename Frame> 45 1 : tnsr::a<DataType, SpatialDim, Frame> spacetime_normal_one_form( 46 : const Scalar<DataType>& lapse); 47 : /// @} 48 : 49 : namespace Tags { 50 : /*! 51 : * \brief Compute item for spacetime normal oneform \f$n_a\f$ from 52 : * the lapse \f$\alpha\f$. 53 : * 54 : * \details Can be retrieved using `gr::Tags::SpacetimeNormalOneForm`. 55 : */ 56 : template <typename DataType, size_t SpatialDim, typename Frame> 57 1 : struct SpacetimeNormalOneFormCompute 58 : : SpacetimeNormalOneForm<DataType, SpatialDim, Frame>, 59 : db::ComputeTag { 60 0 : using argument_tags = tmpl::list<Lapse<DataType>>; 61 : 62 0 : using return_type = tnsr::a<DataType, SpatialDim, Frame>; 63 : 64 0 : static constexpr auto function = 65 : static_cast<void (*)(gsl::not_null<tnsr::a<DataType, SpatialDim, Frame>*>, 66 : const Scalar<DataType>&)>( 67 : &spacetime_normal_one_form<DataType, SpatialDim, Frame>); 68 : 69 0 : using base = SpacetimeNormalOneForm<DataType, SpatialDim, Frame>; 70 : }; 71 : } // namespace Tags 72 : } // namespace gr