The quasi-Newton BFGS formula. More...
Public Member Functions | |
TypeName ("BFGS") | |
Runtime type information. More... | |
BFGS (const fvMesh &mesh, const dictionary &dict) | |
Construct from components. More... | |
virtual | ~BFGS ()=default |
Destructor. More... | |
void | computeCorrection () |
Compute design variables correction. More... | |
virtual void | updateOldCorrection (const scalarField &oldCorrection) |
virtual void | write () |
Write old info to dict. More... | |
![]() | |
TypeName ("updateMethod") | |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, updateMethod, dictionary,(const fvMesh &mesh, const dictionary &dict),(mesh, dict)) | |
updateMethod (const fvMesh &mesh, const dictionary &dict) | |
Construct from components. More... | |
virtual | ~updateMethod ()=default |
Destructor. More... | |
void | setObjectiveDeriv (const scalarField &derivs) |
Set objective derivative. More... | |
void | setConstraintDeriv (const PtrList< scalarField > &derivs) |
Set constraints derivative. More... | |
void | setObjectiveValue (const scalar value) |
Set constraints derivative. More... | |
void | setConstraintValues (const scalarField &values) |
Set constraints derivative. More... | |
void | setStep (const scalar eta) |
Set step for optimisation methods. More... | |
void | setGlobalSum (const bool useGlobalSum) |
Set globalSum variable. More... | |
scalarField & | returnCorrection () |
Return the correction of the design variables. More... | |
void | writeCorrection () |
virtual scalar | computeMeritFunction () |
virtual scalar | meritFunctionDirectionalDerivative () |
bool & | initialEtaSet () |
Return whether initial eta was set. More... | |
Protected Member Functions | |
void | allocateMatrices () |
Allocate matrices in the first optimisation cycle. More... | |
void | updateHessian () |
Update approximation of the inverse Hessian. More... | |
void | update () |
Update design variables. More... | |
void | readFromDict () |
Read old info from dict. More... | |
![]() | |
const scalarField | leftMult (const scalarField &, const SquareMatrix< scalar > &) |
const scalarField | rightMult (const SquareMatrix< scalar > &, const scalarField &) |
SquareMatrix< scalar > | outerProd (const scalarField &, const scalarField &) |
SquareMatrix< scalar > | inv (SquareMatrix< scalar > A) |
scalar | globalSum (const scalarField &field) |
Compute either global or local sum, based on globalSum flag. More... | |
scalar | globalSum (tmp< scalarField > &tfield) |
Compute either global or local sum, based on globalSum flag. More... | |
dictionary | coeffsDict () |
Return optional dictionary with parameters specific to each method. More... | |
Protected Attributes | |
scalar | etaHessian_ |
Step for the Newton method. More... | |
label | nSteepestDescent_ |
Number of first steepest descent steps. More... | |
labelList | activeDesignVars_ |
Map to active design variables. More... | |
bool | scaleFirstHessian_ |
Scale the iniitial unitary Hessian approximation. More... | |
scalar | curvatureThreshold_ |
Curvature threshold. More... | |
SquareMatrix< scalar > | HessianInv_ |
SquareMatrix< scalar > | HessianInvOld_ |
The previous Hessian inverse. More... | |
scalarField | derivativesOld_ |
The previous derivatives. More... | |
scalarField | correctionOld_ |
The previous correction. More... | |
label | counter_ |
Optimisation cycle counter. More... | |
![]() | |
const fvMesh & | mesh_ |
const dictionary | dict_ |
IOdictionary | optMethodIODict_ |
Used to output values useful for continuation runs. More... | |
scalarField | objectiveDerivatives_ |
Derivatives of the objective functions. More... | |
PtrList< scalarField > | constraintDerivatives_ |
Derivatives of the constraints. More... | |
scalar | objectiveValue_ |
Objective value. More... | |
scalarField | cValues_ |
Constraint values. More... | |
scalarField | correction_ |
Design variables correction. More... | |
scalarField | cumulativeCorrection_ |
scalar | eta_ |
Step multiplying the correction. More... | |
bool | initialEtaSet_ |
Is initially set? More... | |
word | correctionFolder_ |
Folder storing the corrections to file. More... | |
bool | globalSum_ |
Whether to use gSum or sum in the inner products. More... | |
Additional Inherited Members | |
![]() | |
static autoPtr< updateMethod > | New (const fvMesh &mesh, const dictionary &dict) |
Return a reference to the selected turbulence model. More... | |
BFGS | ( | const fvMesh & | mesh, |
const dictionary & | dict | ||
) |
Construct from components.
Definition at line 169 of file BFGS.C.
References Foam::endl(), and Foam::Info.
|
virtualdefault |
Destructor.
|
protected |
Allocate matrices in the first optimisation cycle.
Definition at line 49 of file BFGS.C.
References BFGS::activeDesignVars_, BFGS::HessianInv_, BFGS::HessianInvOld_, Foam::I, Foam::identity(), and updateMethod::objectiveDerivatives_.
|
protected |
Update approximation of the inverse Hessian.
Definition at line 67 of file BFGS.C.
References DebugInfo, Foam::endl(), forAll, Foam::Info, s, Foam::sqr(), WarningInFunction, y, and Foam::Zero.
|
protected |
Update design variables.
Definition at line 109 of file BFGS.C.
References Foam::endl(), forAll, Foam::Info, Field< Type >::map(), and Foam::Zero.
|
protected |
Read old info from dict.
Definition at line 144 of file BFGS.C.
References Foam::identity(), n, and Foam::Zero.
TypeName | ( | "BFGS" | ) |
Runtime type information.
|
virtual |
Compute design variables correction.
Implements updateMethod.
Definition at line 217 of file BFGS.C.
References update().
|
virtual |
Update old correction. Useful for quasi-Newton methods coupled with line search
Reimplemented from updateMethod.
Definition at line 233 of file BFGS.C.
References updateMethod::updateOldCorrection().
|
virtual |
Write old info to dict.
Reimplemented from updateMethod.
Definition at line 240 of file BFGS.C.
References updateMethod::write().
|
protected |
|
protected |
Map to active design variables.
Definition at line 80 of file BFGS.H.
Referenced by BFGS::allocateMatrices().
|
protected |
|
protected |
The Hessian inverse. Should have the size of the active design variables
Definition at line 90 of file BFGS.H.
Referenced by BFGS::allocateMatrices().
|
protected |
The previous Hessian inverse.
Definition at line 93 of file BFGS.H.
Referenced by BFGS::allocateMatrices().
|
protected |
|
protected |