optimisationManager.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-2019 PCOpt/NTUA
9 Copyright (C) 2013-2019 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::optimisationManager
31
32Description
33 Abstract base class for optimisation methods
34
35SourceFiles
36 optimisationManager.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef optimisationManager_H
41#define optimisationManager_H
42
44#include "IOdictionary.H"
46#include "primalSolver.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
53
54/*---------------------------------------------------------------------------*\
55 Class optimisationManager Declaration
56\*---------------------------------------------------------------------------*/
59:
60 public IOdictionary
61{
62protected:
63
64 // Protected data
72
73
74private:
75
76 // Private Member Functions
77
78 //- No copy construct
80
81 //- No copy assignment
82 void operator=(const optimisationManager&) = delete;
83
84
85public:
86
87 //- Runtime type information
88 TypeName("optimisationManager");
89
90
91 // Declare run-time constructor selection table
94 (
95 autoPtr,
98 (
100 ),
101 (mesh)
102 );
103
104
105 // Constructors
106
107 //- Construct from components
109
110
111 // Selectors
112
113 //- Return a reference to the selected turbulence model
115
116
117 //- Destructor
118 virtual ~optimisationManager() = default;
119
120
121 // Member Functions
122
124
126
127 virtual bool read();
128
129 //- Prefix increment,
130 virtual optimisationManager& operator++() = 0;
131
132 //- Postfix increment, this is identical to the prefix increment
133 virtual optimisationManager& operator++(int) = 0;
134
135 //- Return true if end of optimisation run.
136 // Also, updates the design variables if needed
137 virtual bool checkEndOfLoopAndUpdate() = 0;
138
139 //- Return true if end of optimisation run
140 virtual bool end() = 0;
141
142 //- Whether to update the design variables
143 virtual bool update() = 0;
144
145 //- Update design variables.
146 // Might employ a line search to find a correction satisfying the step
147 // convergence criteria
148 virtual void updateDesignVariables() = 0;
149
150 //- Solve all primal equations
151 virtual void solvePrimalEquations();
152
153 //- Solve all adjoint equations
154 virtual void solveAdjointEquations();
155
156 //- Compute all adjoint sensitivities
157 virtual void computeSensitivities();
158
159 //- Solve all primal equations
160 virtual void updatePrimalBasedQuantities();
161};
162
163
164// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166} // End namespace Foam
167
168// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169
170#endif
171
172// ************************************************************************* //
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Abstract base class for optimisation methods.
virtual ~optimisationManager()=default
Destructor.
virtual bool end()=0
Return true if end of optimisation run.
virtual bool checkEndOfLoopAndUpdate()=0
Return true if end of optimisation run.
TypeName("optimisationManager")
Runtime type information.
virtual optimisationManager & operator++(int)=0
Postfix increment, this is identical to the prefix increment.
declareRunTimeSelectionTable(autoPtr, optimisationManager, dictionary,(fvMesh &mesh),(mesh))
virtual void updateDesignVariables()=0
Update design variables.
autoPtr< incompressible::optimisationType > optType_
virtual optimisationManager & operator++()=0
Prefix increment,.
virtual bool update()=0
Whether to update the design variables.
virtual void solvePrimalEquations()
Solve all primal equations.
virtual void updatePrimalBasedQuantities()
Solve all primal equations.
PtrList< adjointSolverManager > adjointSolverManagers_
virtual void solveAdjointEquations()
Solve all adjoint equations.
virtual PtrList< adjointSolverManager > & adjointSolverManagers()
PtrList< primalSolver > primalSolvers_
static autoPtr< optimisationManager > New(fvMesh &mesh)
Return a reference to the selected turbulence model.
virtual void computeSensitivities()
Compute all adjoint sensitivities.
virtual PtrList< primalSolver > & primalSolvers()
virtual bool read()
Read object.
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73