Class implementing a workaround for using the Globally converging wrapper of the MMA update method. Implemented as a lineSearch, even though the search direction changes within each inner iteration of GCMMA, due the existing framework for re-solving the primal equations and checking the convergence of a merit function. More...
#include <GCMMA.H>


Public Member Functions | |
| TypeName ("GCMMA") | |
| Runtime type information. | |
| GCMMA (const dictionary &dict, const Time &time, updateMethod &UpdatheMethod) | |
| Construct from components. | |
| virtual | ~GCMMA ()=default |
| virtual bool | converged () |
| Check whether linear search has converged. | |
| virtual void | updateStep () |
| Actually computes a new direction entirely, targeting the satisfaction of the GCMMA condition. | |
| virtual void | updateCorrection (scalarField &correction) |
| Replace the correction with the one computed in updateStep. | |
| Public Member Functions inherited from lineSearch | |
| TypeName ("lineSearch") | |
| Runtime type information. | |
| declareRunTimeSelectionTable (autoPtr, lineSearch, dictionary,(const dictionary &dict, const Time &time, updateMethod &UpdateMethod),(dict, time, UpdateMethod)) | |
| lineSearch (const dictionary &dict, const Time &time, updateMethod &UpdateMethod) | |
| Construct from components. | |
| virtual | ~lineSearch ()=default |
| Destructor. | |
| virtual void | setDeriv (const scalar deriv) |
| Set directional derivative. | |
| virtual void | setNewDeriv (const scalar deriv) |
| Set new directional derivative. | |
| void | setDirection (const scalarField &direction) |
| Set direction. | |
| void | setNewMeritValue (const scalar value) |
| Set new objective value. | |
| void | setOldMeritValue (const scalar value) |
| Set old objective value. | |
| virtual void | reset () |
| Reset step to initial value. | |
| label | innerIter () const |
| Get inner line search iteration. | |
| label | maxIters () const |
| Get max number of iterations. | |
| scalar | step () const |
| Get current step. | |
| virtual void | updateStep (const scalar newStep) |
| Update the step using the supplied value. | |
| virtual bool | loop () |
| Return true if lineSearch should continue and if so increment inner. | |
| virtual bool | computeGradient () const |
| Does line search need to update the gradient? | |
| virtual void | postUpdate () |
| Execute steps at the end of the line search iterations. | |
| virtual lineSearch & | operator++ () |
| Increment iteration number and store merit value corresponding to the previous optimisation cycle. | |
| virtual lineSearch & | operator++ (int) |
| Postfix increment. Necessary for compilation. | |
Protected Member Functions | |
| void | writeToFiles (bool isConverged) |
| Write rho and objective/constraint values & approx to files. | |
| Protected Member Functions inherited from lineSearch | |
| const dictionary & | coeffsDict () |
| Optional coeffs dict. | |
Protected Attributes | |
| MMA & | mma_ |
| Cast of the update method to MMA. | |
| OFstream | GCMMAFile_ |
| File with rho values in each inner loop. | |
| OFstream | costFile_ |
| File with CPU cost in each inner loop. | |
| label | cost_ |
| Total cost, measured in Equivalent Flow Solutions, up to this cycle. | |
| bool | writeHeader_ |
| Write the header of the output files. | |
| Protected Attributes inherited from lineSearch | |
| const dictionary | dict_ |
| Subdict within updateMethod. | |
| IOdictionary | lineSearchDict_ |
| IOdictionary under time/uniform for continuation. | |
| scalar | directionalDeriv_ |
| Directional derivative of the merit function. | |
| scalarField | direction_ |
| Update direction. | |
| scalar | oldMeritValue_ |
| Old merit value from this opt cycle. | |
| scalar | newMeritValue_ |
| New merit value from this opt cycle. | |
| scalar | prevMeritDeriv_ |
| Merit directional deriv from the previous opt cycle. | |
| scalar | initialStep_ |
| Correction multiplier at the first step of line search. | |
| scalar | minStep_ |
| Minimum allowed correction multiplier. | |
| scalar | step_ |
| Correction multiplier. | |
| label | iter_ |
| Optimisation cycle. | |
| label | innerIter_ |
| Inner line search iteration. | |
| label | maxIters_ |
| Maximum line search iterations. | |
| bool | extrapolateInitialStep_ |
| Whether to extrapolate the correction multiplier for this optimisation cycle based on the previous ones. | |
| autoPtr< stepUpdate > | stepUpdate_ |
| Mechanism to update method if line search conditions are not set. | |
| updateMethod & | updateMethod_ |
| Reference to the update method related to the line search. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from lineSearch | |
| static autoPtr< lineSearch > | New (const dictionary &dict, const Time &time, updateMethod &UpdateMethod) |
| Return a reference to the selected turbulence model. | |
Class implementing a workaround for using the Globally converging wrapper of the MMA update method. Implemented as a lineSearch, even though the search direction changes within each inner iteration of GCMMA, due the existing framework for re-solving the primal equations and checking the convergence of a merit function.
Reference:
Svanberg, K. (2002)
A class of globally convergent optimization methods based on
conservative convex separable approximations.
SIAM Journal of Optimization, 12), 555-573.
https://doi.org/10.1137/S1052623499362822
| GCMMA | ( | const dictionary & | dict, |
| const Time & | time, | ||
| updateMethod & | UpdatheMethod ) |
Construct from components.
Definition at line 120 of file GCMMA.C.
References cost_, costFile_, dict, GCMMAFile_, mma_, Foam::refCast(), timeName, and writeHeader_.

|
virtualdefault |
|
protected |
Write rho and objective/constraint values & approx to files.
Definition at line 42 of file GCMMA.C.
References cost_, costFile_, IOstream::defaultPrecision(), Foam::endl(), forAll, GCMMAFile_, lineSearch::innerIter_, lineSearch::iter_, UPstream::master(), mma_, Foam::setw(), UList< T >::size(), and writeHeader_.
Referenced by converged().


| TypeName | ( | "GCMMA" | ) |
Runtime type information.
References dict.
|
virtual |
Check whether linear search has converged.
Implements lineSearch.
Definition at line 146 of file GCMMA.C.
References DebugInfo, Foam::endl(), mma_, and writeToFiles().

|
virtual |
Actually computes a new direction entirely, targeting the satisfaction of the GCMMA condition.
Implements lineSearch.
Definition at line 159 of file GCMMA.C.
References DebugInfo, Foam::endl(), and mma_.

|
virtual |
Replace the correction with the one computed in updateStep.
Reimplemented from lineSearch.
Definition at line 172 of file GCMMA.C.
References Foam::correction(), and mma_.

|
protected |
Cast of the update method to MMA.
Definition at line 73 of file GCMMA.H.
Referenced by converged(), GCMMA(), updateCorrection(), updateStep(), and writeToFiles().
|
protected |
File with rho values in each inner loop.
Definition at line 78 of file GCMMA.H.
Referenced by GCMMA(), and writeToFiles().
|
protected |
File with CPU cost in each inner loop.
Definition at line 83 of file GCMMA.H.
Referenced by GCMMA(), and writeToFiles().
|
protected |
Total cost, measured in Equivalent Flow Solutions, up to this cycle.
Definition at line 88 of file GCMMA.H.
Referenced by GCMMA(), and writeToFiles().
|
protected |
Write the header of the output files.
Definition at line 93 of file GCMMA.H.
Referenced by GCMMA(), and writeToFiles().