ProjectionOperators.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
9 #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
10 
11 /// \cond
12 namespace gsl {
13 template <typename>
14 struct not_null;
15 } // namespace gsl
16 /// \endcond
17 
18 namespace gr {
19 
20 // @{
21 /*!
22  * \ingroup GeneralRelativityGroup
23  * \brief Compute projection operator onto an interface
24  *
25  * \details Returns the operator \f$P^{ij} = g^{ij} - n^i n^j\f$,
26  * where \f$g^{ij}\f$ is the inverse spatial metric, and
27  * \f$n^i\f$ is the normal vector to the interface in question.
28  *
29  */
30 template <size_t VolumeDim, typename Frame, typename DataType>
31 tnsr::II<DataType, VolumeDim, Frame> transverse_projection_operator(
32  const tnsr::II<DataType, VolumeDim, Frame>& inverse_spatial_metric,
33  const tnsr::I<DataType, VolumeDim, Frame>& normal_vector) noexcept;
34 
35 template <size_t VolumeDim, typename Frame, typename DataType>
37  gsl::not_null<tnsr::II<DataType, VolumeDim, Frame>*> projection_tensor,
38  const tnsr::II<DataType, VolumeDim, Frame>& inverse_spatial_metric,
39  const tnsr::I<DataType, VolumeDim, Frame>& normal_vector) noexcept;
40 // @}
41 
42 // @{
43 /*!
44  * \ingroup GeneralRelativityGroup
45  * \brief Compute projection operator onto an interface
46  *
47  * \details Returns the operator \f$P_{ij} = g_{ij} - n_i n_j\f$,
48  * where \f$ g_{ij}\f$ is the spatial metric, and \f$ n_i\f$ is
49  * the normal one-form to the interface in question.
50  */
51 template <size_t VolumeDim, typename Frame, typename DataType>
52 tnsr::ii<DataType, VolumeDim, Frame> transverse_projection_operator(
53  const tnsr::ii<DataType, VolumeDim, Frame>& spatial_metric,
54  const tnsr::i<DataType, VolumeDim, Frame>& normal_one_form) noexcept;
55 
56 template <size_t VolumeDim, typename Frame, typename DataType>
58  gsl::not_null<tnsr::ii<DataType, VolumeDim, Frame>*> projection_tensor,
59  const tnsr::ii<DataType, VolumeDim, Frame>& spatial_metric,
60  const tnsr::i<DataType, VolumeDim, Frame>& normal_one_form) noexcept;
61 // @}
62 
63 // @{
64 /*!
65  * \ingroup GeneralRelativityGroup
66  * \brief Compute projection operator onto an interface
67  *
68  * \details Returns the operator \f$P^{i}_{j} = \delta^{i}_{j} - n^i n_j\f$,
69  * where \f$n^i\f$ and \f$n_i\f$ are the normal vector and normal one-form
70  * to the interface in question.
71  */
72 template <size_t VolumeDim, typename Frame, typename DataType>
73 tnsr::Ij<DataType, VolumeDim, Frame> transverse_projection_operator(
74  const tnsr::I<DataType, VolumeDim, Frame>& normal_vector,
75  const tnsr::i<DataType, VolumeDim, Frame>& normal_one_form) noexcept;
76 
77 template <size_t VolumeDim, typename Frame, typename DataType>
79  gsl::not_null<tnsr::Ij<DataType, VolumeDim, Frame>*> projection_tensor,
80  const tnsr::I<DataType, VolumeDim, Frame>& normal_vector,
81  const tnsr::i<DataType, VolumeDim, Frame>& normal_one_form) noexcept;
82 // @}
83 
84 // @{
85 /*!
86  * \ingroup GeneralRelativityGroup
87  * \brief Compute spacetime projection operator onto an interface
88  *
89  * \details Consider an \f$n-1\f$-dimensional surface \f$S\f$ in an
90  * \f$n\f$-dimensional spatial hypersurface \f$\Sigma\f$. Let \f$s_a\f$
91  * be the unit spacelike one-form orthogonal to \f$S\f$ in \f$\Sigma\f$,
92  * and \f$n_a\f$ be the timelike unit vector orthogonal to \f$\Sigma\f$.
93  * This function returns the projection operator onto \f$S\f$ for
94  * \f$n+1\f$ dimensional quantities:
95  *
96  * \f{align*}
97  * P_{ab} = \psi_{ab} + n_a n_b - s_a s_b.
98  * \f}
99  */
100 template <size_t VolumeDim, typename Frame, typename DataType>
101 tnsr::aa<DataType, VolumeDim, Frame> transverse_projection_operator(
102  const tnsr::aa<DataType, VolumeDim, Frame>& spacetime_metric,
103  const tnsr::a<DataType, VolumeDim, Frame>& spacetime_normal_one_form,
104  const tnsr::i<DataType, VolumeDim, Frame>&
105  interface_unit_normal_one_form) noexcept;
106 
107 template <size_t VolumeDim, typename Frame, typename DataType>
109  gsl::not_null<tnsr::aa<DataType, VolumeDim, Frame>*> projection_tensor,
110  const tnsr::aa<DataType, VolumeDim, Frame>& spacetime_metric,
111  const tnsr::a<DataType, VolumeDim, Frame>& spacetime_normal_one_form,
112  const tnsr::i<DataType, VolumeDim, Frame>&
113  interface_unit_normal_one_form) noexcept;
114 // @}
115 
116 // @{
117 /*!
118  * \ingroup GeneralRelativityGroup
119  * \brief Compute spacetime projection operator onto an interface
120  *
121  * \details Consider an \f$n-1\f$-dimensional surface \f$S\f$ in an
122  * \f$n\f$-dimensional spatial hypersurface \f$\Sigma\f$. Let \f$s^a\f$
123  * be the unit spacelike vector orthogonal to \f$S\f$ in \f$\Sigma\f$,
124  * and \f$n^a\f$ be the timelike unit vector orthogonal to \f$\Sigma\f$.
125  * This function returns the projection operator onto \f$S\f$ for
126  * \f$n+1\f$ dimensional quantities:
127  *
128  * \f{align*}
129  * P^{ab} = \psi^{ab} + n^a n^b - s^a s^b.
130  * \f}
131  */
132 template <size_t VolumeDim, typename Frame, typename DataType>
133 tnsr::AA<DataType, VolumeDim, Frame> transverse_projection_operator(
134  const tnsr::AA<DataType, VolumeDim, Frame>& inverse_spacetime_metric,
135  const tnsr::A<DataType, VolumeDim, Frame>& spacetime_normal_vector,
136  const tnsr::I<DataType, VolumeDim, Frame>&
137  interface_unit_normal_vector) noexcept;
138 
139 template <size_t VolumeDim, typename Frame, typename DataType>
141  gsl::not_null<tnsr::AA<DataType, VolumeDim, Frame>*> projection_tensor,
142  const tnsr::AA<DataType, VolumeDim, Frame>& inverse_spacetime_metric,
143  const tnsr::A<DataType, VolumeDim, Frame>& spacetime_normal_vector,
144  const tnsr::I<DataType, VolumeDim, Frame>&
145  interface_unit_normal_vector) noexcept;
146 // @}
147 
148 // @{
149 /*!
150  * \ingroup GeneralRelativityGroup
151  * \brief Compute spacetime projection operator onto an interface
152  *
153  * \details Consider an \f$n-1\f$-dimensional surface \f$S\f$ in an
154  * \f$n\f$-dimensional spatial hypersurface \f$\Sigma\f$. Let \f$s^a\f$
155  * \f$(s_a)\f$ be the unit spacelike vector (one-form) orthogonal
156  * to \f$S\f$ in \f$\Sigma\f$, and \f$n^a\f$ \f$(n_a)\f$ be the timelike
157  * unit vector (one-form) orthogonal to \f$\Sigma\f$. This function
158  * returns the projection operator onto \f$S\f$ for \f$n+1\f$ dimensional
159  * quantities:
160  *
161  * \f{align*}
162  * P^a_b = \delta^a_b + n^a n_b - s^a s_b.
163  * \f}
164  */
165 template <size_t VolumeDim, typename Frame, typename DataType>
166 tnsr::Ab<DataType, VolumeDim, Frame> transverse_projection_operator(
167  const tnsr::A<DataType, VolumeDim, Frame>& spacetime_normal_vector,
168  const tnsr::a<DataType, VolumeDim, Frame>& spacetime_normal_one_form,
169  const tnsr::I<DataType, VolumeDim, Frame>& interface_unit_normal_vector,
170  const tnsr::i<DataType, VolumeDim, Frame>&
171  interface_unit_normal_one_form) noexcept;
172 
173 template <size_t VolumeDim, typename Frame, typename DataType>
175  gsl::not_null<tnsr::Ab<DataType, VolumeDim, Frame>*> projection_tensor,
176  const tnsr::A<DataType, VolumeDim, Frame>& spacetime_normal_vector,
177  const tnsr::a<DataType, VolumeDim, Frame>& spacetime_normal_one_form,
178  const tnsr::I<DataType, VolumeDim, Frame>& interface_unit_normal_vector,
179  const tnsr::i<DataType, VolumeDim, Frame>&
180  interface_unit_normal_one_form) noexcept;
181 // @}
182 } // namespace gr
gr::transverse_projection_operator
tnsr::II< DataType, VolumeDim, Frame > transverse_projection_operator(const tnsr::II< DataType, VolumeDim, Frame > &inverse_spatial_metric, const tnsr::I< DataType, VolumeDim, Frame > &normal_vector) noexcept
Compute projection operator onto an interface.
gr::spacetime_normal_one_form
void spacetime_normal_one_form(gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * > normal_one_form, const Scalar< DataType > &lapse) noexcept
Computes spacetime normal one-form from lapse.
cstddef
TypeAliases.hpp
gr::spacetime_metric
void spacetime_metric(gsl::not_null< tnsr::aa< DataType, Dim, Frame > * > spacetime_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, Dim, Frame > &shift, const tnsr::ii< DataType, Dim, Frame > &spatial_metric) noexcept
Computes the spacetime metric from the spatial metric, lapse, and shift.
gr
Definition: GaugeWave.hpp:27
gr::spatial_metric
tnsr::ii< DataType, SpatialDim, Frame > spatial_metric(const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric) noexcept
Compute spatial metric from spacetime metric.
gsl
Implementations from the Guideline Support Library.
Definition: ReadSpecThirdOrderPiecewisePolynomial.hpp:11
gr::inverse_spacetime_metric
void inverse_spacetime_metric(gsl::not_null< tnsr::AA< DataType, SpatialDim, Frame > * > inverse_spacetime_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric) noexcept
Compute inverse spacetime metric from inverse spatial metric, lapse and shift.
gr::spacetime_normal_vector
tnsr::A< DataType, SpatialDim, Frame > spacetime_normal_vector(const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift) noexcept
Computes spacetime normal vector from lapse and shift.
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecThirdOrderPiecewisePolynomial.hpp:13