OrthonormalOneform.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
9 
10 /// \cond
11 namespace gsl {
12 template <typename>
13 struct not_null;
14 } // namespace gsl
15 /// \endcond
16 
17 // @{
18 /*!
19  * \ingroup TensorGroup
20  *
21  * \brief Compute a spatial one-form orthonormal to the given unit form
22  *
23  * Given a unit spatial one-form \f$s_i\f$, compute a new form \f$t_i\f$
24  * which is orthonormal to \f$s_i\f$, in the sense that
25  * \f$\gamma^{ij}s_i t_j = 0\f$, for the given inverse spatial metric
26  * \f$\gamma^{ij}\f$. The normalization of \f$t_i\f$ is such that
27  * \f$\gamma^{ij}t_it_j = 1\f$.
28  *
29  * \details The new form is obtained via Gram-Schmidt process, starting
30  * from a form whose components are \f$t_i = \delta_i^I\f$, where \f$I\f$ is
31  * the index of the component of \f$s_i\f$ with the smallest absolute value.
32  */
33 template <typename DataType, size_t VolumeDim, typename Frame>
35  gsl::not_null<tnsr::i<DataType, VolumeDim, Frame>*> orthonormal_form,
36  const tnsr::i<DataType, VolumeDim, Frame>& unit_form,
37  const tnsr::II<DataType, VolumeDim, Frame>& inv_spatial_metric) noexcept;
38 
39 template <typename DataType, size_t VolumeDim, typename Frame>
40 tnsr::i<DataType, VolumeDim, Frame> orthonormal_oneform(
41  const tnsr::i<DataType, VolumeDim, Frame>& unit_form,
42  const tnsr::II<DataType, VolumeDim, Frame>& inv_spatial_metric) noexcept;
43 // @}
44 
45 // @{
46 /*!
47  * \ingroup TensorGroup
48  *
49  * \brief Compute a spatial one-form orthonormal to two given unit forms.
50  *
51  * Given a unit spatial one-form \f$s_i\f$ and another form \f$t_i\f$ that is
52  * orthonormal to \f$s_i\f$, compute a new form \f$u_i\f$ which is orthonormal
53  * to both \f$s_i\f$ and \f$t_i\f$, in the sense that
54  * \f$\gamma^{ij}s_i u_j = \gamma^{ij}t_i u_j = 0\f$, for the given
55  * inverse spatial metric \f$\gamma^{ij}\f$. The normalization of \f$u_i\f$
56  * is such that \f$\gamma^{ij}u_iu_j = 1\f$.
57  *
58  * \details The new form is obtained by taking the covariant cross product
59  * of \f$s_i\f$ and \f$ t_i\f$, for which the spatial metric as well as
60  * its determinant must be provided.
61  */
62 template <typename DataType, typename Frame>
64  gsl::not_null<tnsr::i<DataType, 3, Frame>*> orthonormal_form,
65  const tnsr::i<DataType, 3, Frame>& first_unit_form,
66  const tnsr::i<DataType, 3, Frame>& second_unit_form,
67  const tnsr::ii<DataType, 3, Frame>& spatial_metric,
68  const Scalar<DataType>& det_spatial_metric) noexcept;
69 
70 template <typename DataType, typename Frame>
71 tnsr::i<DataType, 3, Frame> orthonormal_oneform(
72  const tnsr::i<DataType, 3, Frame>& first_unit_form,
73  const tnsr::i<DataType, 3, Frame>& second_unit_form,
74  const tnsr::ii<DataType, 3, Frame>& spatial_metric,
75  const Scalar<DataType>& det_spatial_metric) noexcept;
76 // @}
Implementations from the Guideline Support Library.
Definition: Gsl.hpp:79
tnsr::ii< DataType, SpatialDim, Frame > spatial_metric(const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric) noexcept
Compute spatial metric from spacetime metric.
void orthonormal_oneform(gsl::not_null< tnsr::i< DataType, VolumeDim, Frame > *> orthonormal_form, const tnsr::i< DataType, VolumeDim, Frame > &unit_form, const tnsr::II< DataType, VolumeDim, Frame > &inv_spatial_metric) noexcept
Compute a spatial one-form orthonormal to the given unit form.
Defines a list of useful type aliases for tensors.
Tensor< T, Symmetry<>, index_list<> > Scalar
Scalar type.
Definition: TypeAliases.hpp:21
Require a pointer to not be a nullptr
Definition: Gsl.hpp:182