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/Prefixes.hpp" 9 : #include "DataStructures/DataBox/Tag.hpp" 10 : #include "DataStructures/DataVector.hpp" 11 : #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" 12 : #include "DataStructures/Tensor/Tensor.hpp" 13 : #include "Domain/FunctionsOfTime/Tags.hpp" 14 : #include "Evolution/Systems/ScalarTensor/Tags.hpp" 15 : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" 16 : #include "PointwiseFunctions/ScalarTensor/ConstraintDampingTags.hpp" 17 : #include "Utilities/ContainerHelpers.hpp" 18 : #include "Utilities/Gsl.hpp" 19 : #include "Utilities/TMPL.hpp" 20 : 21 : /// \cond 22 : namespace Tags { 23 : struct Time; 24 : } // namespace Tags 25 : namespace domain::Tags { 26 : template <size_t Dim, typename Frame> 27 : struct Coordinates; 28 : } // namespace domain::Tags 29 : class DataVector; 30 : template <typename X, typename Symm, typename IndexList> 31 : class Tensor; 32 : /// \endcond 33 : 34 : namespace ScalarTensor::Tags { 35 : /*! 36 : * \brief Computes the constraint damping parameter \f$\gamma_1\f$ from the 37 : * coordinates and a DampingFunction. 38 : * 39 : * \details Can be retrieved using 40 : * `CurvedScalarWave::Tags::ConstraintGamma1`. 41 : */ 42 : template <size_t SpatialDim, typename Frame> 43 1 : struct ConstraintGamma1Compute : ::CurvedScalarWave::Tags::ConstraintGamma1, 44 : db::ComputeTag { 45 0 : using argument_tags = 46 : tmpl::list<DampingFunctionGamma1<SpatialDim, Frame>, 47 : domain::Tags::Coordinates<SpatialDim, Frame>, ::Tags::Time, 48 : ::domain::Tags::FunctionsOfTime>; 49 0 : using return_type = Scalar<DataVector>; 50 : 51 0 : static constexpr void function( 52 : const gsl::not_null<Scalar<DataVector>*> gamma, 53 : const ::ConstraintDamping::DampingFunction<SpatialDim, Frame>& 54 : damping_function, 55 : const tnsr::I<DataVector, SpatialDim, Frame>& coords, const double time, 56 : const std::unordered_map< 57 : std::string, 58 : std::unique_ptr<domain::FunctionsOfTime::FunctionOfTime>>& 59 : functions_of_time) { 60 : damping_function(gamma, coords, time, functions_of_time); 61 : } 62 : 63 0 : using base = ::CurvedScalarWave::Tags::ConstraintGamma1; 64 : }; 65 : 66 : /*! 67 : * \brief Computes the constraint damping parameter \f$\gamma_2\f$ from the 68 : * coordinates and a DampingFunction. 69 : * 70 : * \details Can be retrieved using 71 : * `CurvedScalarWave::::Tags::ConstraintGamma2`. 72 : */ 73 : template <size_t SpatialDim, typename Frame> 74 1 : struct ConstraintGamma2Compute : ::CurvedScalarWave::Tags::ConstraintGamma2, 75 : db::ComputeTag { 76 0 : using argument_tags = 77 : tmpl::list<DampingFunctionGamma2<SpatialDim, Frame>, 78 : domain::Tags::Coordinates<SpatialDim, Frame>, ::Tags::Time, 79 : ::domain::Tags::FunctionsOfTime>; 80 0 : using return_type = Scalar<DataVector>; 81 : 82 0 : static constexpr void function( 83 : const gsl::not_null<Scalar<DataVector>*> gamma, 84 : const ::ConstraintDamping::DampingFunction<SpatialDim, Frame>& 85 : damping_function, 86 : const tnsr::I<DataVector, SpatialDim, Frame>& coords, const double time, 87 : const std::unordered_map< 88 : std::string, 89 : std::unique_ptr<domain::FunctionsOfTime::FunctionOfTime>>& 90 : functions_of_time) { 91 : damping_function(gamma, coords, time, functions_of_time); 92 : } 93 : 94 0 : using base = ::CurvedScalarWave::Tags::ConstraintGamma2; 95 : }; 96 : } // namespace ScalarTensor::Tags