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/Tensor/Tensor.hpp"
9 : #include "Elliptic/Systems/BnsInitialData/Tags.hpp"
10 : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
11 : #include "Utilities/Gsl.hpp"
12 : #include "Utilities/MakeWithValue.hpp"
13 : #include "Utilities/TMPL.hpp"
14 :
15 : /// \cond
16 : class DataVector;
17 : namespace PUP {
18 : class er;
19 : } // namespace PUP
20 : namespace BnsInitialData {
21 : struct Fluxes;
22 : struct Sources;
23 : } // namespace BnsInitialData
24 : /// \endcond
25 :
26 : namespace BnsInitialData {
27 :
28 : /*!
29 : * \brief Compute the fluxes
30 : * \f[ F^i = \gamma^{ij} n_j \Phi - n_j \Phi
31 : * \frac{B^iB^j}{\alpha^2} \f] where \f$ n_j\f$ is the
32 : * `face_normal`.
33 : *
34 : * The `face_normal_vector` is \f$ \gamma^{ij} n_j\f$.
35 : */
36 1 : void fluxes_on_face(
37 : gsl::not_null<tnsr::I<DataVector, 3>*> face_flux_for_potential,
38 : const tnsr::i<DataVector, 3>& face_normal,
39 : const tnsr::I<DataVector, 3>& face_normal_vector,
40 : const tnsr::II<DataVector, 3>& rotational_shift_stress,
41 : const Scalar<DataVector>& velocity_potential);
42 :
43 : /*!
44 : * \brief Compute the generic fluxes \f$ F^i = D^i \Phi -
45 : * \frac{B^jD_j\Phi}{\alpha^2} B^i \f$ for the Irrotational BNS equation for the
46 : * velocity potential.
47 : */
48 1 : void potential_fluxes(
49 : gsl::not_null<tnsr::I<DataVector, 3>*> flux_for_potential,
50 : const tnsr::II<DataVector, 3>& rotational_shift_stress,
51 : const tnsr::II<DataVector, 3>& inverse_spatial_metric,
52 : const tnsr::i<DataVector, 3>& velocity_potential_gradient);
53 :
54 : /*!
55 : * \brief Add the sources \f$S=-\Gamma^i_{ij}F^j - \D_j \left(\ln\alpha \rho /
56 : * h\right) F^j\f$ for the curved-space Irrotational BNS equation on a spatial
57 : * metric \f$\gamma_{ij}\f$.
58 : *
59 : * These sources arise from the non-principal part of the Laplacian on a
60 : * non-Euclidean background.
61 : */
62 1 : void add_potential_sources(
63 : gsl::not_null<Scalar<DataVector>*> source_for_potential,
64 : const tnsr::i<DataVector, 3>&
65 : log_deriv_lapse_times_density_over_specific_enthalpy,
66 : const tnsr::i<DataVector, 3>& christoffel_contracted,
67 : const tnsr::I<DataVector, 3>& flux_for_potential);
68 :
69 : /*!
70 : * \brief Compute the fluxes \f$F^i\f$ for the curved-space Irrotatational BNS
71 : * equations on a spatial metric \f$\gamma_{ij}\f$.
72 : *
73 : * \see IrrotationalBns::FirstOrderSystem
74 : */
75 1 : struct Fluxes {
76 0 : using argument_tags =
77 : tmpl::list<gr::Tags::InverseSpatialMetric<DataVector, 3>,
78 : Tags::RotationalShiftStress<DataVector>>;
79 0 : using volume_tags = tmpl::list<>;
80 0 : using const_global_cache_tags = tmpl::list<>;
81 0 : static void apply(gsl::not_null<tnsr::I<DataVector, 3>*> flux_for_potential,
82 : const tnsr::II<DataVector, 3>& inverse_spatial_metric,
83 : const tnsr::II<DataVector, 3>& rotational_shift_stress,
84 : const Scalar<DataVector>& velocity_potential,
85 : const tnsr::i<DataVector, 3>& velocity_potential_gradient);
86 0 : static void apply(gsl::not_null<tnsr::I<DataVector, 3>*> flux_on_face,
87 : const tnsr::II<DataVector, 3>& inverse_spatial_metric,
88 : const tnsr::II<DataVector, 3>& rotational_shift_stress,
89 : const tnsr::i<DataVector, 3>& face_normal,
90 : const tnsr::I<DataVector, 3>& face_normal_vector,
91 : const Scalar<DataVector>& velocity_potential);
92 : };
93 :
94 : /*!
95 : * \brief Add the sources \f$S_A\f$ for the curved-space Irrotatioanl BNS
96 : * equation on a spatial metric \f$\gamma_{ij}\f$.
97 : *
98 : * \see IrrotationalBns::FirstOrderSystem
99 : */
100 1 : struct Sources {
101 0 : using argument_tags = tmpl::list<
102 : Tags::DerivLogLapseTimesDensityOverSpecificEnthalpy<DataVector>,
103 : gr::Tags::SpatialChristoffelSecondKindContracted<DataVector, 3>>;
104 0 : using const_global_cache_tags = tmpl::list<>;
105 0 : static void apply(gsl::not_null<Scalar<DataVector>*> equation_for_potential,
106 : const tnsr::i<DataVector, 3>&
107 : log_deriv_lapse_times_density_over_specific_enthalpy,
108 : const tnsr::i<DataVector, 3>& christoffel_contracted,
109 : const Scalar<DataVector>& velocity_potential,
110 : const tnsr::I<DataVector, 3>& flux_for_potential);
111 : };
112 :
113 : } // namespace BnsInitialData
|