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>{3, 4});
156 std::vector<NekDouble>{3, 4});
159 std::vector<NekDouble>{3, 4});
163 ASSERTL1(
false,
"IMEX Time integration scheme bad order: " +
164 std::to_string(order));
169 ASSERTL1(
false,
"IMEX Time integration scheme bad variant: " +
170 variant +
". Must be blank, 'dirk' or 'Gear'");
179 std::string variant,
unsigned int order,
180 std::vector<NekDouble> freeParams)
184 variant, order, freeParams);
210 { 4./ 3., -1./ 3., 4./3., -2./ 3.,
213 { 18./11., -9./11., 2./11., 18./11.,
214 -18./11., 6./11., 0., 0. },
216 { 48./25., -36./25., 16./25., -3./25.,
217 48./25., -72./25., 48./25., -12./25. } };
220 phase->m_schemeType =
eIMEX;
221 phase->m_order = order;
223 std::string(
"IMEXOrder" + std::to_string(phase->m_order));
225 phase->m_numsteps = 2 * phase->m_order;
226 phase->m_numstages = 1;
245 phase->m_B[1][phase->m_order][0] = 1.0;
247 phase->m_A[0][0][0] = ABcoefficients[phase->m_order];
248 phase->m_B[0][0][0] = ABcoefficients[phase->m_order];
250 for (
int n = 0; n < 2 * phase->m_order; ++n)
252 phase->m_U[0][n] = UVcoefficients[phase->m_order][n];
253 phase->m_V[0][n] = UVcoefficients[phase->m_order][n];
257 for (
int n = 1; n < 2 * phase->m_order; ++n)
259 if (n != phase->m_order)
260 phase->m_V[n][n - 1] = 1.0;
263 phase->m_numMultiStepValues = phase->m_order;
264 phase->m_numMultiStepImplicitDerivs = 0;
265 phase->m_numMultiStepDerivs = phase->m_order;
270 for (
int n = 0; n < phase->m_order; ++n)
272 phase->m_timeLevelOffset[n] = n;
273 phase->m_timeLevelOffset[phase->m_order + n] = n;
276 phase->CheckAndVerify();
287 return std::string(
"IMEX");
303 std::vector<NekDouble> freeParams)
306 boost::ignore_unused(variant);
307 boost::ignore_unused(order);
311 std::string variant,
unsigned int order,
312 std::vector<NekDouble> freeParams)
314 boost::ignore_unused(variant);
315 boost::ignore_unused(order);
331 std::vector<NekDouble> freeParams)
334 boost::ignore_unused(variant);
335 boost::ignore_unused(order);
339 std::string variant,
unsigned int order,
340 std::vector<NekDouble> freeParams)
342 boost::ignore_unused(variant);
343 boost::ignore_unused(order);
359 std::vector<NekDouble> freeParams)
362 boost::ignore_unused(variant);
363 boost::ignore_unused(order);
367 std::string variant,
unsigned int order,
368 std::vector<NekDouble> freeParams)
370 boost::ignore_unused(variant);
371 boost::ignore_unused(order);
387 std::vector<NekDouble> freeParams)
390 boost::ignore_unused(variant);
391 boost::ignore_unused(order);
395 std::string variant,
unsigned int order,
396 std::vector<NekDouble> freeParams)
398 boost::ignore_unused(variant);
399 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 v_GetFullName() const override
virtual LUE std::string v_GetName() const override
virtual LUE NekDouble v_GetTimeStability() const override
virtual ~IMEXTimeIntegrationScheme()
static TimeIntegrationSchemeSharedPtr create(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
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.