Nektar++
TimeIntegrationWrapper.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: TimeIntegrationWrapper.cpp
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: Time integration scheme wrappers; one class per time integration
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
38 
39 namespace Nektar {
40 namespace LibUtilities {
41 
43  {
44  typedef Loki::SingletonHolder<TimeIntegrationWrapperFactory,
45  Loki::CreateUsingNew,
46  Loki::NoDestroy,
47  Loki::SingleThreaded> Type;
48  return Type::Instance();
49  }
50 
52  {
53 
54  }
55 
57  {
58 
59  }
60 
61  // --------------
62  // IMEXOrder1
63  // --------------
66  "IMEXOrder1", TimeIntegrationIMEXOrder1::create);
68  {
71  m_intSteps = 1;
72  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
74  }
75 
76  // --------------
77  // IMEXOrder2
78  // --------------
81  "IMEXOrder2", TimeIntegrationIMEXOrder2::create);
83  {
87  m_intSteps = 2;
88  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
90  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
91  }
92 
93  // --------------
94  // IMEXOrder3
95  // --------------
98  "IMEXOrder3", TimeIntegrationIMEXOrder3::create);
100  {
105  m_intSteps = 3;
106  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
108  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
109  m_intScheme[2] = TimeIntegrationSchemeManager()[IntKey2];
110  }
111 
112  // --------------
113  // ForwardEuler
114  // --------------
117  "ForwardEuler", TimeIntegrationForwardEuler::create);
119  {
122  m_intSteps = 1;
123  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
125  }
126 
127  // --------------
128  // BackwardEuler
129  // --------------
132  "BackwardEuler", TimeIntegrationBackwardEuler::create);
134  {
137  m_intSteps = 1;
138  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
140  }
141 
142  // --------------
143  // BDFImplicitOrder1
144  // --------------
147  "BDFImplicitOrder1", TimeIntegrationBDFImplicitOrder1::create);
149  {
152  m_intSteps = 1;
153  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
155  }
156 
157  // --------------
158  // BDFImplicitOrder2
159  // --------------
162  "BDFImplicitOrder2", TimeIntegrationBDFImplicitOrder2::create);
164  {
168  m_intSteps = 2;
169  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
171  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
172  }
173 
174  // --------------
175  // BDFImplicitOrder2
176  // --------------
179  "RungeKutta2_ImprovedEuler",
182  {
185  m_intSteps = 1;
186  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
188  }
189 
190  // --------------
191  // IMEXdirk_1_1_1
192  // --------------
195  "IMEXdirk_1_1_1", TimeIntegrationIMEXdirk_1_1_1::create);
197  {
200  m_intSteps = 1;
201  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
203  }
204 
205  // --------------
206  // IMEXdirk_1_2_1
207  // --------------
210  "IMEXdirk_1_2_1", TimeIntegrationIMEXdirk_1_2_1::create);
212  {
215  m_intSteps = 1;
216  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
218  }
219 
220  // --------------
221  // IMEXdirk_1_2_2
222  // --------------
225  "IMEXdirk_1_2_2", TimeIntegrationIMEXdirk_1_2_2::create);
227  {
230  m_intSteps = 1;
231  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
233  }
234 
235  // --------------
236  // IMEXdirk_4_4_3
237  // --------------
240  "IMEXdirk_4_4_3", TimeIntegrationIMEXdirk_4_4_3::create);
242  {
245  m_intSteps = 1;
246  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
248  }
249 
250  // --------------
251  // IMEXdirk_2_2_2
252  // --------------
255  "IMEXdirk_2_2_2", TimeIntegrationIMEXdirk_2_2_2::create);
257  {
260  m_intSteps = 1;
261  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
263  }
264 
265  // --------------
266  // IMEXdirk_2_3_3
267  // --------------
270  "IMEXdirk_2_3_3", TimeIntegrationIMEXdirk_2_3_3::create);
272  {
275  m_intSteps = 1;
276  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
278  }
279 
280  // --------------
281  // IMEXdirk_2_3_2
282  // --------------
285  "IMEXdirk_2_3_2", TimeIntegrationIMEXdirk_2_3_2::create);
287  {
290  m_intSteps = 1;
291  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
293  }
294 
295  // --------------
296  // IMEXdirk_3_4_3
297  // --------------
300  "IMEXdirk_3_4_3", TimeIntegrationIMEXdirk_3_4_3::create);
302  {
305  m_intSteps = 1;
306  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
308  }
309 
310  // --------------
311  // DIRKOrder2
312  // --------------
315  "DIRKOrder2", TimeIntegrationDIRKOrder2::create);
317  {
320  m_intSteps = 1;
321  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
323  }
324 
325  // --------------
326  // DIRKOrder3
327  // --------------
330  "DIRKOrder3", TimeIntegrationDIRKOrder3::create);
332  {
335  m_intSteps = 1;
336  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
338  }
339 
340  // --------------
341  // ClassicalRungeKutta4
342  // --------------
345  "ClassicalRungeKutta4",
348  {
351  m_intSteps = 1;
352  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
354  }
355 
356  // --------------
357  // Midpoint
358  // --------------
361  "Midpoint", TimeIntegrationMidpoint::create);
363  {
366  m_intSteps = 1;
367  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
369  }
370 
371  // --------------
372  // RungeKutta2_ModifiedEuler
373  // --------------
376  "RungeKutta2_ModifiedEuler",
379  {
382  m_intSteps = 1;
383  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
385  }
386 
387  // --------------
388  // AdamsBashforthOrder2
389  // --------------
392  "AdamsBashforthOrder2",
395  {
399  m_intSteps = 2;
400  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
402  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
403  }
404 
405  // --------------
406  // AdamsBashforthOrder3
407  // --------------
410  "AdamsBashforthOrder3",
413  {
417  m_intSteps = 2;
418  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
420  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
421  }
422 
423  // --------------
424  // AdamsMoultonOrder2
425  // --------------
428  "AdamsMoultonOrder2",
431  {
435  m_intSteps = 2;
436  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
438  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
439  }
440 
441  // --------------
442  // IMEXGear
443  // --------------
446  "IMEXGear", TimeIntegrationIMEXGear::create);
448  {
452  m_intSteps = 2;
453  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
455  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
456  }
457 
458  // --------------
459  // CNAB
460  // --------------
465  {
469  m_method = eCNAB;
470  m_intSteps = 3;
471  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
473  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
474  m_intScheme[2] = TimeIntegrationSchemeManager()[IntKey2];
475  }
476 
477  // --------------
478  // MCNAB
479  // --------------
484  {
488  m_method = eMCNAB;
489  m_intSteps = 3;
490  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
492  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
493  m_intScheme[2] = TimeIntegrationSchemeManager()[IntKey2];
494  }
495 }
496 }
BDF multi-step scheme of order 1 (implicit)
Adams-Bashforth Forward multi-step scheme of order 2.
Runge-Kutta multi-stage scheme 4th order explicit.
static std::string className
Name of class.
Implicit-Explicit Midpoint IMEX DIRK(1,2,2)
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
L-stable, four stage, third order IMEX DIRK(4,4,3)
Forward-Backward Euler IMEX DIRK(1,2,1)
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
TimeIntegrationSchemeManagerT & TimeIntegrationSchemeManager(void)
Adams-Moulton Forward multi-step scheme of order 2.
Adams-Bashforth Forward multi-step scheme of order 3.
Crank-Nicolson/Adams-Bashforth Order 2 (CNAB)
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
IMEX 2nd order scheme using Backward Different Formula & Extrapolation.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static std::string className
Name of class.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
L-stable, three stage, third order IMEX DIRK(3,4,3)
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
Runge-Kutta multi-stage scheme 2nd order explicit.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
Forward-Backward Euler IMEX DIRK(1,1,1)
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
NekFactory< std::string, TimeIntegrationWrapper > TimeIntegrationWrapperFactory
Datatype of the NekFactory used to instantiate classes derived from the EquationSystem class...
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
TimeIntegrationWrapperFactory & GetTimeIntegrationWrapperFactory()
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
std::vector< TimeIntegrationSchemeSharedPtr > m_intScheme
BDF multi-step scheme of order 2 (implicit)
L-stable, two stage, second order IMEX DIRK(2,2,2)
Runge-Kutta multi-stage scheme 2nd order explicit.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
Diagonally Implicit Runge Kutta scheme of order 3.
IMEX 3rd order scheme using Backward Different Formula & Extrapolation.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
L-stable, three stage, third order IMEX DIRK(3,4,3)
Diagonally Implicit Runge Kutta scheme of order 3.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
L-stable, two stage, third order IMEX DIRK(2,3,3)
Modified Crank-Nicolson/Adams-Bashforth Order 2 (MCNAB)
IMEX 1st order scheme using Euler Backwards/Euler Forwards.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
Provides a generic Factory class.
Definition: NekFactory.hpp:116
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:215