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/Tensor/TypeAliases.hpp" 9 : 10 : /// \cond 11 : namespace gsl { 12 : template <typename> 13 : struct not_null; 14 : } // namespace gsl 15 : /// \endcond 16 : 17 : namespace gr { 18 : /// @{ 19 : /*! 20 : * \ingroup GeneralRelativityGroup 21 : * \brief Compute null normal one-form to the boundary of a closed 22 : * region in a spatial slice of spacetime. 23 : * 24 : * \details Consider an \f$n-1\f$-dimensional boundary \f$S\f$ of a closed 25 : * region in an \f$n\f$-dimensional spatial hypersurface \f$\Sigma\f$. Let 26 : * \f$s^a\f$ be the unit spacelike vector orthogonal to \f$S\f$ in \f$\Sigma\f$, 27 : * and \f$n^a\f$ be the timelike unit vector orthogonal to \f$\Sigma\f$. 28 : * This function returns the null one-form that is outgoing/incoming on \f$S\f$: 29 : * 30 : * \f{align*} 31 : * k_a = \frac{1}{\sqrt{2}}\left(n_a \pm s_a\right). 32 : * \f} 33 : */ 34 : template <typename DataType, size_t VolumeDim, typename Frame> 35 1 : tnsr::a<DataType, VolumeDim, Frame> interface_null_normal( 36 : const tnsr::a<DataType, VolumeDim, Frame>& spacetime_normal_one_form, 37 : const tnsr::i<DataType, VolumeDim, Frame>& interface_unit_normal_one_form, 38 : const double sign); 39 : 40 : template <typename DataType, size_t VolumeDim, typename Frame> 41 1 : void interface_null_normal( 42 : gsl::not_null<tnsr::a<DataType, VolumeDim, Frame>*> null_one_form, 43 : const tnsr::a<DataType, VolumeDim, Frame>& spacetime_normal_one_form, 44 : const tnsr::i<DataType, VolumeDim, Frame>& interface_unit_normal_one_form, 45 : const double sign); 46 : /// @} 47 : 48 : /*! 49 : * \ingroup GeneralRelativityGroup 50 : * \brief Compute null normal vector to the boundary of a closed 51 : * region in a spatial slice of spacetime. 52 : * 53 : * \details Consider an \f$n-1\f$-dimensional boundary \f$S\f$ of a closed 54 : * region in an \f$n\f$-dimensional spatial hypersurface \f$\Sigma\f$. Let 55 : * \f$s^a\f$ be the unit spacelike vector orthogonal to \f$S\f$ in \f$\Sigma\f$, 56 : * and \f$n^a\f$ be the timelike unit vector orthogonal to \f$\Sigma\f$. 57 : * This function returns the null vector that is outgoing/ingoing on \f$S\f$: 58 : * 59 : * \f{align*} 60 : * k^a = \frac{1}{\sqrt{2}}\left(n^a \pm s^a\right). 61 : * \f} 62 : */ 63 : template <typename DataType, size_t VolumeDim, typename Frame> 64 1 : tnsr::A<DataType, VolumeDim, Frame> interface_null_normal( 65 : const tnsr::A<DataType, VolumeDim, Frame>& spacetime_normal_vector, 66 : const tnsr::I<DataType, VolumeDim, Frame>& interface_unit_normal_vector, 67 : const double sign); 68 : 69 : /*! 70 : * \ingroup GeneralRelativityGroup 71 : * \brief Compute null normal vector to the boundary of a closed 72 : * region in a spatial slice of spacetime. 73 : * 74 : * \details Consider an \f$n-1\f$-dimensional boundary \f$S\f$ of a closed 75 : * region in an \f$n\f$-dimensional spatial hypersurface \f$\Sigma\f$. Let 76 : * \f$s^a\f$ be the unit spacelike vector orthogonal to \f$S\f$ in \f$\Sigma\f$, 77 : * and \f$n^a\f$ be the timelike unit vector orthogonal to \f$\Sigma\f$. 78 : * This function returns the null vector that is outgoing/ingoing on \f$S\f$: 79 : * 80 : * \f{align*} 81 : * k^a = \frac{1}{\sqrt{2}}\left(n^a \pm s^a\right). 82 : * \f} 83 : */ 84 : template <typename DataType, size_t VolumeDim, typename Frame> 85 : void interface_null_normal( 86 : gsl::not_null<tnsr::A<DataType, VolumeDim, Frame>*> null_vector, 87 : const tnsr::A<DataType, VolumeDim, Frame>& spacetime_normal_vector, 88 : const tnsr::I<DataType, VolumeDim, Frame>& interface_unit_normal_vector, 89 : const double sign); 90 : } // namespace gr