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...
Public Member Functions | |
TypeName ("GCMMA") | |
Runtime type information. More... | |
GCMMA (const dictionary &dict, const Time &time, updateMethod &UpdatheMethod) | |
Construct from components. More... | |
virtual | ~GCMMA ()=default |
virtual bool | converged () |
Check whether linear search has converged. More... | |
virtual void | updateStep () |
Actually computes a new direction entirely, targeting the satisfaction of the GCMMA condition. More... | |
virtual void | updateCorrection (scalarField &correction) |
Replace the correction with the one computed in updateStep. More... | |
Public Member Functions inherited from lineSearch | |
TypeName ("lineSearch") | |
Runtime type information. More... | |
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. More... | |
virtual | ~lineSearch ()=default |
Destructor. More... | |
virtual void | setDeriv (const scalar deriv) |
Set directional derivative. More... | |
virtual void | setNewDeriv (const scalar deriv) |
Set new directional derivative. More... | |
void | setDirection (const scalarField &direction) |
Set direction. More... | |
void | setNewMeritValue (const scalar value) |
Set new objective value. More... | |
void | setOldMeritValue (const scalar value) |
Set old objective value. More... | |
virtual void | reset () |
Reset step to initial value. More... | |
label | innerIter () const |
Get inner line search iteration. More... | |
label | maxIters () const |
Get max number of iterations. More... | |
scalar | step () const |
Get current step. More... | |
virtual void | updateStep (const scalar newStep) |
Update the step using the supplied value. More... | |
virtual bool | loop () |
Return true if lineSearch should continue and if so increment inner. More... | |
virtual bool | computeGradient () const |
Does line search need to update the gradient? More... | |
virtual void | postUpdate () |
Execute steps at the end of the line search iterations. More... | |
virtual lineSearch & | operator++ () |
Increment iteration number and store merit value corresponding to the previous optimisation cycle. More... | |
virtual lineSearch & | operator++ (int) |
Postfix increment. Necessary for compilation. More... | |
Protected Member Functions | |
void | writeToFiles (bool isConverged) |
Write rho and objective/constraint values & approx to files. More... | |
Protected Member Functions inherited from lineSearch | |
const dictionary & | coeffsDict () |
Optional coeffs dict. More... | |
Protected Attributes | |
MMA & | mma_ |
Cast of the update method to MMA. More... | |
OFstream | GCMMAFile_ |
File with rho values in each inner loop. More... | |
OFstream | costFile_ |
File with CPU cost in each inner loop. More... | |
label | cost_ |
Total cost, measured in Equivalent Flow Solutions, up to this cycle. More... | |
bool | writeHeader_ |
Write the header of the output files. More... | |
Protected Attributes inherited from lineSearch | |
const dictionary | dict_ |
Subdict within updateMethod. More... | |
IOdictionary | lineSearchDict_ |
IOdictionary under time/uniform for continuation. More... | |
scalar | directionalDeriv_ |
Directional derivative of the merit function. More... | |
scalarField | direction_ |
Update direction. More... | |
scalar | oldMeritValue_ |
Old merit value from this opt cycle. More... | |
scalar | newMeritValue_ |
New merit value from this opt cycle. More... | |
scalar | prevMeritDeriv_ |
Merit directional deriv from the previous opt cycle. More... | |
scalar | initialStep_ |
Correction multiplier at the first step of line search. More... | |
scalar | minStep_ |
Minimum allowed correction multiplier. More... | |
scalar | step_ |
Correction multiplier. More... | |
label | iter_ |
Optimisation cycle. More... | |
label | innerIter_ |
Inner line search iteration. More... | |
label | maxIters_ |
Maximum line search iterations. More... | |
bool | extrapolateInitialStep_ |
Whether to extrapolate the correction multiplier for this optimisation cycle based on the previous ones. More... | |
autoPtr< stepUpdate > | stepUpdate_ |
Mechanism to update method if line search conditions are not set. More... | |
updateMethod & | updateMethod_ |
Reference to the update method related to the line search. More... | |
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. More... | |
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.
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 | ||
) |
|
virtualdefault |
|
protected |
Write rho and objective/constraint values & approx to files.
Definition at line 42 of file GCMMA.C.
References GCMMA::cost_, GCMMA::costFile_, IOstream::defaultPrecision(), Foam::endl(), forAll, GCMMA::GCMMAFile_, MMA::getRho(), MMA::getValuesAndApproximations(), lineSearch::innerIter_, lineSearch::iter_, UPstream::master(), GCMMA::mma_, Foam::setw(), UList< T >::size(), and GCMMA::writeHeader_.
TypeName | ( | "GCMMA" | ) |
Runtime type information.
|
virtual |
Check whether linear search has converged.
Implements lineSearch.
Definition at line 146 of file GCMMA.C.
References DebugInfo, and Foam::endl().
|
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, and Foam::endl().
|
virtual |
Replace the correction with the one computed in updateStep.
Reimplemented from lineSearch.
Definition at line 172 of file GCMMA.C.
References Foam::correction().
|
protected |
Cast of the update method to MMA.
Definition at line 73 of file GCMMA.H.
Referenced by GCMMA::writeToFiles().
|
protected |
File with rho values in each inner loop.
Definition at line 78 of file GCMMA.H.
Referenced by GCMMA::writeToFiles().
|
protected |
File with CPU cost in each inner loop.
Definition at line 83 of file GCMMA.H.
Referenced by GCMMA::writeToFiles().
|
protected |
Total cost, measured in Equivalent Flow Solutions, up to this cycle.
Definition at line 88 of file GCMMA.H.
Referenced by GCMMA::writeToFiles().
|
protected |
Write the header of the output files.
Definition at line 93 of file GCMMA.H.
Referenced by GCMMA::writeToFiles().