Nektar++
TimeIntegrationSchemeGLM.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: TimeIntegrationSchemeGLM.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 GLM base class
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_LIB_UTILITIES_TIME_INTEGRATION_TIME_INTEGRATION_SCHEME_GLM
36 #define NEKTAR_LIB_UTILITIES_TIME_INTEGRATION_TIME_INTEGRATION_SCHEME_GLM
37 
38 #define LUE LIB_UTILITIES_EXPORT
39 
42 
43 namespace Nektar
44 {
45 namespace LibUtilities
46 {
47 
48 /**
49  * @brief Base class for GLM time integration schemes.
50  */
52 {
53 public:
54  // Access methods
55  LUE virtual std::string GetName () const = 0;
56  // Values stored by each integration phase.
57  LUE virtual std::string GetVariant () const;
58  LUE virtual unsigned int GetOrder () const;
59  LUE virtual std::vector< NekDouble > GetFreeParams() const;
60 
61  LUE virtual NekDouble GetTimeStability() const = 0;
62 
64 
65  LUE unsigned int GetNumIntegrationPhases() const;
66 
67  // Gets the solution Vector
68  inline const TripleArray &GetSolutionVector() const
69  {
70  return m_solVector->GetSolutionVector();
71  }
72 
73  // Sets the solution Vector
74  inline void SetSolutionVector(const int Offset, const DoubleArray &y)
75  {
76  m_solVector->SetSolutionVector(Offset, y);
77  }
78 
79  // The worker methods
80  LUE virtual void InitializeScheme(
81  const NekDouble deltaT, ConstDoubleArray &y_0,
82  const NekDouble time, const TimeIntegrationSchemeOperators &op);
83 
85  const int timestep, const NekDouble delta_t,
87 
89  NekDouble deltaT) const;
90 
91  LUE virtual void print(std::ostream &os) const;
92  LUE virtual void printFull(std::ostream &os) const;
93 
94  // Friend classes
95  LUE friend std::ostream &operator<<(std::ostream &os,
96  const TimeIntegrationSchemeGLM &rhs);
97  LUE friend std::ostream &operator<<(std::ostream &os,
99 
100 protected:
101  // These methods should never be used directly, only used by child classes.
102  LUE TimeIntegrationSchemeGLM(std::string variant, unsigned int order,
103  std::vector<NekDouble> freeParams) :
104  TimeIntegrationScheme(variant, order, freeParams)
105  {
106  boost::ignore_unused(variant, order, freeParams);
107  }
108 
110  {
111  }
112 
114 
116 
117 }; // end class TimeIntegrationScheme
118 
119 LUE std::ostream &operator<<(std::ostream &os,
120  const TimeIntegrationSchemeGLM &rhs);
121 LUE std::ostream &operator<<(std::ostream &os,
123 
124 } // end of namespace LibUtilities
125 } // end of namespace Nektar
126 
127 #endif
#define LUE
Base class for GLM time integration schemes.
TimeIntegrationAlgorithmGLMVector m_integration_phases
virtual LUE std::string GetName() const =0
virtual LUE void InitializeScheme(const NekDouble deltaT, ConstDoubleArray &y_0, const NekDouble time, const TimeIntegrationSchemeOperators &op)
Worker method to initialize the integration scheme.
virtual LUE void print(std::ostream &os) const
Worker method to print details on the integration scheme.
LUE friend std::ostream & operator<<(std::ostream &os, const TimeIntegrationSchemeGLM &rhs)
virtual LUE NekDouble GetTimeStability() const =0
virtual LUE ConstDoubleArray & TimeIntegrate(const int timestep, const NekDouble delta_t, const TimeIntegrationSchemeOperators &op)
Worker method that actually does the time integration.
virtual LUE void InitializeSecondaryData(TimeIntegrationAlgorithmGLM *phase, NekDouble deltaT) const
void SetSolutionVector(const int Offset, const DoubleArray &y)
Sets the solution vector of the ODE.
virtual LUE std::vector< NekDouble > GetFreeParams() const
const TripleArray & GetSolutionVector() const
Gets the solution vector of the ODE.
LUE TimeIntegrationSchemeGLM(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
virtual LUE void printFull(std::ostream &os) const
virtual LUE TimeIntegrationSchemeType GetIntegrationSchemeType() const
Base class for time integration schemes.
Binds a set of functions for use by time integration schemes.
std::shared_ptr< TimeIntegrationSolutionGLM > TimeIntegrationSolutionGLMSharedPtr
std::vector< TimeIntegrationAlgorithmGLMSharedPtr > TimeIntegrationAlgorithmGLMVector
std::shared_ptr< TimeIntegrationSchemeGLM > TimeIntegrationSchemeGLMSharedPtr
std::ostream & operator<<(std::ostream &os, const BasisKey &rhs)
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
double NekDouble