singleRun.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-2020 PCOpt/NTUA
9 Copyright (C) 2013-2020 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::singleRun
31
32Description
33 Update design variables using steepest descent
34
35SourceFiles
36 singleRun.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef singleRun_H
41#define singleRun_H
42
43#include "optimisationManager.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class singleRun Declaration
52\*---------------------------------------------------------------------------*/
54class singleRun
55:
57{
58protected:
59
60 // Protected data
61 label cycles_;
62
63
64private:
65
66 // Private Member Functions
67
68 //- No copy construct
69 singleRun(const singleRun&) = delete;
70
71 //- No copy assignment
72 void operator=(const singleRun&) = delete;
73
74
75public:
76
77 //- Runtime type information
78 TypeName("singleRun");
79
80
81 // Constructors
82
83 //- Construct from components
85
86
87 //- Destructor
88 virtual ~singleRun() = default;
89
90
91 // Member Functions
92
93 //- Prefix increment
95
96 //- Postfix increment, this is identical to the prefix increment
97 virtual optimisationManager& operator++(int);
98
99 //- Return true if end of optimisation run.
100 // Also, updates the design variables if needed
101 virtual bool checkEndOfLoopAndUpdate();
102
103 //- Return true if end of optimisation run
104 virtual bool end();
105
106 //- Whether to update the design variables
107 virtual bool update();
108
109 //- Update design variables.
110 // Does nothing
111 virtual void updateDesignVariables();
112};
113
114
115// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116
117} // End namespace Foam
118
119// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120
121#endif
122
123// ************************************************************************* //
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Abstract base class for optimisation methods.
Update design variables using steepest descent.
Definition: singleRun.H:56
virtual ~singleRun()=default
Destructor.
virtual optimisationManager & operator++()
Prefix increment.
Definition: singleRun.C:53
virtual void updateDesignVariables()
Update design variables.
Definition: singleRun.C:86
TypeName("singleRun")
Runtime type information.
virtual bool update()
Whether to update the design variables.
Definition: singleRun.C:79
virtual bool checkEndOfLoopAndUpdate()
Return true if end of optimisation run.
Definition: singleRun.C:66
virtual bool end()
Return true if end of optimisation run.
Definition: singleRun.C:72
dynamicFvMesh & mesh
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73