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 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: Header file of time integration scheme wrappers
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_LIB_UTILITIES_FOUNDATIONS_TIMEINTEGRATIONWRAPPER_H
36 #define NEKTAR_LIB_UTILITIES_FOUNDATIONS_TIMEINTEGRATIONWRAPPER_H
37 
41 
42 namespace Nektar {
43 namespace LibUtilities {
44 
46 
47  /// Datatype of the NekFactory used to instantiate classes derived from
48  /// the EquationSystem class.
49  typedef NekFactory <
50  std::string, TimeIntegrationWrapper
52  LIB_UTILITIES_EXPORT TimeIntegrationWrapperFactory
54 
55  typedef std::shared_ptr<TimeIntegrationWrapper>
57 
59  {
60  public:
62 
64  {
65  v_InitObject();
66  }
67 
69  const NekDouble timestep,
71  const NekDouble time,
73  {
74  return m_intScheme[m_intSteps - 1]
75  ->InitializeScheme(timestep, y_0, time, op);
76  }
77 
80  const int timestep,
81  const NekDouble delta_t,
84  {
85  return m_intScheme[std::min(timestep, m_intSteps - 1)]
86  ->TimeIntegrate(delta_t, solvector, op);
87  }
88 
90  {
91  return m_method;
92  }
93 
95  {
96  return m_intScheme.back()->GetIntegrationSchemeType();
97  }
98 
100  {
101  return m_intSteps;
102  }
103 
104  protected:
107  std::vector<TimeIntegrationSchemeSharedPtr> m_intScheme;
108 
109  /// Constructor
111 
112  virtual void v_InitObject();
113  };
114 
115 
116  // --------
117  // IMEXOrder1
118  // --------
120  typedef std::shared_ptr<TimeIntegrationIMEXOrder1>
122 
124  {
125  public:
127 
128  /// Creates an instance of this class
130  {
133  p->InitObject();
134  return p;
135  }
136  /// Name of class
137  static std::string className;
138 
140 
141  protected:
142  virtual void v_InitObject();
143  };
144 
146  {
147  public:
149 
150  /// Creates an instance of this class
152  {
155  p->InitObject();
156  return p;
157  }
158  /// Name of class
159  static std::string className;
160 
162 
163  protected:
164  virtual void v_InitObject();
165  };
166 
168  {
169  public:
171 
172  /// Creates an instance of this class
174  {
177  p->InitObject();
178  return p;
179  }
180  /// Name of class
181  static std::string className;
182 
184 
185  protected:
186  virtual void v_InitObject();
187  };
188 
190  {
191  public:
193 
194  /// Creates an instance of this class
196  {
199  p->InitObject();
200  return p;
201  }
202  /// Name of class
203  static std::string className;
204 
206 
207  protected:
208  virtual void v_InitObject();
209  };
210 
212  {
213  public:
215 
216  /// Creates an instance of this class
218  {
222  p->InitObject();
223  return p;
224  }
225  /// Name of class
226  static std::string className;
227 
229 
230  protected:
231  virtual void v_InitObject();
232  };
233 
234 
236  {
237  public:
239 
240  /// Creates an instance of this class
242  {
246  p->InitObject();
247  return p;
248  }
249  /// Name of class
250  static std::string className;
251 
253 
254  protected:
255  virtual void v_InitObject();
256  };
257 
258 
260  {
261  public:
263 
264  /// Creates an instance of this class
266  {
270  p->InitObject();
271  return p;
272  }
273  /// Name of class
274  static std::string className;
275 
277 
278  protected:
279  virtual void v_InitObject();
280  };
281 
282 
284  {
285  public:
287 
288  /// Creates an instance of this class
290  {
294  p->InitObject();
295  return p;
296  }
297  /// Name of class
298  static std::string className;
299 
301 
302  protected:
303  virtual void v_InitObject();
304  };
305 
306 
308  {
309  public:
311 
312  /// Creates an instance of this class
314  {
318  p->InitObject();
319  return p;
320  }
321  /// Name of class
322  static std::string className;
323 
325 
326  protected:
327  virtual void v_InitObject();
328  };
329 
330 
332  {
333  public:
335 
336  /// Creates an instance of this class
338  {
342  p->InitObject();
343  return p;
344  }
345  /// Name of class
346  static std::string className;
347 
349 
350  protected:
351  virtual void v_InitObject();
352  };
353 
354 
356  {
357  public:
359 
360  /// Creates an instance of this class
362  {
366  p->InitObject();
367  return p;
368  }
369  /// Name of class
370  static std::string className;
371 
373 
374  protected:
375  virtual void v_InitObject();
376  };
377 
378 
380  {
381  public:
383 
384  /// Creates an instance of this class
386  {
390  p->InitObject();
391  return p;
392  }
393  /// Name of class
394  static std::string className;
395 
397 
398  protected:
399  virtual void v_InitObject();
400  };
401 
403  {
404  public:
406 
407  /// Creates an instance of this class
409  {
412  p->InitObject();
413  return p;
414  }
415  /// Name of class
416  static std::string className;
417 
419 
420  protected:
421  virtual void v_InitObject();
422  };
423 
424 
426  {
427  public:
429 
430  /// Creates an instance of this class
432  {
436  p->InitObject();
437  return p;
438  }
439  /// Name of class
440  static std::string className;
441 
443 
444  protected:
445  virtual void v_InitObject();
446  };
447 
448 
450  {
451  public:
453 
454  /// Creates an instance of this class
456  {
460  p->InitObject();
461  return p;
462  }
463  /// Name of class
464  static std::string className;
465 
467 
468  protected:
469  virtual void v_InitObject();
470  };
471 
472 
474  {
475  public:
477 
478  /// Creates an instance of this class
480  {
484  p->InitObject();
485  return p;
486  }
487  /// Name of class
488  static std::string className;
489 
491 
492  protected:
493  virtual void v_InitObject();
494  };
495 
496 
498  {
499  public:
501 
502  /// Creates an instance of this class
504  {
507  p->InitObject();
508  return p;
509  }
510  /// Name of class
511  static std::string className;
512 
514 
515  protected:
516  virtual void v_InitObject();
517  };
518 
519 
521  {
522  public:
524 
525  /// Creates an instance of this class
527  {
530  p->InitObject();
531  return p;
532  }
533  /// Name of class
534  static std::string className;
535 
537 
538  protected:
539  virtual void v_InitObject();
540  };
541 
542 
545  {
546  public:
548 
549  /// Creates an instance of this class
551  {
555  p->InitObject();
556  return p;
557  }
558  /// Name of class
559  static std::string className;
560 
562 
563  protected:
564  virtual void v_InitObject();
565  };
566 
567 
569  {
570  public:
572 
573  /// Creates an instance of this class
575  {
579  p->InitObject();
580  return p;
581  }
582  /// Name of class
583  static std::string className;
584 
586 
587  protected:
588  virtual void v_InitObject();
589  };
590 
591 
593  {
594  public:
596 
597  /// Creates an instance of this class
599  {
603  p->InitObject();
604  return p;
605  }
606  /// Name of class
607  static std::string className;
608 
610 
611  protected:
612  virtual void v_InitObject();
613  };
614 
615 
617  {
618  public:
620 
621  /// Creates an instance of this class
623  {
627  p->InitObject();
628  return p;
629  }
630  /// Name of class
631  static std::string className;
632 
634 
635  protected:
636  virtual void v_InitObject();
637  };
638 
639 
641  {
642  public:
644 
645  /// Creates an instance of this class
647  {
651  p->InitObject();
652  return p;
653  }
654  /// Name of class
655  static std::string className;
656 
658 
659  protected:
660  virtual void v_InitObject();
661  };
662 
663 
665  {
666  public:
668 
669  /// Creates an instance of this class
671  {
675  p->InitObject();
676  return p;
677  }
678  /// Name of class
679  static std::string className;
680 
682 
683  protected:
684  virtual void v_InitObject();
685  };
686 
687 
689  {
690  public:
692 
693  /// Creates an instance of this class
695  {
698  p->InitObject();
699  return p;
700  }
701  /// Name of class
702  static std::string className;
703 
705 
706  protected:
707  virtual void v_InitObject();
708  };
709 
710 
712  {
713  public:
715 
716  /// Creates an instance of this class
718  {
721  p->InitObject();
722  return p;
723  }
724  /// Name of class
725  static std::string className;
726 
728 
729  protected:
730  virtual void v_InitObject();
731  };
732 
733 
735  {
736  public:
738 
739  /// Creates an instance of this class
741  {
745  p->InitObject();
746  return p;
747  }
748  /// Name of class
749  static std::string className;
750 
752 
753  protected:
754  virtual void v_InitObject();
755  };
756 
757 
759  {
760  public:
762 
763  /// Creates an instance of this class
765  {
769  p->InitObject();
770  return p;
771  }
772  /// Name of class
773  static std::string className;
774 
776 
777  protected:
778  virtual void v_InitObject();
779  };
780 
781 
783  {
784  public:
786 
787  /// Creates an instance of this class
789  {
793  p->InitObject();
794  return p;
795  }
796  /// Name of class
797  static std::string className;
798 
800 
801  protected:
802  virtual void v_InitObject();
803  };
804 
805 
807  {
808  public:
810 
811  /// Creates an instance of this class
813  {
817  p->InitObject();
818  return p;
819  }
820  /// Name of class
821  static std::string className;
822 
824 
825  protected:
826  virtual void v_InitObject();
827  };
828 
829 
831  {
832  public:
834 
835  /// Creates an instance of this class
837  {
840  p->InitObject();
841  return p;
842  }
843  /// Name of class
844  static std::string className;
845 
847 
848  protected:
849  virtual void v_InitObject();
850  };
851 
852 
854  {
855  public:
857 
858  /// Creates an instance of this class
860  {
863  p->InitObject();
864  return p;
865  }
866  /// Name of class
867  static std::string className;
868 
869  virtual ~TimeIntegrationCNAB() {}
870 
871  protected:
872  virtual void v_InitObject();
873  };
874 
875 
877  {
878  public:
880 
881  /// Creates an instance of this class
883  {
886  p->InitObject();
887  return p;
888  }
889  /// Name of class
890  static std::string className;
891 
893 
894  protected:
895  virtual void v_InitObject();
896  };
897 }
898 }
899 #endif
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 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.
std::shared_ptr< TimeIntegrationIMEXOrder1 > TimeIntegrationIMEXOrder1SharedPtr
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 TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.
std::shared_ptr< TimeIntegrationWrapper > TimeIntegrationWrapperSharedPtr
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 std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
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()
TimeIntegrationSchemeType GetIntegrationSchemeType() const
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.
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.
std::shared_ptr< TimeIntegrationSolution > TimeIntegrationSolutionSharedPtr
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:103
static TimeIntegrationWrapperSharedPtr create()
Creates an instance of this class.