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
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);
100 std::string variant,
size_t order,
101 std::vector<NekDouble> freeParams)
103 boost::ignore_unused(freeParams);
105 constexpr size_t nStages[6] = {0, 1, 2, 3, 4, 6};
117 constexpr NekDouble Acoefficients[2][6][15] =
118 { { { 0., 0., 0., 0., 0.,
120 0., 0., 0., 0., 0. },
122 { 0., 0., 0., 0., 0.,
124 0., 0., 0., 0., 0. },
129 0., 0., 0., 0., 0. },
135 0., 0., 0., 0., 0. },
141 0., 0., 0., 0., 0. },
150 3./16., 0., 0., 9./16.,
151 -3./7., 2./7., 12./7., -12./7., 8./7. } },
153 { { 0., 0., 0., 0., 0.,
155 0., 0., 0., 0., 0. },
157 { 0., 0., 0., 0., 0.,
159 0., 0., 0., 0., 0. },
164 0., 0., 0., 0., 0. },
170 0., 0., 0., 0., 0. },
176 0., 0., 0., 0., 0. },
185 3./16., 0., 0., 9./16.,
186 -3./7., 2./7., 12./7., -12./7., 8./7. } } };
192 constexpr NekDouble Bcoefficients[2][6][6] =
193 { { { 0., 0., 0., 0., 0., 0. },
195 { 1., 0., 0., 0., 0., 0. },
197 { 0., 1., 0., 0., 0., 0. },
199 { 2./9., 3./9., 4./9., 0., 0., 0. },
201 { 1./6., 2./6., 2./6., 1./6., 0., 0. },
207 { 7./90., 0., 32./90., 12./90., 32./90., 7./90.} },
209 { { 0., 0., 0., 0., 0., 0. },
211 { 1., 0., 0., 0., 0., 0. },
213 { 1./2., 1./2., 0., 0., 0., 0. },
215 { 1./6., 1./6., 4./6., 0., 0., 0. },
217 { 1./6., 2./6., 2./6., 1./6., 0., 0. },
223 { 7./90., 0., 32./90., 12./90., 32./90., 7./90. } } };
226 size_t index = (variant ==
"SSP" || variant ==
"ImprovedEuler");
229 phase->m_variant = variant;
230 phase->m_order = order;
231 phase->m_name = std::string(
"RungeKutta") + phase->m_variant +
232 std::string(
"Order") + std::to_string(phase->m_order);
234 phase->m_numsteps = 1;
235 phase->m_numstages = nStages[phase->m_order];
254 for (
size_t s = 1; s < phase->m_numstages; ++s)
256 for (
size_t i = 0; i < s; ++i)
258 phase->m_A[0][s][i] =
259 Acoefficients[index][phase->m_order][cc++];
264 for (
size_t n = 0; n < phase->m_numstages; ++n)
266 phase->m_B[0][0][n] = Bcoefficients[index][phase->m_order][n];
269 phase->m_numMultiStepValues = 1;
270 phase->m_numMultiStepImplicitDerivs = 0;
271 phase->m_numMultiStepExplicitDerivs = 0;
273 phase->m_timeLevelOffset[0] = 0;
275 phase->CheckAndVerify();
281 return std::string(
"RungeKutta");
292 return 2.51274532661833;
301 return 3.21704786664011;
317 std::vector<NekDouble> freeParams)
320 boost::ignore_unused(variant);
321 boost::ignore_unused(order);
325 std::string variant,
size_t order, std::vector<NekDouble> freeParams)
327 boost::ignore_unused(variant);
328 boost::ignore_unused(order);
347 std::vector<NekDouble> freeParams)
350 boost::ignore_unused(variant);
351 boost::ignore_unused(order);
355 std::string variant,
size_t order, std::vector<NekDouble> freeParams)
357 boost::ignore_unused(variant);
358 boost::ignore_unused(order);
377 std::vector<NekDouble> freeParams)
380 boost::ignore_unused(variant);
381 boost::ignore_unused(order);
385 std::string variant,
size_t order, std::vector<NekDouble> freeParams)
387 boost::ignore_unused(variant);
388 boost::ignore_unused(order);
408 std::vector<NekDouble> freeParams)
411 boost::ignore_unused(variant);
412 boost::ignore_unused(order);
416 std::string variant,
size_t order, std::vector<NekDouble> freeParams)
418 boost::ignore_unused(variant);
419 boost::ignore_unused(order);
439 std::vector<NekDouble> freeParams)
455 std::vector<NekDouble> freeParams)
458 boost::ignore_unused(variant);
459 boost::ignore_unused(order);
463 std::string variant,
size_t order, std::vector<NekDouble> freeParams)
465 boost::ignore_unused(variant);
466 boost::ignore_unused(order);
486 std::string variant,
size_t order, std::vector<NekDouble> freeParams)
489 boost::ignore_unused(variant);
490 boost::ignore_unused(order);
494 std::string variant,
size_t order, std::vector<NekDouble> freeParams)
496 boost::ignore_unused(variant);
497 boost::ignore_unused(order);
501 "SSP", 2, freeParams);
517 std::vector<NekDouble> freeParams)
520 boost::ignore_unused(variant);
521 boost::ignore_unused(order);
525 std::string variant,
size_t order, std::vector<NekDouble> freeParams)
527 boost::ignore_unused(variant);
528 boost::ignore_unused(order);
532 "SSP", 2, freeParams);
548 std::vector<NekDouble> freeParams)
551 boost::ignore_unused(variant);
552 boost::ignore_unused(order);
556 std::string variant,
size_t order, std::vector<NekDouble> freeParams)
558 boost::ignore_unused(variant);
559 boost::ignore_unused(order);
563 "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)
virtual LUE std::string v_GetName() const override
virtual LUE NekDouble v_GetTimeStability() const override
static TimeIntegrationSchemeSharedPtr create(std::string variant, size_t order, std::vector< NekDouble > freeParams)
static std::string className
virtual ~RungeKuttaTimeIntegrationScheme()
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
The above copyright notice and this permission notice shall be included.