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/Punctures/Tags.hpp"
10 : #include "Utilities/Gsl.hpp"
11 : #include "Utilities/TMPL.hpp"
12 :
13 : /// \cond
14 : class DataVector;
15 : namespace PUP {
16 : class er;
17 : } // namespace PUP
18 : /// \endcond
19 :
20 : namespace Punctures {
21 :
22 : /*!
23 : * \brief Add the nonlinear sources for the puncture equation.
24 : *
25 : * Adds $-\beta \left(\alpha \left(1 + u\right) + 1\right)^{-7}$.
26 : *
27 : * \see Punctures
28 : */
29 1 : void add_sources(gsl::not_null<Scalar<DataVector>*> puncture_equation,
30 : const Scalar<DataVector>& alpha,
31 : const Scalar<DataVector>& beta,
32 : const Scalar<DataVector>& field);
33 :
34 : /*!
35 : * \brief Add the linearized sources for the puncture equation.
36 : *
37 : * Adds $-\frac{d}{du}(\beta \left(\alpha \left(1 + u\right) + 1\right)^{-7})$.
38 : *
39 : * \see Punctures
40 : */
41 1 : void add_linearized_sources(
42 : gsl::not_null<Scalar<DataVector>*> linearized_puncture_equation,
43 : const Scalar<DataVector>& alpha, const Scalar<DataVector>& beta,
44 : const Scalar<DataVector>& field,
45 : const Scalar<DataVector>& field_correction);
46 :
47 : /// The sources \f$S\f$ for the first-order formulation of the puncture equation
48 : ///
49 : /// \see elliptic::protocols::FirstOrderSystem
50 1 : struct Sources {
51 0 : using argument_tags = tmpl::list<Tags::Alpha, Tags::Beta>;
52 0 : using const_global_cache_tags = tmpl::list<>;
53 0 : static void apply(gsl::not_null<Scalar<DataVector>*> puncture_equation,
54 : const Scalar<DataVector>& alpha,
55 : const Scalar<DataVector>& beta,
56 : const Scalar<DataVector>& field,
57 : const tnsr::i<DataVector, 3>& /*field_gradient*/,
58 : const tnsr::I<DataVector, 3>& field_flux);
59 : };
60 :
61 : /// The linearization of the sources \f$S\f$ for the first-order formulation of
62 : /// the puncture equation
63 : ///
64 : /// \see elliptic::protocols::FirstOrderSystem
65 1 : struct LinearizedSources {
66 0 : using argument_tags = tmpl::list<Tags::Alpha, Tags::Beta, Tags::Field>;
67 0 : using const_global_cache_tags = tmpl::list<>;
68 0 : static void apply(
69 : gsl::not_null<Scalar<DataVector>*> linearized_puncture_equation,
70 : const Scalar<DataVector>& alpha, const Scalar<DataVector>& beta,
71 : const Scalar<DataVector>& field,
72 : const Scalar<DataVector>& field_correction,
73 : const tnsr::i<DataVector, 3>& /*field_gradient_correction*/,
74 : const tnsr::I<DataVector, 3>& field_flux_correction);
75 : };
76 :
77 : } // namespace Punctures
|