Abstract base class for optimisation methods. More...


Public Member Functions | |
| 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... | |
| virtual void | computeCorrection ()=0 |
| Return the correction of the design variables. More... | |
| scalarField & | returnCorrection () |
| Return the correction of the design variables. More... | |
| void | writeCorrection () |
| virtual scalar | computeMeritFunction () |
| Compute merit function. Could be different than the objective in the presence of constraints. More... | |
| virtual scalar | meritFunctionDirectionalDerivative () |
| Directional derivative of the merit function, in the direction of the correction. Could be different than the objective directional derivative in the presence of constraints. More... | |
| bool & | initialEtaSet () |
| Return whether initial eta was set. More... | |
| virtual void | updateOldCorrection (const scalarField &oldCorrection) |
| Update old correction. useful for quasi-newton methods coupled with line search. More... | |
| virtual void | write () |
| Write useful quantities to files. More... | |
Static Public Member Functions | |
| static autoPtr< updateMethod > | New (const fvMesh &mesh, const dictionary &dict) |
| Return a reference to the selected turbulence model. More... | |
Protected Member Functions | |
| 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 | |
| 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_ |
| Cumulative design variables correction throughout the optimisation loop. More... | |
| 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... | |
Abstract base class for optimisation methods.
Definition at line 50 of file updateMethod.H.
| updateMethod | ( | const fvMesh & | mesh, |
| const dictionary & | dict | ||
| ) |
Construct from components.
Definition at line 194 of file updateMethod.C.
References dict, UPstream::master(), Foam::mkDir(), and dictionary::readIfPresent().

|
virtualdefault |
Destructor.
|
protected |
Definition at line 38 of file updateMethod.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, Matrix< Form, Type >::n(), s, and Foam::Zero.

|
protected |
Definition at line 65 of file updateMethod.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, Matrix< Form, Type >::n(), s, and Foam::Zero.

|
protected |
Definition at line 92 of file updateMethod.C.
References Foam::abort(), Foam::constant::physicoChemical::b, Foam::FatalError, FatalErrorInFunction, forAll, UList< T >::size(), and Foam::Zero.

|
protected |
Definition at line 118 of file updateMethod.C.
References A, DebugInfo, Foam::endl(), invA(), Foam::LUBacksubstitute(), Foam::LUDecompose(), n, and Foam::Zero.
Referenced by constraintProjection::computeCorrection().


|
protected |
Compute either global or local sum, based on globalSum flag.
Definition at line 168 of file updateMethod.C.
References field(), Foam::gSum(), and Foam::sum().
Referenced by constraintProjection::computeCorrection().


|
protected |
Compute either global or local sum, based on globalSum flag.
Definition at line 183 of file updateMethod.C.
References tmp< T >::clear().

|
protected |
Return optional dictionary with parameters specific to each method.
Definition at line 247 of file updateMethod.C.
References dictionary::subOrEmptyDict(), and Foam::type().
Referenced by SQP::SQP(), and SR1::SR1().


| TypeName | ( | "updateMethod" | ) |
Runtime type information.
| declareRunTimeSelectionTable | ( | autoPtr | , |
| updateMethod | , | ||
| dictionary | , | ||
| (const fvMesh &mesh, const dictionary &dict) | , | ||
| (mesh, dict) | |||
| ) |
|
static |
Return a reference to the selected turbulence model.
Definition at line 256 of file updateMethod.C.
References dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, dictionary::get(), Foam::Info, and mesh.

| void setObjectiveDeriv | ( | const scalarField & | derivs | ) |
Set objective derivative.
Definition at line 284 of file updateMethod.C.
| void setConstraintDeriv | ( | const PtrList< scalarField > & | derivs | ) |
Set constraints derivative.
Definition at line 291 of file updateMethod.C.
| void setObjectiveValue | ( | const scalar | value | ) |
Set constraints derivative.
Definition at line 299 of file updateMethod.C.
| void setConstraintValues | ( | const scalarField & | values | ) |
Set constraints derivative.
Definition at line 305 of file updateMethod.C.
References Foam::HashTableOps::values().

| void setStep | ( | const scalar | eta | ) |
Set step for optimisation methods.
Definition at line 311 of file updateMethod.C.
| void setGlobalSum | ( | const bool | useGlobalSum | ) |
Set globalSum variable.
Should be set by the optimisationType owining the updateMethod
Definition at line 317 of file updateMethod.C.
|
pure virtual |
Return the correction of the design variables.
Implemented in SQP, LBFGS, DBFGS, BFGS, SR1, conjugateGradient, constrainedOptimisationMethod, constraintProjection, and steepestDescent.
| Foam::scalarField & returnCorrection | ( | ) |
Return the correction of the design variables.
const scalarField& returnCorrection() const;
Return the correction of the design variables
Definition at line 323 of file updateMethod.C.
| void writeCorrection | ( | ) |
Definition at line 330 of file updateMethod.C.
References Foam::endl(), forAll, UPstream::master(), and Foam::Zero.

|
virtual |
Compute merit function. Could be different than the objective in the presence of constraints.
Reimplemented in SQP.
Definition at line 364 of file updateMethod.C.
|
virtual |
Directional derivative of the merit function, in the direction of the correction. Could be different than the objective directional derivative in the presence of constraints.
Reimplemented in SQP.
Definition at line 370 of file updateMethod.C.
| bool & initialEtaSet | ( | ) |
Return whether initial eta was set.
Definition at line 376 of file updateMethod.C.
|
virtual |
Update old correction. useful for quasi-newton methods coupled with line search.
Reimplemented in SQP, LBFGS, DBFGS, BFGS, SR1, and conjugateGradient.
Definition at line 383 of file updateMethod.C.
Referenced by SR1::updateOldCorrection(), BFGS::updateOldCorrection(), DBFGS::updateOldCorrection(), LBFGS::updateOldCorrection(), and SQP::updateOldCorrection().

|
virtual |
Write useful quantities to files.
Reimplemented in SQP, LBFGS, DBFGS, BFGS, SR1, and conjugateGradient.
Definition at line 391 of file updateMethod.C.
References IOstreamOption::ASCII.
Referenced by conjugateGradient::write(), SR1::write(), BFGS::write(), DBFGS::write(), LBFGS::write(), and SQP::write().

|
protected |
Definition at line 56 of file updateMethod.H.
|
protected |
Definition at line 58 of file updateMethod.H.
|
protected |
Used to output values useful for continuation runs.
Definition at line 63 of file updateMethod.H.
|
protected |
Derivatives of the objective functions.
Definition at line 68 of file updateMethod.H.
Referenced by conjugateGradient::allocateFields(), SR1::allocateMatrices(), DBFGS::allocateMatrices(), LBFGS::allocateMatrices(), BFGS::allocateMatrices(), steepestDescent::computeCorrection(), and constraintProjection::computeCorrection().
|
protected |
Derivatives of the constraints.
Definition at line 73 of file updateMethod.H.
Referenced by constraintProjection::computeCorrection().
|
protected |
Objective value.
Definition at line 78 of file updateMethod.H.
|
protected |
Constraint values.
Definition at line 83 of file updateMethod.H.
Referenced by constraintProjection::computeCorrection().
|
protected |
Design variables correction.
Definition at line 88 of file updateMethod.H.
Referenced by steepestDescent::computeCorrection(), and constraintProjection::computeCorrection().
|
protected |
Cumulative design variables correction throughout the optimisation loop.
Definition at line 94 of file updateMethod.H.
|
protected |
Step multiplying the correction.
Definition at line 99 of file updateMethod.H.
Referenced by steepestDescent::computeCorrection(), and constraintProjection::computeCorrection().
|
protected |
Is initially set?
Definition at line 104 of file updateMethod.H.
|
protected |
Folder storing the corrections to file.
For some optimisation methods with a very high number of design variables (e.g. topology), it doesn't make much sense to write all updates in the updateMethodDict. Hence, a separate file is used to write the corrections, in case they are needed for post-processing
Definition at line 115 of file updateMethod.H.
|
protected |
Whether to use gSum or sum in the inner products.
Definition at line 120 of file updateMethod.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.