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/TaggedVariant.hpp" 9 : #include "Options/String.hpp" 10 : #include "Time/TimeSteppers/RungeKutta.hpp" 11 : #include "Utilities/Serialization/CharmPupable.hpp" 12 : #include "Utilities/TMPL.hpp" 13 : 14 : namespace TimeSteppers { 15 : /*! 16 : * \ingroup TimeSteppersGroup 17 : * \brief A fifth order RK method constructed with fewer restrictions 18 : * on its coefficients than is common. On a standard test suite, it 19 : * was found to be roughly 10% more efficient than 20 : * DormandPrince5.\cite Tsitouras2011. 21 : * 22 : * The CFL stable step size is 1.7534234969024887. 23 : */ 24 1 : class Rk5Tsitouras : public RungeKutta { 25 : public: 26 0 : using options = tmpl::list<>; 27 0 : static constexpr Options::String help = { 28 : "An efficient 5th-order Runge-Kutta time stepper."}; 29 : 30 0 : Rk5Tsitouras() = default; 31 0 : Rk5Tsitouras(const Rk5Tsitouras&) = default; 32 0 : Rk5Tsitouras& operator=(const Rk5Tsitouras&) = default; 33 0 : Rk5Tsitouras(Rk5Tsitouras&&) = default; 34 0 : Rk5Tsitouras& operator=(Rk5Tsitouras&&) = default; 35 0 : ~Rk5Tsitouras() override = default; 36 : 37 1 : variants::TaggedVariant<Tags::FixedOrder, Tags::VariableOrder> order() 38 : const override; 39 : 40 1 : double stable_step() const override; 41 : 42 0 : WRAPPED_PUPable_decl_template(Rk5Tsitouras); // NOLINT 43 : 44 0 : explicit Rk5Tsitouras(CkMigrateMessage* /*msg*/); 45 : 46 0 : const ButcherTableau& butcher_tableau() const override; 47 : }; 48 : 49 0 : inline bool constexpr operator==(const Rk5Tsitouras& /*lhs*/, 50 : const Rk5Tsitouras& /*rhs*/) { 51 : return true; 52 : } 53 : 54 0 : inline bool constexpr operator!=(const Rk5Tsitouras& /*lhs*/, 55 : const Rk5Tsitouras& /*rhs*/) { 56 : return false; 57 : } 58 : } // namespace TimeSteppers