Loading...
Searching...
No Matches
steadyOptimisation.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2007-2023 PCOpt/NTUA
9 Copyright (C) 2013-2023 FOSS GP
10 Copyright (C) 2019 OpenCFD Ltd.
11-------------------------------------------------------------------------------
12License
13 This file is part of OpenFOAM.
14
15 OpenFOAM is free software: you can redistribute it and/or modify it
16 under the terms of the GNU General Public License as published by
17 the Free Software Foundation, either version 3 of the License, or
18 (at your option) any later version.
19
20 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27
28
29Class
30 Foam::steadyOptimisation
31
32Description
33 Iterate the optimisation cycles. For steady state opt, this coinsides
34 with evolving Time
35
36SourceFiles
37 steadyOptimisation.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef steadyOptimisation_H
42#define steadyOptimisation_H
43
44#include "optimisationManager.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
51/*---------------------------------------------------------------------------*\
52 Class steadyOptimisation Declaration
53\*---------------------------------------------------------------------------*/
54
55class steadyOptimisation
56:
57 public optimisationManager
58{
59private:
60
61 // Private Member Functions
62
63 //- No copy construct
64 steadyOptimisation(const steadyOptimisation&) = delete;
65
66 //- No copy assignment
67 void operator=(const steadyOptimisation&) = delete;
68
69
70protected:
71
72 // Protected Member Functions
73
74 //- Update design variables using a line-search
75 void lineSearchUpdate();
77 //- Update design variables using a fixed step
78 void fixedStepUpdate();
79
80
81public:
82
83 //- Runtime type information
84 TypeName("steadyOptimisation");
85
86
87 // Constructors
88
89 //- Construct from components
90 steadyOptimisation(fvMesh& mesh);
91
92
93 // Destructor
94 virtual ~steadyOptimisation() = default;
95
96
97 // Member Functions
98
99 //- Prefix increment
100 virtual optimisationManager& operator++();
102 //- Postfix increment, this is identical to the prefix increment
103 virtual optimisationManager& operator++(int);
104
105 //- Return true if end of optimisation run
106 // Also, updates the design variables if needed
107 virtual bool checkEndOfLoopAndUpdate();
108
109 //- Return true if end of optimisation run
110 virtual bool end();
111
112 //- Whether to update the design variables
113 virtual bool update();
114};
115
116
117// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118
119} // End namespace Foam
120
121// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122
123#endif
124
125// ************************************************************************* //
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
virtual ~steadyOptimisation()=default
TypeName("steadyOptimisation")
Runtime type information.
virtual optimisationManager & operator++()
Prefix increment.
virtual bool update()
Whether to update the design variables.
virtual bool checkEndOfLoopAndUpdate()
Return true if end of optimisation run.
void lineSearchUpdate()
Update design variables using a line-search.
virtual bool end()
Return true if end of optimisation run.
void fixedStepUpdate()
Update design variables using a fixed step.
dynamicFvMesh & mesh
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68