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 -------------------------------------------------------------------------------
12 License
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 
29 Class
30  Foam::quadratic
31 
32 Description
33  Fits a quadratic polynomial of the merit function as a function of step
34  and finds the "optimal" value
35 
36 SourceFiles
37  quadratic.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef quadratic_H
42 #define quadratic_H
43 
44 #include "stepUpdate.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class quadratic Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class quadratic
56 :
57  public stepUpdate
58 {
59 protected:
60 
61  // Protected data
62 
63  scalar minRatio_;
66  scalar meritDerivative_;
67 
68 
69 private:
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 
80 public:
81 
82  //- Runtime type information
83  TypeName("quadratic");
84 
85 
86  // Constructors
87 
88  //- Construct from components
89  quadratic(const dictionary& dict);
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 // ************************************************************************* //
Foam::quadratic::~quadratic
virtual ~quadratic()=default
Destructor.
Foam::quadratic::setDeriv
virtual void setDeriv(const scalar deriv)
Set objective derivative.
Definition: quadratic.C:83
Foam::quadratic::setOldMeritValue
virtual void setOldMeritValue(const scalar value)
Set old merit value.
Definition: quadratic.C:95
stepUpdate.H
Foam::quadratic::updateStep
virtual void updateStep(scalar &step)
Update step in given direction.
Definition: quadratic.C:61
Foam::quadratic::minRatio_
scalar minRatio_
Definition: quadratic.H:62
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::quadratic
Fits a quadratic polynomial of the merit function as a function of step and finds the "optimal" value...
Definition: quadratic.H:54
Foam::quadratic::secondMeritValue_
scalar secondMeritValue_
Definition: quadratic.H:64
Foam::quadratic::TypeName
TypeName("quadratic")
Runtime type information.
Foam::quadratic::setNewMeritValue
virtual void setNewMeritValue(const scalar value)
Set new merit value.
Definition: quadratic.C:89
Foam::stepUpdate
Abstract base class for step update methods used in line search.
Definition: stepUpdate.H:54
Foam::quadratic::firstMeritValue_
scalar firstMeritValue_
Definition: quadratic.H:63
Foam::quadratic::meritDerivative_
scalar meritDerivative_
Definition: quadratic.H:65