TimeDerivativeTerms.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <array>
7 
10 #include "DataStructures/DataVector.hpp"
12 #include "Evolution/Systems/RadiationTransport/M1Grey/Fluxes.hpp"
13 #include "Evolution/Systems/RadiationTransport/M1Grey/Sources.hpp"
14 #include "Evolution/Systems/RadiationTransport/M1Grey/Tags.hpp"
16 #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
17 #include "Utilities/Gsl.hpp"
18 #include "Utilities/TMPL.hpp"
19 
21 template <typename... NeutrinoSpecies>
24  using type = tnsr::I<DataVector, 3, Frame::Inertial>;
25  };
26 
27  using temporary_tags = tmpl::list<TildeSUp>;
28  using argument_tags = tmpl::list<
34 
40  tmpl::size_t<3>, Frame::Inertial>,
42  tmpl::size_t<3>, Frame::Inertial>,
44 
45  static void apply(
46  const gsl::not_null<typename Tags::TildeE<
48  NeutrinoSpecies>::type*>... non_flux_terms_dt_tilde_e,
49  const gsl::not_null<typename Tags::TildeS<
51  NeutrinoSpecies>::type*>... non_flux_terms_dt_tilde_s,
52 
53  const gsl::not_null<typename ::Tags::Flux<
55  Frame::Inertial>::type*>... tilde_e_flux,
56  const gsl::not_null<typename ::Tags::Flux<
58  Frame::Inertial>::type*>... tilde_s_flux,
59 
60  const gsl::not_null<tnsr::I<DataVector, 3, Frame::Inertial>*> tilde_s_M,
61 
62  const typename Tags::TildeE<Frame::Inertial,
63  NeutrinoSpecies>::type&... tilde_e,
64  const typename Tags::TildeS<Frame::Inertial,
65  NeutrinoSpecies>::type&... tilde_s,
66  const typename Tags::TildeP<Frame::Inertial,
67  NeutrinoSpecies>::type&... tilde_p,
69  const tnsr::I<DataVector, 3, Frame::Inertial>& shift,
70  const tnsr::ii<DataVector, 3, Frame::Inertial>& spatial_metric,
71  const tnsr::II<DataVector, 3, Frame::Inertial>& inv_spatial_metric,
72 
73  const typename Tags::M1HydroCouplingNormal<
74  NeutrinoSpecies>::type&... source_n,
75  const typename Tags::M1HydroCouplingSpatial<
76  Frame::Inertial, NeutrinoSpecies>::type&... source_i,
77  const tnsr::i<DataVector, 3>& d_lapse,
78  const tnsr::iJ<DataVector, 3>& d_shift,
79  const tnsr::ijj<DataVector, 3>& d_spatial_metric,
80  const tnsr::ii<DataVector, 3>& extrinsic_curvature) noexcept {
81  EXPAND_PACK_LEFT_TO_RIGHT(detail::compute_fluxes_impl(
82  tilde_e_flux, tilde_s_flux, tilde_s_M, tilde_e, tilde_s, tilde_p, lapse,
83  shift, spatial_metric, inv_spatial_metric));
84  EXPAND_PACK_LEFT_TO_RIGHT(detail::compute_sources_impl(
85  non_flux_terms_dt_tilde_e, non_flux_terms_dt_tilde_s, tilde_e, tilde_s,
86  tilde_p, source_n, source_i, lapse, d_lapse, d_shift, d_spatial_metric,
87  inv_spatial_metric, extrinsic_curvature));
88  }
89 };
90 } // namespace RadiationTransport::M1Grey
RadiationTransport::M1Grey::TimeDerivativeTerms::TildeSUp
Definition: TimeDerivativeTerms.hpp:23
DataBoxTag.hpp
EXPAND_PACK_LEFT_TO_RIGHT
#define EXPAND_PACK_LEFT_TO_RIGHT(...)
Expand a parameter pack evaluating the terms from left to right.
Definition: TMPL.hpp:563
Frame::Inertial
Definition: IndexType.hpp:44
gr::Tags::SpatialMetric
Definition: Tags.hpp:26
RadiationTransport::M1Grey::Tags::TildeP
The densitized pressure tensor of neutrinos of a given species computed from , using the M1 closure...
Definition: Tags.hpp:52
db::SimpleTag
Tags for the DataBox inherit from this type.
Definition: Tag.hpp:23
RadiationTransport::M1Grey::Tags::TildeE
The densitized energy density of neutrinos of a given species .
Definition: Tags.hpp:31
RadiationTransport::M1Grey::Tags::TildeS
The densitized momentum density of neutrinos of a given species .
Definition: Tags.hpp:41
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.
RadiationTransport::M1Grey
The M1 scheme for radiation transport.
Definition: Characteristics.cpp:11
RadiationTransport::M1Grey::Tags::M1HydroCouplingSpatial
The spatial components of source term coupling the M1 and hydro equations.
Definition: Tags.hpp:168
array
RadiationTransport::M1Grey::TimeDerivativeTerms
Definition: TimeDerivativeTerms.hpp:22
gr::Tags::Shift
Definition: Tags.hpp:48
gr::shift
tnsr::I< DataType, SpatialDim, Frame > shift(const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric) noexcept
Compute shift from spacetime metric and inverse spatial metric.
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
Gsl.hpp
Tensor.hpp
Tags::deriv
Prefix indicating spatial derivatives.
Definition: PartialDerivatives.hpp:53
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.
gr::Tags::ExtrinsicCurvature
Definition: Tags.hpp:110
PartialDerivatives.hpp
Prefixes.hpp
RadiationTransport::M1Grey::Tags::M1HydroCouplingNormal
The normal component of the source term coupling the M1 and hydro equations.
Definition: Tags.hpp:154
gr::Tags::Lapse
Definition: Tags.hpp:52
TMPL.hpp
StrahlkorperGr::extrinsic_curvature
void extrinsic_curvature(gsl::not_null< tnsr::ii< DataVector, 3, Frame > * > result, const tnsr::ii< DataVector, 3, Frame > &grad_normal, const tnsr::i< DataVector, 3, Frame > &unit_normal_one_form, const tnsr::I< DataVector, 3, Frame > &unit_normal_vector) noexcept
Extrinsic curvature of a 2D Strahlkorper embedded in a 3D space.
gr::Tags::InverseSpatialMetric
Inverse of the spatial metric.
Definition: Tags.hpp:33
gsl::not_null
Require a pointer to not be a nullptr
Definition: Gsl.hpp:183