Nektar++
TimeIntegrationWrapper.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: TimeIntegrationWrapper.h
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: Header file of time integration scheme wrappers
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_LIB_UTILITIES_FOUNDATIONS_TIMEINTEGRATIONWRAPPER_H
37 #define NEKTAR_LIB_UTILITIES_FOUNDATIONS_TIMEINTEGRATIONWRAPPER_H
38 
42 
43 namespace Nektar {
44 namespace LibUtilities {
45 
47 
48  /// Datatype of the NekFactory used to instantiate classes derived from
49  /// the EquationSystem class.
50  typedef NekFactory <
51  std::string, TimeIntegrationWrapper
53  LIB_UTILITIES_EXPORT TimeIntegrationWrapperFactory
55 
56  typedef boost::shared_ptr<TimeIntegrationWrapper>
58 
60  {
61  public:
63 
65  {
66  v_InitObject();
67  }
68 
70  const NekDouble timestep,
72  const NekDouble time,
74  {
75  return m_intScheme[m_intSteps - 1]
76  ->InitializeScheme(timestep, y_0, time, op);
77  }
78 
81  const int timestep,
82  const NekDouble delta_t,
85  {
86  return m_intScheme[min(timestep, m_intSteps - 1)]
87  ->TimeIntegrate(delta_t, solvector, op);
88  }
89 
91  {
92  return m_method;
93  }
94 
96  {
97  return m_intSteps;
98  }
99 
100  protected:
103  std::vector<TimeIntegrationSchemeSharedPtr> m_intScheme;
104 
105  /// Constructor
107 
108  virtual void v_InitObject();
109  };
110 
111 
112  // --------
113  // IMEXOrder1
114  // --------
116  typedef boost::shared_ptr<TimeIntegrationIMEXOrder1>
118 
120  {
121  public:
123 
124  /// Creates an instance of this class
126  {
129  p->InitObject();
130  return p;
131  }
132  /// Name of class
133  static std::string className;
134 
136 
137  protected:
138  virtual void v_InitObject();
139  };
140 
142  {
143  public:
145 
146  /// Creates an instance of this class
148  {
151  p->InitObject();
152  return p;
153  }
154  /// Name of class
155  static std::string className;
156 
158 
159  protected:
160  virtual void v_InitObject();
161  };
162 
164  {
165  public:
167 
168  /// Creates an instance of this class
170  {
173  p->InitObject();
174  return p;
175  }
176  /// Name of class
177  static std::string className;
178 
180 
181  protected:
182  virtual void v_InitObject();
183  };
184 
186  {
187  public:
189 
190  /// Creates an instance of this class
192  {
196  p->InitObject();
197  return p;
198  }
199  /// Name of class
200  static std::string className;
201 
203 
204  protected:
205  virtual void v_InitObject();
206  };
207 
208 
210  {
211  public:
213 
214  /// Creates an instance of this class
216  {
220  p->InitObject();
221  return p;
222  }
223  /// Name of class
224  static std::string className;
225 
227 
228  protected:
229  virtual void v_InitObject();
230  };
231 
232 
234  {
235  public:
237 
238  /// Creates an instance of this class
240  {
244  p->InitObject();
245  return p;
246  }
247  /// Name of class
248  static std::string className;
249 
251 
252  protected:
253  virtual void v_InitObject();
254  };
255 
256 
258  {
259  public:
261 
262  /// Creates an instance of this class
264  {
268  p->InitObject();
269  return p;
270  }
271  /// Name of class
272  static std::string className;
273 
275 
276  protected:
277  virtual void v_InitObject();
278  };
279 
280 
282  {
283  public:
285 
286  /// Creates an instance of this class
288  {
292  p->InitObject();
293  return p;
294  }
295  /// Name of class
296  static std::string className;
297 
299 
300  protected:
301  virtual void v_InitObject();
302  };
303 
304 
306  {
307  public:
309 
310  /// Creates an instance of this class
312  {
316  p->InitObject();
317  return p;
318  }
319  /// Name of class
320  static std::string className;
321 
323 
324  protected:
325  virtual void v_InitObject();
326  };
327 
328 
330  {
331  public:
333 
334  /// Creates an instance of this class
336  {
340  p->InitObject();
341  return p;
342  }
343  /// Name of class
344  static std::string className;
345 
347 
348  protected:
349  virtual void v_InitObject();
350  };
351 
352 
354  {
355  public:
357 
358  /// Creates an instance of this class
360  {
364  p->InitObject();
365  return p;
366  }
367  /// Name of class
368  static std::string className;
369 
371 
372  protected:
373  virtual void v_InitObject();
374  };
375 
377  {
378  public:
380 
381  /// Creates an instance of this class
383  {
386  p->InitObject();
387  return p;
388  }
389  /// Name of class
390  static std::string className;
391 
393 
394  protected:
395  virtual void v_InitObject();
396  };
397 
398 
400  {
401  public:
403 
404  /// Creates an instance of this class
406  {
410  p->InitObject();
411  return p;
412  }
413  /// Name of class
414  static std::string className;
415 
417 
418  protected:
419  virtual void v_InitObject();
420  };
421 
422 
424  {
425  public:
427 
428  /// Creates an instance of this class
430  {
434  p->InitObject();
435  return p;
436  }
437  /// Name of class
438  static std::string className;
439 
441 
442  protected:
443  virtual void v_InitObject();
444  };
445 
446 
448  {
449  public:
451 
452  /// Creates an instance of this class
454  {
458  p->InitObject();
459  return p;
460  }
461  /// Name of class
462  static std::string className;
463 
465 
466  protected:
467  virtual void v_InitObject();
468  };
469 
470 
472  {
473  public:
475 
476  /// Creates an instance of this class
478  {
481  p->InitObject();
482  return p;
483  }
484  /// Name of class
485  static std::string className;
486 
488 
489  protected:
490  virtual void v_InitObject();
491  };
492 
493 
495  {
496  public:
498 
499  /// Creates an instance of this class
501  {
504  p->InitObject();
505  return p;
506  }
507  /// Name of class
508  static std::string className;
509 
511 
512  protected:
513  virtual void v_InitObject();
514  };
515 
516 
519  {
520  public:
522 
523  /// Creates an instance of this class
525  {
529  p->InitObject();
530  return p;
531  }
532  /// Name of class
533  static std::string className;
534 
536 
537  protected:
538  virtual void v_InitObject();
539  };
540 
541 
543  {
544  public:
546 
547  /// Creates an instance of this class
549  {
553  p->InitObject();
554  return p;
555  }
556  /// Name of class
557  static std::string className;
558 
560 
561  protected:
562  virtual void v_InitObject();
563  };
564 
565 
567  {
568  public:
570 
571  /// Creates an instance of this class
573  {
577  p->InitObject();
578  return p;
579  }
580  /// Name of class
581  static std::string className;
582 
584 
585  protected:
586  virtual void v_InitObject();
587  };
588 
589 
591  {
592  public:
594 
595  /// Creates an instance of this class
597  {
601  p->InitObject();
602  return p;
603  }
604  /// Name of class
605  static std::string className;
606 
608 
609  protected:
610  virtual void v_InitObject();
611  };
612 
613 
615  {
616  public:
618 
619  /// Creates an instance of this class
621  {
625  p->InitObject();
626  return p;
627  }
628  /// Name of class
629  static std::string className;
630 
632 
633  protected:
634  virtual void v_InitObject();
635  };
636 
637 
639  {
640  public:
642 
643  /// Creates an instance of this class
645  {
648  p->InitObject();
649  return p;
650  }
651  /// Name of class
652  static std::string className;
653 
655 
656  protected:
657  virtual void v_InitObject();
658  };
659 
661  {
662  public:
664 
665  /// Creates an instance of this class
667  {
670  p->InitObject();
671  return p;
672  }
673  /// Name of class
674  static std::string className;
675 
677 
678  protected:
679  virtual void v_InitObject();
680  };
681 
682 
684  {
685  public:
687 
688  /// Creates an instance of this class
690  {
694  p->InitObject();
695  return p;
696  }
697  /// Name of class
698  static std::string className;
699 
701 
702  protected:
703  virtual void v_InitObject();
704  };
705 
706 
708  {
709  public:
711 
712  /// Creates an instance of this class
714  {
718  p->InitObject();
719  return p;
720  }
721  /// Name of class
722  static std::string className;
723 
725 
726  protected:
727  virtual void v_InitObject();
728  };
729 
730 
732  {
733  public:
735 
736  /// Creates an instance of this class
738  {
742  p->InitObject();
743  return p;
744  }
745  /// Name of class
746  static std::string className;
747 
749 
750  protected:
751  virtual void v_InitObject();
752  };
753 
754 
756  {
757  public:
759 
760  /// Creates an instance of this class
762  {
765  p->InitObject();
766  return p;
767  }
768  /// Name of class
769  static std::string className;
770 
772 
773  protected:
774  virtual void v_InitObject();
775  };
776 
777 
779  {
780  public:
782 
783  /// Creates an instance of this class
785  {
788  p->InitObject();
789  return p;
790  }
791  /// Name of class
792  static std::string className;
793 
794  virtual ~TimeIntegrationCNAB() {}
795 
796  protected:
797  virtual void v_InitObject();
798  };
799 
800 
802  {
803  public:
805 
806  /// Creates an instance of this class
808  {
811  p->InitObject();
812  return p;
813  }
814  /// Name of class
815  static std::string className;
816 
818 
819  protected:
820  virtual void v_InitObject();
821  };
822 }
823 }
824 #endif
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
static std::string className
Name of class.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
boost::shared_ptr< TimeIntegrationIMEXOrder1 > TimeIntegrationIMEXOrder1SharedPtr
boost::shared_ptr< TimeIntegrationWrapper > TimeIntegrationWrapperSharedPtr
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 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.
#define LIB_UTILITIES_EXPORT
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
TimeIntegrationSolutionSharedPtr InitializeScheme(const NekDouble timestep, TimeIntegrationScheme::ConstDoubleArray &y_0, const NekDouble time, const TimeIntegrationSchemeOperators &op)
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.
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.
double NekDouble
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
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
boost::shared_ptr< TimeIntegrationSolution > TimeIntegrationSolutionSharedPtr
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 TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
TimeIntegrationScheme::ConstDoubleArray & TimeIntegrate(const int timestep, const NekDouble delta_t, TimeIntegrationSolutionSharedPtr &solvector, const TimeIntegrationSchemeOperators &op)
Provides a generic Factory class.
Definition: NekFactory.hpp:116
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.