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/DataBox/Protocols/Mutator.hpp" 9 : #include "DataStructures/DataVector.hpp" 10 : #include "DataStructures/Tensor/Tensor.hpp" 11 : #include "Domain/Tags.hpp" 12 : #include "Evolution/Systems/CurvedScalarWave/Tags.hpp" 13 : #include "Utilities/ProtocolHelpers.hpp" 14 : 15 0 : namespace CurvedScalarWave::Worldtube::Initialization { 16 : 17 : /*! 18 : * \ingroup InitializationGroup 19 : * \brief Initializes the constraint damping parameters \f$\gamma_1\f$ and 20 : * \f$\gamma_2\f$. 21 : * 22 : * \details The constraint damping parameters of the CurvedScalarWave system 23 : * are initialized according to a Gaussian 24 : * \f{align*} 25 : * \gamma_1 &= 0 \\ 26 : * \gamma_2 &= A e^{-(\sigma r)^2 } + c, 27 : * \f} 28 : * where \f$r = \sqrt{\delta_{ij} x^i x^j}\f$ and with \f$A = 10\f$, \f$\sigma = 29 : * 10^{-1}\f$, \f$c = 10^{-4}\f$. These values were experimentally found to 30 : * ensure a stable evolution when using the worldtube scheme. 31 : * 32 : * DataBox changes: 33 : * - Adds: 34 : * * `CurvedScalarWave::Tags::ConstraintGamma1` 35 : * * `CurvedScalarWave::Tags::ConstraintGamma2` 36 : * - Removes: nothing 37 : * - Modifies: nothing 38 : */ 39 : template <size_t Dim> 40 1 : struct InitializeConstraintDampingGammas 41 : : tt::ConformsTo<db::protocols::Mutator> { 42 0 : using return_tags = tmpl::list<CurvedScalarWave::Tags::ConstraintGamma1, 43 : CurvedScalarWave::Tags::ConstraintGamma2>; 44 0 : using argument_tags = 45 : tmpl::list<domain::Tags::Coordinates<Dim, Frame::Inertial>>; 46 0 : using simple_tags = return_tags; 47 0 : using compute_tags = tmpl::list<>; 48 0 : using simple_tags_from_options = tmpl::list<>; 49 0 : using const_global_cache_tags = tmpl::list<>; 50 0 : using mutable_global_cache_tags = tmpl::list<>; 51 0 : static void apply( 52 : const gsl::not_null<Scalar<DataVector>*> gamma1, 53 : const gsl::not_null<Scalar<DataVector>*> gamma2, 54 : const tnsr::I<DataVector, Dim, Frame::Inertial>& inertial_coords); 55 : }; 56 : } // namespace CurvedScalarWave::Worldtube::Initialization