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/DataVector.hpp" 9 : #include "DataStructures/Tensor/Tensor.hpp" 10 : #include "Domain/Tags.hpp" 11 : #include "Evolution/Systems/SecondOrderScalarWave/Tags.hpp" 12 : #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp" 13 : #include "NumericalAlgorithms/Spectral/Mesh.hpp" 14 : #include "Utilities/Gsl.hpp" 15 : #include "Utilities/TMPL.hpp" 16 : 17 : namespace SecondOrderScalarWave { 18 : /*! 19 : * \brief Computes the auxiliary variable \f$\Phi_i = \partial_i \Psi\f$ 20 : * 21 : * \details In the LDG scheme, the auxiliary variable \f$\Phi_i\f$ is not 22 : * evolved in time but is recomputed from \f$\Psi\f$ at each substep. 23 : * After this mutator runs, the boundary correction from 24 : * `ApplyAuxiliaryBoundaryCorrectionsToVariables` will correct \f$\Phi_i\f$ 25 : * at element interfaces. 26 : */ 27 : template <size_t Dim> 28 1 : struct UpdateAuxiliaryVariables { 29 0 : using return_tags = tmpl::list<Tags::Phi<Dim>>; 30 0 : using argument_tags = 31 : tmpl::list<Tags::Psi, domain::Tags::Mesh<Dim>, 32 : domain::Tags::InverseJacobian<Dim, Frame::ElementLogical, 33 : Frame::Inertial>>; 34 : 35 0 : static void apply( 36 : const gsl::not_null<tnsr::i<DataVector, Dim, Frame::Inertial>*> phi, 37 : const Scalar<DataVector>& psi, const Mesh<Dim>& mesh, 38 : const InverseJacobian<DataVector, Dim, Frame::ElementLogical, 39 : Frame::Inertial>& inverse_jacobian) { 40 : partial_derivative(phi, psi, mesh, inverse_jacobian); 41 : } 42 : }; 43 : } // namespace SecondOrderScalarWave