Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 > Type;
47  return Type::Instance();
48  }
49 
51  {
52 
53  }
54 
56  {
57 
58  }
59 
60  // --------------
61  // IMEXOrder1
62  // --------------
65  "IMEXOrder1", TimeIntegrationIMEXOrder1::create);
67  {
70  m_intSteps = 1;
71  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
73  }
74 
75  // --------------
76  // IMEXOrder2
77  // --------------
80  "IMEXOrder2", TimeIntegrationIMEXOrder2::create);
82  {
86  m_intSteps = 2;
87  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
89  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
90  }
91 
92  // --------------
93  // IMEXOrder3
94  // --------------
97  "IMEXOrder3", TimeIntegrationIMEXOrder3::create);
99  {
104  m_intSteps = 3;
105  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
107  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
108  m_intScheme[2] = TimeIntegrationSchemeManager()[IntKey2];
109  }
110 
111  // --------------
112  // ForwardEuler
113  // --------------
116  "ForwardEuler", TimeIntegrationForwardEuler::create);
118  {
121  m_intSteps = 1;
122  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
124  }
125 
126  // --------------
127  // BackwardEuler
128  // --------------
131  "BackwardEuler", TimeIntegrationBackwardEuler::create);
133  {
136  m_intSteps = 1;
137  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
139  }
140 
141  // --------------
142  // BDFImplicitOrder1
143  // --------------
146  "BDFImplicitOrder1", TimeIntegrationBDFImplicitOrder1::create);
148  {
151  m_intSteps = 1;
152  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
154  }
155 
156  // --------------
157  // BDFImplicitOrder2
158  // --------------
161  "BDFImplicitOrder2", TimeIntegrationBDFImplicitOrder2::create);
163  {
167  m_intSteps = 2;
168  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
170  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
171  }
172 
173  // --------------
174  // BDFImplicitOrder2
175  // --------------
178  "RungeKutta2_ImprovedEuler",
181  {
184  m_intSteps = 1;
185  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
187  }
188 
189  // --------------
190  // IMEXdirk_1_1_1
191  // --------------
194  "IMEXdirk_1_1_1", TimeIntegrationIMEXdirk_1_1_1::create);
196  {
199  m_intSteps = 1;
200  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
202  }
203 
204  // --------------
205  // IMEXdirk_1_2_1
206  // --------------
209  "IMEXdirk_1_2_1", TimeIntegrationIMEXdirk_1_2_1::create);
211  {
214  m_intSteps = 1;
215  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
217  }
218 
219  // --------------
220  // IMEXdirk_1_2_2
221  // --------------
224  "IMEXdirk_1_2_2", TimeIntegrationIMEXdirk_1_2_2::create);
226  {
229  m_intSteps = 1;
230  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
232  }
233 
234  // --------------
235  // IMEXdirk_4_4_3
236  // --------------
239  "IMEXdirk_4_4_3", TimeIntegrationIMEXdirk_4_4_3::create);
241  {
244  m_intSteps = 1;
245  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
247  }
248 
249  // --------------
250  // IMEXdirk_2_2_2
251  // --------------
254  "IMEXdirk_2_2_2", TimeIntegrationIMEXdirk_2_2_2::create);
256  {
259  m_intSteps = 1;
260  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
262  }
263 
264  // --------------
265  // IMEXdirk_2_3_3
266  // --------------
269  "IMEXdirk_2_3_3", TimeIntegrationIMEXdirk_2_3_3::create);
271  {
274  m_intSteps = 1;
275  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
277  }
278 
279  // --------------
280  // IMEXdirk_2_3_2
281  // --------------
284  "IMEXdirk_2_3_2", TimeIntegrationIMEXdirk_2_3_2::create);
286  {
289  m_intSteps = 1;
290  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
292  }
293 
294  // --------------
295  // IMEXdirk_3_4_3
296  // --------------
299  "IMEXdirk_3_4_3", TimeIntegrationIMEXdirk_3_4_3::create);
301  {
304  m_intSteps = 1;
305  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
307  }
308 
309  // --------------
310  // DIRKOrder2
311  // --------------
314  "DIRKOrder2", TimeIntegrationDIRKOrder2::create);
316  {
319  m_intSteps = 1;
320  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
322  }
323 
324  // --------------
325  // DIRKOrder3
326  // --------------
329  "DIRKOrder3", TimeIntegrationDIRKOrder3::create);
331  {
334  m_intSteps = 1;
335  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
337  }
338 
339  // --------------
340  // ClassicalRungeKutta4
341  // --------------
344  "ClassicalRungeKutta4",
347  {
350  m_intSteps = 1;
351  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
353  }
354 
355  // --------------
356  // Midpoint
357  // --------------
360  "Midpoint", TimeIntegrationMidpoint::create);
362  {
365  m_intSteps = 1;
366  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
368  }
369 
370  // --------------
371  // RungeKutta2_ModifiedEuler
372  // --------------
375  "RungeKutta2_ModifiedEuler",
378  {
381  m_intSteps = 1;
382  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
384  }
385 
386  // --------------
387  // AdamsBashforthOrder2
388  // --------------
391  "AdamsBashforthOrder2",
394  {
398  m_intSteps = 2;
399  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
401  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
402  }
403 
404  // --------------
405  // AdamsBashforthOrder3
406  // --------------
409  "AdamsBashforthOrder3",
412  {
416  m_intSteps = 2;
417  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
419  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
420  }
421 
422  // --------------
423  // AdamsMoultonOrder2
424  // --------------
427  "AdamsMoultonOrder2",
430  {
434  m_intSteps = 2;
435  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
437  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
438  }
439 
440  // --------------
441  // IMEXGear
442  // --------------
445  "IMEXGear", TimeIntegrationIMEXGear::create);
447  {
451  m_intSteps = 2;
452  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
454  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
455  }
456 
457  // --------------
458  // CNAB
459  // --------------
464  {
468  m_method = eCNAB;
469  m_intSteps = 3;
470  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
472  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
473  m_intScheme[2] = TimeIntegrationSchemeManager()[IntKey2];
474  }
475 
476  // --------------
477  // MCNAB
478  // --------------
483  {
487  m_method = eMCNAB;
488  m_intSteps = 3;
489  m_intScheme = vector<TimeIntegrationSchemeSharedPtr>(m_intSteps);
491  m_intScheme[1] = TimeIntegrationSchemeManager()[IntKey1];
492  m_intScheme[2] = TimeIntegrationSchemeManager()[IntKey2];
493  }
494 }
495 }