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 "Time/StepChoosers/Cfl.hpp" 9 : #include "Time/StepChoosers/Constant.hpp" 10 : #include "Time/StepChoosers/ElementSizeCfl.hpp" 11 : #include "Time/StepChoosers/ErrorControl.hpp" 12 : #include "Time/StepChoosers/LimitIncrease.hpp" 13 : #include "Time/StepChoosers/Maximum.hpp" 14 : #include "Time/StepChoosers/PreventRapidIncrease.hpp" 15 : #include "Time/StepChoosers/StepToTimes.hpp" 16 : #include "Utilities/TMPL.hpp" 17 : 18 : /// \cond 19 : namespace Frame { 20 : struct Inertial; 21 : } // namespace Frame 22 : /// \endcond 23 : 24 : namespace StepChoosers { 25 : namespace Factory_detail { 26 : template <typename System, bool HasCharSpeedFunctions> 27 : using common_step_choosers = tmpl::push_back< 28 : tmpl::conditional_t< 29 : HasCharSpeedFunctions, 30 : tmpl::list<StepChoosers::Cfl<Frame::Inertial, System>, 31 : StepChoosers::ElementSizeCfl<System::volume_dim, System>>, 32 : tmpl::list<>>, 33 : StepChoosers::Constant, StepChoosers::LimitIncrease, StepChoosers::Maximum>; 34 : template <typename Use, typename System> 35 : using step_choosers_for_step_only = tmpl::list< 36 : StepChoosers::PreventRapidIncrease<typename System::variables_tag>, 37 : StepChoosers::ErrorControl<Use, typename System::variables_tag>>; 38 : using step_choosers_for_slab_only = tmpl::list<StepChoosers::StepToTimes>; 39 : 40 : template <typename System, bool HasCharSpeedFunctions> 41 : using lts_slab_choosers = 42 : tmpl::append<common_step_choosers<System, HasCharSpeedFunctions>, 43 : step_choosers_for_slab_only>; 44 : } // namespace Factory_detail 45 : 46 : template <typename System, bool HasCharSpeedFunctions = true> 47 0 : using standard_step_choosers = tmpl::append< 48 : Factory_detail::common_step_choosers<System, HasCharSpeedFunctions>, 49 : Factory_detail::step_choosers_for_step_only<StepChooserUse::LtsStep, 50 : System>>; 51 : 52 : template <typename System, bool LocalTimeStepping, 53 : bool HasCharSpeedFunctions = true> 54 0 : using standard_slab_choosers = tmpl::conditional_t< 55 : LocalTimeStepping, 56 : Factory_detail::lts_slab_choosers<System, HasCharSpeedFunctions>, 57 : tmpl::append< 58 : Factory_detail::lts_slab_choosers<System, HasCharSpeedFunctions>, 59 : Factory_detail::step_choosers_for_step_only<StepChooserUse::Slab, 60 : System>>>; 61 : } // namespace StepChoosers