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 - B^jD_j\Phi /\alpha^2
45 : * B^i \f$ for the Irrotational BNS equation for the velocity potential.
46 : */
47 1 : void potential_fluxes(
48 : gsl::not_null<tnsr::I<DataVector, 3>*> flux_for_potential,
49 : const tnsr::II<DataVector, 3>& rotational_shift_stress,
50 : const tnsr::II<DataVector, 3>& inverse_spatial_metric,
51 : const tnsr::i<DataVector, 3>& velocity_potential_gradient);
52 :
53 : /*!
54 : * \brief Add the sources \f$S=-\Gamma^i_{ij}F^j - \D_j \left(\alpha \rho /
55 : * h\right) F^j\f$ for the curved-space Irrotational BNS equation on a spatial
56 : * metric \f$\gamma_{ij}\f$.
57 : *
58 : * These sources arise from the non-principal part of the Laplacian on a
59 : * non-Euclidean background.
60 : */
61 1 : void add_potential_sources(
62 : gsl::not_null<Scalar<DataVector>*> source_for_potential,
63 : const tnsr::i<DataVector, 3>&
64 : log_deriv_lapse_times_density_over_specific_enthalpy,
65 : const tnsr::i<DataVector, 3>& christoffel_contracted,
66 : const tnsr::I<DataVector, 3>& flux_for_potential);
67 :
68 : /*!
69 : * \brief Compute the fluxes \f$F^i\f$ for the curved-space Irrotatational BNS
70 : * equations on a spatial metric \f$\gamma_{ij}\f$.
71 : *
72 : * \see IrrotationalBns::FirstOrderSystem
73 : */
74 1 : struct Fluxes {
75 0 : using argument_tags =
76 : tmpl::list<gr::Tags::InverseSpatialMetric<DataVector, 3>,
77 : Tags::RotationalShiftStress<DataVector>>;
78 0 : using volume_tags = tmpl::list<>;
79 0 : using const_global_cache_tags = tmpl::list<>;
80 0 : static void apply(gsl::not_null<tnsr::I<DataVector, 3>*> flux_for_potential,
81 : const tnsr::II<DataVector, 3>& inverse_spatial_metric,
82 : const tnsr::II<DataVector, 3>& rotational_shift_stress,
83 : const Scalar<DataVector>& velocity_potential,
84 : const tnsr::i<DataVector, 3>& velocity_potential_gradient);
85 0 : static void apply(gsl::not_null<tnsr::I<DataVector, 3>*> flux_on_face,
86 : const tnsr::II<DataVector, 3>& inverse_spatial_metric,
87 : const tnsr::II<DataVector, 3>& rotational_shift_stress,
88 : const tnsr::i<DataVector, 3>& face_normal,
89 : const tnsr::I<DataVector, 3>& face_normal_vector,
90 : const Scalar<DataVector>& velocity_potential);
91 : };
92 :
93 : /*!
94 : * \brief Add the sources \f$S_A\f$ for the curved-space Irrotatioanl BNS
95 : * equation on a spatial metric \f$\gamma_{ij}\f$.
96 : *
97 : * \see IrrotationalBns::FirstOrderSystem
98 : */
99 1 : struct Sources {
100 0 : using argument_tags = tmpl::list<
101 : Tags::DerivLogLapseTimesDensityOverSpecificEnthalpy<DataVector>,
102 : gr::Tags::SpatialChristoffelSecondKindContracted<DataVector, 3>>;
103 0 : static void apply(gsl::not_null<Scalar<DataVector>*> equation_for_potential,
104 : const tnsr::i<DataVector, 3>&
105 : log_deriv_lapse_times_density_over_specific_enthalpy,
106 : const tnsr::i<DataVector, 3>& christoffel_contracted,
107 : const Scalar<DataVector>& velocity_potential,
108 : const tnsr::I<DataVector, 3>& flux_for_potential);
109 : };
110 :
111 : } // namespace BnsInitialData
|