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