SpacetimeNormalOneForm.hpp
1 // 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 
12 #include "DataStructures/DataBox/Tag.hpp"
15 #include "DataStructures/VariablesTag.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$N\f$ is the lapse, then
31  * \f{align} n_t &= - N \\
32  * n_i &= 0 \f}
33  * is computed.
34  */
35 template <size_t SpatialDim, typename Frame, typename DataType>
37  gsl::not_null<tnsr::a<DataType, SpatialDim, Frame>*> normal_one_form,
38  const Scalar<DataType>& lapse) noexcept;
39 
40 template <size_t SpatialDim, typename Frame, typename DataType>
41 tnsr::a<DataType, SpatialDim, Frame> spacetime_normal_one_form(
42  const Scalar<DataType>& lapse) noexcept;
43 //@}
44 
45 namespace Tags {
46 /*!
47  * \brief Compute item for spacetime normal oneform \f$n_a\f$ from
48  * the lapse \f$N\f$.
49  *
50  * \details Can be retrieved using `gr::Tags::SpacetimeNormalOneForm`.
51  */
52 template <size_t SpatialDim, typename Frame, typename DataType>
54  : SpacetimeNormalOneForm<SpatialDim, Frame, DataType>,
56  using argument_tags = tmpl::list<Lapse<DataType>>;
57 
58  using return_type = tnsr::a<DataType, SpatialDim, Frame>;
59 
60  static constexpr auto function =
62  const Scalar<DataType>&) noexcept>(
63  &spacetime_normal_one_form<SpatialDim, Frame, DataType>);
64 
66 };
67 } // namespace Tags
68 } // namespace gr
db::ComputeTag
Marks a DataBoxTag as being a compute item that executes a function.
Definition: Tag.hpp:109
gr::Tags::SpacetimeNormalOneFormCompute
Compute item for spacetime normal oneform from the lapse .
Definition: SpacetimeNormalOneForm.hpp:53
utility
DeterminantAndInverse.hpp
cmath
gr::lapse
Scalar< DataType > lapse(const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric) noexcept
Compute lapse from shift and spacetime metric.
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
cstdint
gr::Tags::SpacetimeNormalOneForm
Definition: Tags.hpp:83
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
Gsl.hpp
gr
Definition: GaugeWave.hpp:27
Tensor.hpp
PartialDerivatives.hpp
Prefixes.hpp
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: Gsl.hpp:183