Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include "Utilities/TMPL.hpp" 7 : #include "Utilities/TypeTraits/IsA.hpp" 8 : 9 : /// \cond 10 : class TimeStepper; 11 : namespace Tags { 12 : template <typename StepperInterface> 13 : struct TimeStepper; 14 : template <typename Tag> 15 : struct HistoryEvolvedVariables; 16 : } // namespace Tags 17 : namespace TimeSteppers { 18 : template <typename Vars> 19 : class History; 20 : } // namespace TimeSteppers 21 : namespace gsl { 22 : template <class T> 23 : class not_null; 24 : } // namespace gsl 25 : /// \endcond 26 : 27 : /// \ingroup TimeGroup 28 : /// \brief Clean time stepper history after a substep 29 : /// @{ 30 : template <typename System, 31 : typename = tmpl::conditional_t< 32 : tt::is_a_v<tmpl::list, typename System::variables_tag>, 33 : typename System::variables_tag, 34 : tmpl::list<typename System::variables_tag>>> 35 1 : struct CleanHistory; 36 : 37 : template <typename System, typename... VariablesTags> 38 0 : struct CleanHistory<System, tmpl::list<VariablesTags...>> { 39 0 : using return_tags = 40 : tmpl::list<Tags::HistoryEvolvedVariables<VariablesTags>...>; 41 0 : using argument_tags = tmpl::list<Tags::TimeStepper<TimeStepper>>; 42 : 43 0 : static void apply( 44 : const gsl::not_null< 45 : TimeSteppers::History<typename VariablesTags::type>*>... histories, 46 : const TimeStepper& time_stepper); 47 : }; 48 : /// @}