Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <array> 7 : #include <optional> 8 : 9 : #include "Time/Tags/VariableOrderAlgorithm.hpp" 10 : #include "Utilities/TMPL.hpp" 11 : #include "Utilities/TypeTraits/IsA.hpp" 12 : 13 : /// \cond 14 : struct StepperErrorEstimate; 15 : class TimeStepId; 16 : class TimeStepper; 17 : class VariableOrderAlgorithm; 18 : namespace Tags { 19 : template <typename Tag> 20 : struct HistoryEvolvedVariables; 21 : template <typename Tag> 22 : struct Next; 23 : template <typename Tag> 24 : struct StepperErrors; 25 : struct TimeStepId; 26 : template <typename StepperInterface> 27 : struct TimeStepper; 28 : } // namespace Tags 29 : namespace TimeSteppers { 30 : template <typename Vars> 31 : class History; 32 : } // namespace TimeSteppers 33 : namespace gsl { 34 : template <class T> 35 : class not_null; 36 : } // namespace gsl 37 : /// \endcond 38 : 39 : /*! 40 : * \ingroup TimeGroup 41 : * \brief Adjust the step order for local time-stepping 42 : * 43 : * \details See VariableOrderAlgorithm for descriptions of the 44 : * algorithms. This mutator wraps that class, checking that the order 45 : * is not changed out of the valid range for the time stepper. 46 : */ 47 : /// @{ 48 : template <typename System, 49 : typename = tmpl::conditional_t< 50 : tt::is_a_v<tmpl::list, typename System::variables_tag>, 51 : typename System::variables_tag, 52 : tmpl::list<typename System::variables_tag>>> 53 1 : struct ChangeTimeStepperOrder; 54 : 55 : template <typename System, typename... VariablesTags> 56 0 : struct ChangeTimeStepperOrder<System, tmpl::list<VariablesTags...>> { 57 0 : using const_global_cache_tags = tmpl::list<Tags::VariableOrderAlgorithm>; 58 0 : using return_tags = 59 : tmpl::list<Tags::HistoryEvolvedVariables<VariablesTags>...>; 60 0 : using argument_tags = 61 : tmpl::list<Tags::TimeStepper<TimeStepper>, Tags::VariableOrderAlgorithm, 62 : Tags::Next<Tags::TimeStepId>, 63 : Tags::StepperErrors<VariablesTags>...>; 64 : 65 0 : static void apply( 66 : const gsl::not_null< 67 : TimeSteppers::History<typename VariablesTags::type>*>... histories, 68 : const TimeStepper& time_stepper, 69 : const VariableOrderAlgorithm& order_algorithm, 70 : const TimeStepId& next_time_step_id, 71 : const typename tmpl::has_type< 72 : VariablesTags, 73 : std::array<std::optional<StepperErrorEstimate>, 2>>::type&... errors); 74 : }; 75 : /// @}