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
51 namespace LibUtilities
61 std::vector<NekDouble> freeParams)
64 ASSERTL1(variant ==
"" || variant ==
"SSP",
65 "Runge Kutta Time integration scheme unknown variant: " +
66 variant +
". Must be blank or 'SSP'");
70 ASSERTL1((variant ==
"" && 1 <= order && order <= 5) ||
71 (variant ==
"SSP" && 1 <= order && order <= 3),
72 "Runge Kutta Time integration scheme bad order, "
73 "Std (1-5) or SSP (1-3): " +
74 std::to_string(order));
89 std::string variant,
unsigned int order,
90 std::vector<NekDouble> freeParams)
94 variant, order, freeParams);
102 std::string variant,
unsigned int order,
103 std::vector<NekDouble> freeParams)
105 boost::ignore_unused(freeParams);
107 const unsigned int nStages[6] = {0, 1, 2, 3, 4, 6};
119 const NekDouble Acoefficients[2][6][15] =
120 { { { 0., 0., 0., 0., 0.,
122 0., 0., 0., 0., 0. },
124 { 0., 0., 0., 0., 0.,
126 0., 0., 0., 0., 0. },
131 0., 0., 0., 0., 0. },
137 0., 0., 0., 0., 0. },
143 0., 0., 0., 0., 0. },
152 3./16., 0., 0., 9./16.,
153 -3./7., 2./7., 12./7., -12./7., 8./7. } },
155 { { 0., 0., 0., 0., 0.,
157 0., 0., 0., 0., 0. },
159 { 0., 0., 0., 0., 0.,
161 0., 0., 0., 0., 0. },
166 0., 0., 0., 0., 0. },
172 0., 0., 0., 0., 0. },
178 0., 0., 0., 0., 0. },
187 3./16., 0., 0., 9./16.,
188 -3./7., 2./7., 12./7., -12./7., 8./7. } } };
195 { { { 0., 0., 0., 0., 0., 0. },
197 { 1., 0., 0., 0., 0., 0. },
199 { 0., 1., 0., 0., 0., 0. },
201 { 2./9., 3./9., 4./9., 0., 0., 0. },
203 { 1./6., 2./6., 2./6., 1./6., 0., 0. },
209 { 7./90., 0., 32./90., 12./90., 32./90., 7./90.} },
211 { { 0., 0., 0., 0., 0., 0. },
213 { 1., 0., 0., 0., 0., 0. },
215 { 1./2., 1./2., 0., 0., 0., 0. },
217 { 1./6., 1./6., 4./6., 0., 0., 0. },
219 { 1./6., 2./6., 2./6., 1./6., 0., 0. },
225 { 7./90., 0., 32./90., 12./90., 32./90., 7./90. } } };
228 unsigned int index = (variant ==
"SSP" || variant ==
"ImprovedEuler");
231 phase->m_variant = variant;
232 phase->m_order = order;
233 phase->m_name = std::string(
"RungeKutta") + phase->m_variant +
234 std::string(
"Order") + std::to_string(phase->m_order);
236 phase->m_numsteps = 1;
237 phase->m_numstages = nStages[phase->m_order];
256 for (
int s = 1; s < phase->m_numstages; ++s)
258 for (
int i = 0; i < s; ++i)
260 phase->m_A[0][s][i] =
261 Acoefficients[index][phase->m_order][cc++];
266 for (
int n = 0; n < phase->m_numstages; ++n)
268 phase->m_B[0][0][n] = Bcoefficients[index][phase->m_order][n];
271 phase->m_numMultiStepValues = 1;
272 phase->m_numMultiStepImplicitDerivs = 0;
273 phase->m_numMultiStepDerivs = 0;
275 phase->m_timeLevelOffset[0] = 0;
277 phase->CheckAndVerify();
283 return std::string(
"RungeKutta");
306 std::vector<NekDouble> freeParams)
309 boost::ignore_unused(variant);
310 boost::ignore_unused(order);
314 std::string variant,
unsigned int order,
315 std::vector<NekDouble> freeParams)
317 boost::ignore_unused(variant);
318 boost::ignore_unused(order);
334 std::vector<NekDouble> freeParams)
337 boost::ignore_unused(variant);
338 boost::ignore_unused(order);
342 std::string variant,
unsigned int order,
343 std::vector<NekDouble> freeParams)
345 boost::ignore_unused(variant);
346 boost::ignore_unused(order);
362 std::vector<NekDouble> freeParams)
365 boost::ignore_unused(variant);
366 boost::ignore_unused(order);
370 std::string variant,
unsigned int order,
371 std::vector<NekDouble> freeParams)
373 boost::ignore_unused(variant);
374 boost::ignore_unused(order);
392 std::vector<NekDouble> freeParams)
395 boost::ignore_unused(variant);
396 boost::ignore_unused(order);
400 std::string variant,
unsigned int order,
401 std::vector<NekDouble> freeParams)
403 boost::ignore_unused(variant);
404 boost::ignore_unused(order);
421 std::vector<NekDouble> freeParams)
434 std::vector<NekDouble> freeParams)
437 boost::ignore_unused(variant);
438 boost::ignore_unused(order);
442 std::string variant,
unsigned int order,
443 std::vector<NekDouble> freeParams)
445 boost::ignore_unused(variant);
446 boost::ignore_unused(order);
463 std::string variant,
unsigned int order,
464 std::vector<NekDouble> freeParams)
467 boost::ignore_unused(variant);
468 boost::ignore_unused(order);
472 std::string variant,
unsigned int order,
473 std::vector<NekDouble> freeParams)
475 boost::ignore_unused(variant);
476 boost::ignore_unused(order);
480 "SSP", 2, freeParams);
494 std::vector<NekDouble> freeParams)
497 boost::ignore_unused(variant);
498 boost::ignore_unused(order);
502 std::string variant,
unsigned int order,
503 std::vector<NekDouble> freeParams)
505 boost::ignore_unused(variant);
506 boost::ignore_unused(order);
510 "SSP", 2, freeParams);
524 std::vector<NekDouble> freeParams)
527 boost::ignore_unused(variant);
528 boost::ignore_unused(order);
532 std::string variant,
unsigned int order,
533 std::vector<NekDouble> freeParams)
535 boost::ignore_unused(variant);
536 boost::ignore_unused(order);
540 "SSP", 3, freeParams);
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
static std::string className
ClassicalRungeKutta4TimeIntegrationScheme(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
static TimeIntegrationSchemeSharedPtr create(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
static TimeIntegrationSchemeSharedPtr create(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
static std::string className
RungeKutta1TimeIntegrationScheme(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
static TimeIntegrationSchemeSharedPtr create(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
static std::string className
RungeKutta2_ImprovedEulerTimeIntegrationScheme(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
static TimeIntegrationSchemeSharedPtr create(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
static std::string className
RungeKutta2_SSPTimeIntegrationScheme(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
RungeKutta2TimeIntegrationScheme(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
static std::string className
static TimeIntegrationSchemeSharedPtr create(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
static std::string className
static TimeIntegrationSchemeSharedPtr create(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
RungeKutta3_SSPTimeIntegrationScheme(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
static TimeIntegrationSchemeSharedPtr create(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
static std::string className
RungeKutta3TimeIntegrationScheme(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
RungeKutta4TimeIntegrationScheme(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
static std::string className
static TimeIntegrationSchemeSharedPtr create(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
RungeKutta5TimeIntegrationScheme(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
static std::string className
virtual LUE std::string v_GetName() const override
static LUE void SetupSchemeData(TimeIntegrationAlgorithmGLMSharedPtr &phase, std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
virtual LUE NekDouble v_GetTimeStability() const override
static std::string className
virtual ~RungeKuttaTimeIntegrationScheme()
RungeKuttaTimeIntegrationScheme(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
static TimeIntegrationSchemeSharedPtr create(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
Base class for GLM time integration schemes.
TimeIntegrationAlgorithmGLMVector m_integration_phases
LUE unsigned int 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
The above copyright notice and this permission notice shall be included.