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:
55  NekDouble deltaT) const
56  {
57  v_InitializeSecondaryData(phase, deltaT);
58  }
59 
60  // Friend classes
61  LUE friend std::ostream &operator<<(std::ostream &os,
62  const TimeIntegrationSchemeGLM &rhs);
63  LUE friend std::ostream &operator<<(
64  std::ostream &os, const TimeIntegrationSchemeGLMSharedPtr &rhs);
65 
66 protected:
67  // Values stored by each integration phase.
68  LUE virtual std::string v_GetVariant() const override;
69  LUE virtual unsigned int v_GetOrder() const override;
70  LUE virtual std::vector<NekDouble> v_GetFreeParams() const override;
72  const override;
73  LUE virtual unsigned int v_GetNumIntegrationPhases() const override;
74 
75  // Gets the solution Vector
76  virtual const TripleArray &v_GetSolutionVector() const override
77  {
78  return m_solVector->GetSolutionVector();
79  }
80 
81  // Sets the solution Vector
82  virtual void v_SetSolutionVector(const int Offset,
83  const DoubleArray &y) override
84  {
85  m_solVector->SetSolutionVector(Offset, y);
86  }
87 
88  // The worker methods
89  LUE virtual void v_InitializeScheme(
90  const NekDouble deltaT, ConstDoubleArray &y_0, const NekDouble time,
91  const TimeIntegrationSchemeOperators &op) override;
92 
94  const int timestep, const NekDouble delta_t,
95  const TimeIntegrationSchemeOperators &op) override;
96 
97  LUE virtual void v_InitializeSecondaryData(
98  TimeIntegrationAlgorithmGLM *phase, NekDouble deltaT) const;
99 
100  LUE virtual void v_print(std::ostream &os) const override;
101  LUE virtual void v_printFull(std::ostream &os) const override;
102 
103  // These methods should never be used directly, only used by child classes.
104  LUE TimeIntegrationSchemeGLM(std::string variant, unsigned int order,
105  std::vector<NekDouble> freeParams)
106  : TimeIntegrationScheme(variant, order, freeParams)
107  {
108  boost::ignore_unused(variant, order, freeParams);
109  }
110 
112  {
113  }
114 
116 
118 
119 }; // end class TimeIntegrationScheme
120 
121 LUE std::ostream &operator<<(std::ostream &os,
122  const TimeIntegrationSchemeGLM &rhs);
123 LUE std::ostream &operator<<(std::ostream &os,
125 
126 } // end of namespace LibUtilities
127 } // end of namespace Nektar
128 
129 #endif
#define LUE
Base class for GLM time integration schemes.
TimeIntegrationAlgorithmGLMVector m_integration_phases
virtual LUE void v_InitializeSecondaryData(TimeIntegrationAlgorithmGLM *phase, NekDouble deltaT) const
virtual LUE void v_InitializeScheme(const NekDouble deltaT, ConstDoubleArray &y_0, const NekDouble time, const TimeIntegrationSchemeOperators &op) override
Worker method to initialize the integration scheme.
virtual const TripleArray & v_GetSolutionVector() const override
virtual LUE std::string v_GetVariant() const override
virtual LUE unsigned int v_GetOrder() const override
LUE friend std::ostream & operator<<(std::ostream &os, const TimeIntegrationSchemeGLM &rhs)
virtual LUE TimeIntegrationSchemeType v_GetIntegrationSchemeType() const override
virtual void v_SetSolutionVector(const int Offset, const DoubleArray &y) override
LUE TimeIntegrationSchemeGLM(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
virtual LUE void v_printFull(std::ostream &os) const override
virtual LUE void v_print(std::ostream &os) const override
Worker method to print details on the integration scheme.
virtual LUE ConstDoubleArray & v_TimeIntegrate(const int timestep, const NekDouble delta_t, const TimeIntegrationSchemeOperators &op) override
Worker method that actually does the time integration.
LUE void InitializeSecondaryData(TimeIntegrationAlgorithmGLM *phase, NekDouble deltaT) const
virtual LUE unsigned int v_GetNumIntegrationPhases() const override
virtual LUE std::vector< NekDouble > v_GetFreeParams() const override
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:2
double NekDouble