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 : static void apply(gsl::not_null<Scalar<DataVector>*> puncture_equation, 53 : const Scalar<DataVector>& alpha, 54 : const Scalar<DataVector>& beta, 55 : const Scalar<DataVector>& field, 56 : const tnsr::I<DataVector, 3>& field_flux); 57 : }; 58 : 59 : /// The linearization of the sources \f$S\f$ for the first-order formulation of 60 : /// the puncture equation 61 : /// 62 : /// \see elliptic::protocols::FirstOrderSystem 63 1 : struct LinearizedSources { 64 0 : using argument_tags = tmpl::list<Tags::Alpha, Tags::Beta, Tags::Field>; 65 0 : static void apply( 66 : gsl::not_null<Scalar<DataVector>*> linearized_puncture_equation, 67 : const Scalar<DataVector>& alpha, const Scalar<DataVector>& beta, 68 : const Scalar<DataVector>& field, 69 : const Scalar<DataVector>& field_correction, 70 : const tnsr::I<DataVector, 3>& field_flux_correction); 71 : }; 72 : 73 : } // namespace Punctures