quadratic.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::quadratic
31
32Description
33 Fits a quadratic polynomial of the merit function as a function of step
34 and finds the "optimal" value
35
36SourceFiles
37 quadratic.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef quadratic_H
42#define quadratic_H
43
44#include "stepUpdate.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51/*---------------------------------------------------------------------------*\
52 Class quadratic Declaration
53\*---------------------------------------------------------------------------*/
55class quadratic
56:
57 public stepUpdate
58{
59protected:
60
61 // Protected data
63 scalar minRatio_;
66 scalar meritDerivative_;
67
68
69private:
70
71 // Private Member Functions
72
73 //- No copy construct
74 quadratic(const quadratic&) = delete;
75
76 //- No copy assignment
77 void operator=(const quadratic&) = delete;
78
79
80public:
81
82 //- Runtime type information
83 TypeName("quadratic");
84
85
86 // Constructors
87
88 //- Construct from components
90
91
92 //- Destructor
93 virtual ~quadratic() = default;
94
95
96 // Member Functions
97
98 //- Update step in given direction
99 virtual void updateStep(scalar& step);
100
101 //- Set objective derivative
102 virtual void setDeriv(const scalar deriv);
103
104 //- Set new merit value
105 virtual void setNewMeritValue(const scalar value);
106
107 //- Set old merit value
108 virtual void setOldMeritValue(const scalar value);
109};
110
111
112// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113
114} // End namespace Foam
115
116// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117
118#endif
119
120// ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Fits a quadratic polynomial of the merit function as a function of step and finds the "optimal" value...
Definition: quadratic.H:57
virtual void setDeriv(const scalar deriv)
Set objective derivative.
Definition: quadratic.C:83
virtual void updateStep(scalar &step)
Update step in given direction.
Definition: quadratic.C:61
virtual ~quadratic()=default
Destructor.
TypeName("quadratic")
Runtime type information.
scalar meritDerivative_
Definition: quadratic.H:65
scalar minRatio_
Definition: quadratic.H:62
virtual void setOldMeritValue(const scalar value)
Set old merit value.
Definition: quadratic.C:95
scalar firstMeritValue_
Definition: quadratic.H:63
virtual void setNewMeritValue(const scalar value)
Set new merit value.
Definition: quadratic.C:89
scalar secondMeritValue_
Definition: quadratic.H:64
Abstract base class for step update methods used in line search.
Definition: stepUpdate.H:55
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73