41 #ifndef NEKTAR_LIB_UTILITIES_TIME_INTEGRATION_IMEX_TIME_INTEGRATION_SCHEME
42 #define NEKTAR_LIB_UTILITIES_TIME_INTEGRATION_IMEX_TIME_INTEGRATION_SCHEME
44 #define LUE LIB_UTILITIES_EXPORT
54 namespace LibUtilities
64 std::vector<NekDouble> freeParams)
67 if (variant ==
"dirk" || variant ==
"DIRK")
70 "IMEX DIRK Time integration scheme invalid number "
71 "of free parameters, expected two "
72 "<implicit stages, explicit stages>, received " +
73 std::to_string(freeParams.size()));
75 int s = freeParams[0];
76 int sigma = freeParams[1];
82 if (order == 1 && s == 1 && sigma == 1)
94 else if (variant ==
"Gear")
107 else if (variant ==
"")
111 "IMEX Time integration scheme bad order (1-4): " +
112 std::to_string(order));
116 for (
unsigned int n = 0; n < order; ++n)
144 std::vector<NekDouble>{3, 4});
147 std::vector<NekDouble>{3, 4});
153 std::vector<NekDouble>{2, 3});
156 std::vector<NekDouble>{2, 3});
162 ASSERTL1(
false,
"IMEX Time integration scheme bad order: " +
163 std::to_string(order));
168 ASSERTL1(
false,
"IMEX Time integration scheme bad variant: " +
169 variant +
". Must be blank, 'dirk' or 'Gear'");
178 std::string variant,
unsigned int order,
179 std::vector<NekDouble> freeParams)
183 variant, order, freeParams);
197 return std::string(
"IMEX");
224 { 4./ 3., -1./ 3., 4./3., -2./ 3.,
227 { 18./11., -9./11., 2./11., 18./11.,
228 -18./11., 6./11., 0., 0. },
230 { 48./25., -36./25., 16./25., -3./25.,
231 48./25., -72./25., 48./25., -12./25. } };
234 phase->m_schemeType =
eIMEX;
235 phase->m_order = order;
237 std::string(
"IMEXOrder" + std::to_string(phase->m_order));
239 phase->m_numsteps = 2 * phase->m_order;
240 phase->m_numstages = 1;
259 phase->m_B[1][phase->m_order][0] = 1.0;
261 phase->m_A[0][0][0] = ABcoefficients[phase->m_order];
262 phase->m_B[0][0][0] = ABcoefficients[phase->m_order];
264 for (
int n = 0; n < 2 * phase->m_order; ++n)
266 phase->m_U[0][n] = UVcoefficients[phase->m_order][n];
267 phase->m_V[0][n] = UVcoefficients[phase->m_order][n];
271 for (
int n = 1; n < 2 * phase->m_order; ++n)
273 if (n != phase->m_order)
274 phase->m_V[n][n - 1] = 1.0;
277 phase->m_numMultiStepValues = phase->m_order;
278 phase->m_numMultiStepDerivs = phase->m_order;
283 for (
int n = 0; n < phase->m_order; ++n)
285 phase->m_timeLevelOffset[n] = n;
286 phase->m_timeLevelOffset[phase->m_order + n] = n;
289 phase->CheckAndVerify();
300 std::vector<NekDouble> freeParams)
303 boost::ignore_unused(variant);
304 boost::ignore_unused(order);
308 std::string variant,
unsigned int order,
309 std::vector<NekDouble> freeParams)
311 boost::ignore_unused(variant);
312 boost::ignore_unused(order);
328 std::vector<NekDouble> freeParams)
331 boost::ignore_unused(variant);
332 boost::ignore_unused(order);
336 std::string variant,
unsigned int order,
337 std::vector<NekDouble> freeParams)
339 boost::ignore_unused(variant);
340 boost::ignore_unused(order);
356 std::vector<NekDouble> freeParams)
359 boost::ignore_unused(variant);
360 boost::ignore_unused(order);
364 std::string variant,
unsigned int order,
365 std::vector<NekDouble> freeParams)
367 boost::ignore_unused(variant);
368 boost::ignore_unused(order);
384 std::vector<NekDouble> freeParams)
387 boost::ignore_unused(variant);
388 boost::ignore_unused(order);
392 std::string variant,
unsigned int order,
393 std::vector<NekDouble> freeParams)
395 boost::ignore_unused(variant);
396 boost::ignore_unused(order);
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
static LUE void SetupSchemeData(TimeIntegrationAlgorithmGLMSharedPtr &phase)
static std::string className
static TimeIntegrationSchemeSharedPtr create(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
IMEXOrder1TimeIntegrationScheme(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)
IMEXOrder2TimeIntegrationScheme(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
IMEXOrder3TimeIntegrationScheme(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
IMEXOrder4TimeIntegrationScheme(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
static std::string className
IMEXTimeIntegrationScheme(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
virtual LUE std::string GetFullName() const
virtual LUE std::string GetName() const
virtual ~IMEXTimeIntegrationScheme()
static TimeIntegrationSchemeSharedPtr create(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
virtual LUE NekDouble GetTimeStability() const
static LUE void SetupSchemeData(TimeIntegrationAlgorithmGLMSharedPtr &phase, int order)
static LUE void SetupSchemeData(TimeIntegrationAlgorithmGLMSharedPtr &phase, unsigned int order, std::vector< NekDouble > freeParams)
static LUE void SetupSchemeData_1_1_1(TimeIntegrationAlgorithmGLMSharedPtr &phase)
Base class for GLM time integration schemes.
TimeIntegrationAlgorithmGLMVector m_integration_phases
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< TimeIntegrationAlgorithmGLM > TimeIntegrationAlgorithmGLMSharedPtr
@ eIMEX
Implicit Explicit General Linear Method.
std::vector< TimeIntegrationAlgorithmGLMSharedPtr > TimeIntegrationAlgorithmGLMVector
std::shared_ptr< TimeIntegrationScheme > TimeIntegrationSchemeSharedPtr
The above copyright notice and this permission notice shall be included.