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/Variables.hpp" 9 : #include "Evolution/Systems/NewtonianEuler/Fluxes.hpp" 10 : #include "Utilities/Gsl.hpp" 11 : #include "Utilities/TMPL.hpp" 12 : 13 1 : namespace NewtonianEuler::subcell { 14 : namespace detail { 15 : template <size_t Dim, typename TagsList, typename... ReturnTags, 16 : typename... ArgumentTags> 17 : void compute_fluxes_impl(const gsl::not_null<Variables<TagsList>*> vars, 18 : tmpl::list<ReturnTags...> /*meta*/, 19 : tmpl::list<ArgumentTags...> /*meta*/) { 20 : NewtonianEuler::ComputeFluxes<Dim>::apply( 21 : make_not_null(&get<ReturnTags>(*vars))..., get<ArgumentTags>(*vars)...); 22 : } 23 : } // namespace detail 24 : 25 : /*! 26 : * \brief Helper function that calls `ComputeFluxes` by retrieving the return 27 : * and argument tags from `vars`. 28 : */ 29 : template <size_t Dim, typename TagsList> 30 1 : void compute_fluxes(const gsl::not_null<Variables<TagsList>*> vars) { 31 : detail::compute_fluxes_impl<Dim>( 32 : vars, typename NewtonianEuler::ComputeFluxes<Dim>::return_tags{}, 33 : typename NewtonianEuler::ComputeFluxes<Dim>::argument_tags{}); 34 : } 35 : } // namespace NewtonianEuler::subcell