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 : #include <string> 8 : 9 : #include "DataStructures/DataBox/Tag.hpp" 10 : #include "DataStructures/DataVector.hpp" 11 : #include "DataStructures/Tensor/Tensor.hpp" 12 : #include "Evolution/Systems/CurvedScalarWave/TagsDeclarations.hpp" 13 : #include "Utilities/Gsl.hpp" 14 : 15 : namespace CurvedScalarWave::Tags { 16 : /*! 17 : * \brief The square of the scalar field \f$\Psi\f$. 18 : */ 19 1 : struct PsiSquared : db::SimpleTag { 20 0 : using type = Scalar<DataVector>; 21 : }; 22 : 23 : /*! 24 : * \brief Compute tag that calculates the square of the scalar field \f$\Psi\f$. 25 : */ 26 1 : struct PsiSquaredCompute : PsiSquared, db::ComputeTag { 27 0 : using base = PsiSquared; 28 0 : using return_type = Scalar<DataVector>; 29 0 : using argument_tags = tmpl::list<CurvedScalarWave::Tags::Psi>; 30 0 : static void function(const gsl::not_null<Scalar<DataVector>*> psi_squared, 31 : const Scalar<DataVector>& psi) { 32 : get(*psi_squared) = get(psi) * get(psi); 33 : } 34 : }; 35 : } // namespace CurvedScalarWave::Tags