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/DataBox/Tag.hpp"
9 : #include "DataStructures/Tensor/TypeAliases.hpp"
10 : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
11 : #include "PointwiseFunctions/GeneralRelativity/TagsDeclarations.hpp"
12 : #include "PointwiseFunctions/Hydro/TagsDeclarations.hpp"
13 : #include "Utilities/Kokkos/KokkosMacros.hpp"
14 :
15 : /// \cond
16 : namespace gsl {
17 : template <typename>
18 : struct not_null;
19 : } // namespace gsl
20 : /// \endcond
21 :
22 : namespace hydro {
23 :
24 : /// \brief Function computing the transport velocity.
25 : ///
26 : /// Computes the transport velocity, using
27 : /// \f$v_t^i=\alpha v^i-\beta^i\f$, with
28 : /// $v^i$ being the spatial velocity, $\alpha$ the lapse, and
29 : /// $\beta^i$ the shift.
30 : template <typename DataType, size_t Dim, typename Fr = Frame::Inertial>
31 1 : KOKKOS_FUNCTION void transport_velocity(
32 : gsl::not_null<tnsr::I<DataType, Dim, Fr>*> result,
33 : const tnsr::I<DataType, Dim, Fr>& spatial_velocity,
34 : const Scalar<DataType>& lapse, const tnsr::I<DataType, Dim, Fr>& shift);
35 :
36 : namespace Tags {
37 : /// \brief Compute tag for the transport velocity.
38 : ///
39 : /// Compute item for the transport velocity, using
40 : /// \f$v_t^i=\alpha v^i-\beta^i\f$, with
41 : /// $v^i$ being the spatial velocity, $\alpha$ the lapse, and
42 : /// $\beta^i$ the shift.
43 : template <typename DataType, size_t Dim, typename Fr = Frame::Inertial>
44 1 : struct TransportVelocityCompute
45 : : hydro::Tags::TransportVelocity<DataType, Dim, Fr>,
46 : db::ComputeTag {
47 0 : using argument_tags =
48 : tmpl::list<SpatialVelocity<DataType, Dim, Fr>,
49 : ::gr::Tags::Lapse<DataType>,
50 : ::gr::Tags::Shift<DataType, Dim, Fr>>;
51 :
52 0 : using base = TransportVelocity<DataType, Dim, Fr>;
53 0 : using return_type = typename base::type;
54 :
55 0 : static constexpr auto function = static_cast<void (*)(
56 : const gsl::not_null<tnsr::I<DataType, Dim, Fr>*> result,
57 : const tnsr::I<DataType, Dim, Fr>& spatial_velocity,
58 : const Scalar<DataType>& lapse, const tnsr::I<DataType, Dim, Fr>& shift)>(
59 : &hydro::transport_velocity<DataType, Dim, Fr>);
60 : };
61 :
62 : } // namespace Tags
63 :
64 : } // namespace hydro
|