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/StepperErrorTolerancesCompute.hpp" 10 : #include "Time/Tags/StepperErrors.hpp" 11 : #include "Utilities/TMPL.hpp" 12 : #include "Utilities/TypeTraits/IsA.hpp" 13 : 14 : /// \cond 15 : struct StepperErrorEstimate; 16 : struct StepperErrorTolerances; 17 : class TimeDelta; 18 : class TimeStepId; 19 : class TimeStepper; 20 : namespace Tags { 21 : template <typename Tag> 22 : struct HistoryEvolvedVariables; 23 : template <typename Tag> 24 : struct Next; 25 : struct StepperErrorEstimatesEnabled; 26 : template <typename Tag> 27 : struct StepperErrorTolerances; 28 : struct TimeStep; 29 : struct TimeStepId; 30 : template <typename StepperInterface> 31 : struct TimeStepper; 32 : } // namespace Tags 33 : namespace TimeSteppers { 34 : template <typename Vars> 35 : class History; 36 : } // namespace TimeSteppers 37 : namespace gsl { 38 : template <class T> 39 : class not_null; 40 : } // namespace gsl 41 : /// \endcond 42 : 43 : /// \ingroup TimeGroup 44 : /// \brief Perform variable updates for one substep 45 : /// @{ 46 : template <typename System, bool LocalTimeStepping, 47 : typename = tmpl::conditional_t< 48 : tt::is_a_v<tmpl::list, typename System::variables_tag>, 49 : typename System::variables_tag, 50 : tmpl::list<typename System::variables_tag>>> 51 1 : struct UpdateU; 52 : 53 : template <typename System, bool LocalTimeStepping, typename... VariablesTags> 54 0 : struct UpdateU<System, LocalTimeStepping, tmpl::list<VariablesTags...>> { 55 0 : using simple_tags = tmpl::list<::Tags::StepperErrors<VariablesTags>...>; 56 0 : using compute_tags = tmpl::list< 57 : Tags::StepperErrorEstimatesEnabledCompute<LocalTimeStepping>, 58 : Tags::StepperErrorTolerancesCompute<VariablesTags, LocalTimeStepping>...>; 59 : 60 0 : using return_tags = 61 : tmpl::list<VariablesTags..., Tags::StepperErrors<VariablesTags>...>; 62 0 : using argument_tags = 63 : tmpl::list<Tags::TimeStepper<TimeStepper>, Tags::TimeStepId, 64 : Tags::Next<Tags::TimeStepId>, Tags::TimeStep, 65 : Tags::StepperErrorEstimatesEnabled, 66 : Tags::HistoryEvolvedVariables<VariablesTags>..., 67 : Tags::StepperErrorTolerances<VariablesTags>...>; 68 : 69 0 : static void apply( 70 : const gsl::not_null<typename VariablesTags::type*>... vars, 71 : const typename tmpl::has_type< 72 : VariablesTags, 73 : gsl::not_null<std::array<std::optional<StepperErrorEstimate>, 2>*>>:: 74 : type... errors, 75 : const TimeStepper& time_stepper, const TimeStepId& time_step_id, 76 : const TimeStepId& next_time_step_id, const TimeDelta& time_step, 77 : bool error_estimates_enabled, 78 : const TimeSteppers::History<typename VariablesTags::type>&... histories, 79 : const typename tmpl::has_type< 80 : VariablesTags, StepperErrorTolerances>::type&... tolerances); 81 : }; 82 : /// @}