41#ifndef NEKTAR_LIB_UTILITIES_TIME_INTEGRATION_RK_TIME_INTEGRATION_SCHEME
42#define NEKTAR_LIB_UTILITIES_TIME_INTEGRATION_RK_TIME_INTEGRATION_SCHEME
44#define LUE LIB_UTILITIES_EXPORT
46#include <boost/core/ignore_unused.hpp>
60 std::vector<NekDouble> freeParams)
63 ASSERTL1(variant ==
"" || variant ==
"SSP",
64 "Runge Kutta Time integration scheme unknown variant: " +
65 variant +
". Must be blank or 'SSP'");
69 ASSERTL1((variant ==
"" && 1 <= order && order <= 5) ||
70 (variant ==
"SSP" && 1 <= order && order <= 3),
71 "Runge Kutta Time integration scheme bad order, "
72 "Std (1-5) or SSP (1-3): " +
73 std::to_string(order));
88 std::string variant,
size_t order, std::vector<NekDouble> freeParams)
92 variant, order, freeParams);
101 size_t order, [[maybe_unused]] std::vector<NekDouble> freeParams)
103 constexpr size_t nStages[6] = {0, 1, 2, 3, 4, 6};
115 constexpr NekDouble Acoefficients[2][6][15] =
116 { { { 0., 0., 0., 0., 0.,
118 0., 0., 0., 0., 0. },
120 { 0., 0., 0., 0., 0.,
122 0., 0., 0., 0., 0. },
127 0., 0., 0., 0., 0. },
133 0., 0., 0., 0., 0. },
139 0., 0., 0., 0., 0. },
148 3./16., 0., 0., 9./16.,
149 -3./7., 2./7., 12./7., -12./7., 8./7. } },
151 { { 0., 0., 0., 0., 0.,
153 0., 0., 0., 0., 0. },
155 { 0., 0., 0., 0., 0.,
157 0., 0., 0., 0., 0. },
162 0., 0., 0., 0., 0. },
168 0., 0., 0., 0., 0. },
174 0., 0., 0., 0., 0. },
183 3./16., 0., 0., 9./16.,
184 -3./7., 2./7., 12./7., -12./7., 8./7. } } };
190 constexpr NekDouble Bcoefficients[2][6][6] =
191 { { { 0., 0., 0., 0., 0., 0. },
193 { 1., 0., 0., 0., 0., 0. },
195 { 0., 1., 0., 0., 0., 0. },
197 { 2./9., 3./9., 4./9., 0., 0., 0. },
199 { 1./6., 2./6., 2./6., 1./6., 0., 0. },
205 { 7./90., 0., 32./90., 12./90., 32./90., 7./90.} },
207 { { 0., 0., 0., 0., 0., 0. },
209 { 1., 0., 0., 0., 0., 0. },
211 { 1./2., 1./2., 0., 0., 0., 0. },
213 { 1./6., 1./6., 4./6., 0., 0., 0. },
215 { 1./6., 2./6., 2./6., 1./6., 0., 0. },
221 { 7./90., 0., 32./90., 12./90., 32./90., 7./90. } } };
224 size_t index = (variant ==
"SSP" || variant ==
"ImprovedEuler");
227 phase->m_variant = variant;
228 phase->m_order = order;
229 phase->m_name = std::string(
"RungeKutta") + phase->m_variant +
230 std::string(
"Order") + std::to_string(phase->m_order);
232 phase->m_numsteps = 1;
233 phase->m_numstages = nStages[phase->m_order];
252 for (
size_t s = 1; s < phase->m_numstages; ++s)
254 for (
size_t i = 0; i < s; ++i)
256 phase->m_A[0][s][i] =
257 Acoefficients[index][phase->m_order][cc++];
262 for (
size_t n = 0; n < phase->m_numstages; ++n)
264 phase->m_B[0][0][n] = Bcoefficients[index][phase->m_order][n];
267 phase->m_numMultiStepValues = 1;
268 phase->m_numMultiStepImplicitDerivs = 0;
269 phase->m_numMultiStepExplicitDerivs = 0;
271 phase->m_timeLevelOffset[0] = 0;
273 phase->CheckAndVerify();
279 return std::string(
"RungeKutta");
290 return 2.51274532661833;
299 return 3.21704786664011;
315 std::vector<NekDouble> freeParams)
318 boost::ignore_unused(variant, order);
322 [[maybe_unused]] std::string variant, [[maybe_unused]]
size_t order,
323 std::vector<NekDouble> freeParams)
342 std::vector<NekDouble> freeParams)
345 boost::ignore_unused(variant, order);
349 [[maybe_unused]] std::string variant, [[maybe_unused]]
size_t order,
350 std::vector<NekDouble> freeParams)
369 std::vector<NekDouble> freeParams)
372 boost::ignore_unused(variant, order);
376 [[maybe_unused]] std::string variant, [[maybe_unused]]
size_t order,
377 std::vector<NekDouble> freeParams)
397 std::vector<NekDouble> freeParams)
400 boost::ignore_unused(variant, order);
404 [[maybe_unused]] std::string variant, [[maybe_unused]]
size_t order,
405 std::vector<NekDouble> freeParams)
425 std::vector<NekDouble> freeParams)
441 std::vector<NekDouble> freeParams)
444 boost::ignore_unused(variant, order);
448 [[maybe_unused]] std::string variant, [[maybe_unused]]
size_t order,
449 std::vector<NekDouble> freeParams)
469 std::string variant,
size_t order, std::vector<NekDouble> freeParams)
472 boost::ignore_unused(variant, order);
476 [[maybe_unused]] std::string variant, [[maybe_unused]]
size_t order,
477 std::vector<NekDouble> freeParams)
481 "SSP", 2, freeParams);
497 std::vector<NekDouble> freeParams)
500 boost::ignore_unused(variant, order);
504 [[maybe_unused]] std::string variant, [[maybe_unused]]
size_t order,
505 std::vector<NekDouble> freeParams)
509 "SSP", 2, freeParams);
525 std::vector<NekDouble> freeParams)
528 boost::ignore_unused(variant, order);
532 [[maybe_unused]] std::string variant, [[maybe_unused]]
size_t order,
533 std::vector<NekDouble> freeParams)
537 "SSP", 3, freeParams);
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
ClassicalRungeKutta4TimeIntegrationScheme(std::string variant, size_t order, std::vector< NekDouble > freeParams)
static std::string className
static TimeIntegrationSchemeSharedPtr create(std::string variant, size_t order, std::vector< NekDouble > freeParams)
static std::string TimeIntegrationMethodLookupId
static std::string className
static std::string TimeIntegrationMethodLookupId
RungeKutta1TimeIntegrationScheme(std::string variant, size_t order, std::vector< NekDouble > freeParams)
static TimeIntegrationSchemeSharedPtr create(std::string variant, size_t order, std::vector< NekDouble > freeParams)
static TimeIntegrationSchemeSharedPtr create(std::string variant, size_t order, std::vector< NekDouble > freeParams)
static std::string className
RungeKutta2_ImprovedEulerTimeIntegrationScheme(std::string variant, size_t order, std::vector< NekDouble > freeParams)
static std::string TimeIntegrationMethodLookupId
static TimeIntegrationSchemeSharedPtr create(std::string variant, size_t order, std::vector< NekDouble > freeParams)
RungeKutta2_SSPTimeIntegrationScheme(std::string variant, size_t order, std::vector< NekDouble > freeParams)
static std::string className
static std::string TimeIntegrationMethodLookupId
static TimeIntegrationSchemeSharedPtr create(std::string variant, size_t order, std::vector< NekDouble > freeParams)
static std::string TimeIntegrationMethodLookupId
static std::string className
RungeKutta2TimeIntegrationScheme(std::string variant, size_t order, std::vector< NekDouble > freeParams)
static TimeIntegrationSchemeSharedPtr create(std::string variant, size_t order, std::vector< NekDouble > freeParams)
RungeKutta3_SSPTimeIntegrationScheme(std::string variant, size_t order, std::vector< NekDouble > freeParams)
static std::string className
static std::string TimeIntegrationMethodLookupId
static std::string className
RungeKutta3TimeIntegrationScheme(std::string variant, size_t order, std::vector< NekDouble > freeParams)
static std::string TimeIntegrationMethodLookupId
static TimeIntegrationSchemeSharedPtr create(std::string variant, size_t order, std::vector< NekDouble > freeParams)
static std::string TimeIntegrationMethodLookupId
static std::string className
RungeKutta4TimeIntegrationScheme(std::string variant, size_t order, std::vector< NekDouble > freeParams)
RungeKutta5TimeIntegrationScheme(std::string variant, size_t order, std::vector< NekDouble > freeParams)
static std::string TimeIntegrationMethodLookupId
static TimeIntegrationSchemeSharedPtr create(std::string variant, size_t order, std::vector< NekDouble > freeParams)
static std::string className
static LUE void SetupSchemeData(TimeIntegrationAlgorithmGLMSharedPtr &phase, std::string variant, size_t order, std::vector< NekDouble > freeParams)
~RungeKuttaTimeIntegrationScheme() override
static TimeIntegrationSchemeSharedPtr create(std::string variant, size_t order, std::vector< NekDouble > freeParams)
LUE std::string v_GetName() const override
static std::string className
LUE NekDouble v_GetTimeStability() const override
RungeKuttaTimeIntegrationScheme(std::string variant, size_t order, std::vector< NekDouble > freeParams)
Base class for GLM time integration schemes.
TimeIntegrationAlgorithmGLMVector m_integration_phases
LUE size_t GetOrder() const
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< TimeIntegrationAlgorithmGLM > TimeIntegrationAlgorithmGLMSharedPtr
@ eExplicit
Formally explicit scheme.
std::vector< TimeIntegrationAlgorithmGLMSharedPtr > TimeIntegrationAlgorithmGLMVector
std::shared_ptr< TimeIntegrationScheme > TimeIntegrationSchemeSharedPtr