Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <limits> 7 : #include <pup.h> 8 : #include <string> 9 : 10 : #include "DataStructures/DataVector.hpp" 11 : #include "DataStructures/Tensor/Tensor.hpp" 12 : #include "Options/String.hpp" 13 : #include "PointwiseFunctions/ScalarTensor/ScalarGaussBonnet/CouplingFunctions/CouplingFunction.hpp" 14 : #include "Utilities/Gsl.hpp" 15 : #include "Utilities/Serialization/CharmPupable.hpp" 16 : #include "Utilities/TMPL.hpp" 17 : 18 : namespace ScalarTensor::sgb::CouplingFunctions { 19 : 20 : /*! 21 : * \brief Coupling function of exponential type. 22 : * 23 : * \details The functional form of this coupling is 24 : * \f$F[\Psi] = \lambda e^{\gamma \Psi}\f$, where both \f$\lambda\f$ and 25 : * \f$\gamma\f$ are dimensionless. 26 : * 27 : * In the case of exponential coupling the theory does not admit the Kerr metric 28 : * as a stationary solution, and spontaneous scalarization cannot take place. 29 : * For this type of coupling the theory is also referred to as 30 : * _Einstein-dilaton-Gauss-Bonnet_. 31 : */ 32 1 : class Exponential : public CouplingFunction { 33 : public: 34 0 : static constexpr Options::String help = { 35 : "Coupling function of exponential type"}; 36 : 37 0 : struct Lambda { 38 0 : using type = double; 39 0 : static constexpr Options::String help = { 40 : "The numerical dimensionless coefficient in front of the exponential"}; 41 0 : static std::string name() { return "lambda"; } 42 : }; 43 : 44 0 : struct Gamma { 45 0 : using type = double; 46 0 : static constexpr Options::String help = { 47 : "The numerical dimensionless coefficient in the exponent"}; 48 0 : static std::string name() { return "gamma"; } 49 : }; 50 : 51 0 : using options = tmpl::list<Lambda, Gamma>; 52 : 53 0 : Exponential() = default; 54 0 : Exponential(double lambda, double gamma); 55 0 : Exponential(const Exponential&) = default; 56 0 : Exponential& operator=(const Exponential&) = default; 57 0 : Exponential(Exponential&&) = default; 58 0 : Exponential& operator=(Exponential&&) = default; 59 0 : ~Exponential() override = default; 60 : 61 0 : explicit Exponential(CkMigrateMessage* m) : CouplingFunction(m) {} 62 0 : WRAPPED_PUPable_decl_template(Exponential); 63 0 : void pup(PUP::er& p) override; 64 : 65 0 : double get_lambda() const { return lambda_; } 66 0 : double get_gamma() const { return gamma_; } 67 : 68 : protected: 69 : /*! 70 : * \brief Specialization of the function that evaluates the coupling function 71 : * on a scalar field profile. 72 : * 73 : * It returns the profile \f$F[\Psi] = \lambda e^{- \gamma \Psi}\f$. 74 : */ 75 1 : void coupling_function_impl( 76 : gsl::not_null<Scalar<DataVector>*> function_values, 77 : const Scalar<DataVector>& scalar_field) const override; 78 : 79 : /*! 80 : * \brief Specialization of the function that evaluates the first functional 81 : * derivative of the coupling function on a scalar field profile. 82 : * 83 : * It returns the profile 84 : * \f$\frac{\delta F[\Psi]}{\delta \Psi} 85 : * = - \gamma \lambda e^{- \gamma \Psi}\f$. 86 : */ 87 1 : void coupling_function_prime_impl( 88 : gsl::not_null<Scalar<DataVector>*> function_values, 89 : const Scalar<DataVector>& scalar_field) const override; 90 : 91 : /*! 92 : * \brief Specialization of the function that evaluates the second functional 93 : * derivative of the coupling function on a scalar field profile. 94 : * 95 : * It returns the profile 96 : * \f$\frac{\delta^2 F[\Psi]}{\delta \Psi^2} 97 : * = \gamma^2 \lambda e^{- \gamma \Psi}\f$. 98 : */ 99 1 : void coupling_function_prime_prime_impl( 100 : gsl::not_null<Scalar<DataVector>*> function_values, 101 : const Scalar<DataVector>& scalar_field) const override; 102 : 103 : private: 104 : /*! 105 : * \brief Coupling constant \f$\lambda\f$, appearing as a global factor in 106 : * the coupling function. 107 : */ 108 1 : double lambda_{std::numeric_limits<double>::signaling_NaN()}; 109 : 110 : /*! 111 : * \brief Coupling constant \f$\gamma\f$, appearing in the exponent of 112 : * the coupling function. 113 : */ 114 1 : double gamma_{std::numeric_limits<double>::signaling_NaN()}; 115 : }; 116 : 117 : } // namespace ScalarTensor::sgb::CouplingFunctions