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
43namespace Nektar
44{
45namespace LibUtilities
46{
47
48/**
49 * @brief Base class for GLM time integration schemes.
50 */
52{
53public:
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
66protected:
67 // Values stored by each integration phase.
68 LUE virtual std::string v_GetVariant() const override;
69 LUE virtual size_t v_GetOrder() const override;
70 LUE virtual std::vector<NekDouble> v_GetFreeParams() const override;
72 const override;
73 LUE virtual size_t v_GetNumIntegrationPhases() const override;
74
75 // Gets the solution Vector
76 LUE virtual const TripleArray &v_GetSolutionVector() const override
77 {
78 return m_solVector->GetSolutionVector();
79 }
80
82 {
83 return m_solVector->UpdateSolutionVector();
84 }
85
86 // Sets the solution Vector
87 LUE virtual void v_SetSolutionVector(const size_t Offset,
88 const DoubleArray &y) override
89 {
90 m_solVector->SetSolutionVector(Offset, y);
91 }
92
93 // The worker methods
94 LUE virtual void v_InitializeScheme(
95 const NekDouble deltaT, ConstDoubleArray &y_0, const NekDouble time,
96 const TimeIntegrationSchemeOperators &op) override;
97
99 const size_t timestep, const NekDouble delta_t) override;
100
101 LUE virtual void v_InitializeSecondaryData(
102 TimeIntegrationAlgorithmGLM *phase, NekDouble deltaT) const;
103
104 LUE virtual void v_print(std::ostream &os) const override;
105 LUE virtual void v_printFull(std::ostream &os) const override;
106
107 // These methods should never be used directly, only used by child classes.
108 LUE TimeIntegrationSchemeGLM(std::string variant, size_t order,
109 std::vector<NekDouble> freeParams)
110 : TimeIntegrationScheme(variant, order, freeParams)
111 {
112 boost::ignore_unused(variant, order, freeParams);
113 }
114
116 {
117 }
118
120
122
123}; // end class TimeIntegrationScheme
124
125LUE std::ostream &operator<<(std::ostream &os,
126 const TimeIntegrationSchemeGLM &rhs);
127LUE std::ostream &operator<<(std::ostream &os,
129
130} // end of namespace LibUtilities
131} // end of namespace Nektar
132
133#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.
LUE TimeIntegrationSchemeGLM(std::string variant, size_t order, std::vector< NekDouble > freeParams)
virtual LUE std::string v_GetVariant() const override
LUE friend std::ostream & operator<<(std::ostream &os, const TimeIntegrationSchemeGLM &rhs)
virtual LUE TripleArray & v_UpdateSolutionVector() override
virtual LUE TimeIntegrationSchemeType v_GetIntegrationSchemeType() const override
virtual LUE const TripleArray & v_GetSolutionVector() const override
virtual LUE void v_SetSolutionVector(const size_t Offset, const DoubleArray &y) override
virtual LUE size_t v_GetNumIntegrationPhases() const override
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.
LUE void InitializeSecondaryData(TimeIntegrationAlgorithmGLM *phase, NekDouble deltaT) const
virtual LUE ConstDoubleArray & v_TimeIntegrate(const size_t timestep, const NekDouble delta_t) override
Worker method that actually does the time integration.
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