SQP Class Reference

The quasi-Newton SQP formula for constrained optimisation. More...

Inheritance diagram for SQP:
[legend]
Collaboration diagram for SQP:
[legend]

Public Member Functions

 TypeName ("SQP")
 Runtime type information. More...
 
 SQP (const fvMesh &mesh, const dictionary &dict)
 Construct from components. More...
 
virtual ~SQP ()=default
 Destructor. More...
 
void computeCorrection ()
 Compute design variables correction. More...
 
virtual scalar computeMeritFunction ()
 
virtual scalar meritFunctionDirectionalDerivative ()
 
virtual void updateOldCorrection (const scalarField &oldCorrection)
 
virtual void write ()
 Write useful quantities to files. More...
 
- Public Member Functions inherited from constrainedOptimisationMethod
 TypeName ("constrainedOptimisationMethod")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, constrainedOptimisationMethod, dictionary,(const fvMesh &mesh, const dictionary &dict),(mesh, dict))
 
 constrainedOptimisationMethod (const fvMesh &mesh, const dictionary &dict)
 Construct from components. More...
 
virtual ~constrainedOptimisationMethod ()=default
 Destructor. More...
 
- Public Member Functions inherited from updateMethod
 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 ()
 
bool & initialEtaSet ()
 Return whether initial eta was set. More...
 

Protected Attributes

scalar etaHessian_
 Step for the Newton method. More...
 
labelList activeDesignVars_
 Map to active design variables. More...
 
bool scaleFirstHessian_
 Scale the initial unitary Hessian approximation. More...
 
scalar dumpingThreshold_
 Curvature threshold. More...
 
scalarField LagrangianDerivatives_
 Derivatives of the Lagrangian function. More...
 
SquareMatrix< scalar > Hessian_
 
SquareMatrix< scalar > HessianOld_
 The previous Hessian inverse. More...
 
scalarField objectiveDerivativesOld_
 The previous objective derivatives. More...
 
List< scalarField > constraintDerivativesOld_
 The previous constraint derivatives. More...
 
scalarField correctionOld_
 The previous correction. More...
 
scalarField lamdas_
 Lagrange multipliers. More...
 
label counter_
 Optimisation cycle count. More...
 
fileName objFunctionFolder_
 Name of the objective folder. More...
 
autoPtr< OFstream > meritFunctionFile_
 File including the l1 merit function. More...
 
scalar mu_
 Penalty value for the merit function. More...
 
scalar delta_
 Safety factor. More...
 
- Protected Attributes inherited from updateMethod
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 Public Member Functions inherited from updateMethod
static autoPtr< updateMethod > New (const fvMesh &mesh, const dictionary &dict)
 Return a reference to the selected turbulence model. More...
 
- Protected Member Functions inherited from updateMethod
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...
 

Detailed Description

The quasi-Newton SQP formula for constrained optimisation.

Source files

Definition at line 54 of file SQP.H.

Constructor & Destructor Documentation

◆ SQP()

SQP ( const fvMesh &  mesh,
const dictionary &  dict 
)

Construct from components.

Definition at line 279 of file SQP.C.

References SQP::activeDesignVars_, updateMethod::coeffsDict(), Foam::endl(), Foam::Info, UPstream::master(), Foam::mkDir(), and SQP::objFunctionFolder_.

Here is the call graph for this function:

◆ ~SQP()

virtual ~SQP ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "SQP"  )

Runtime type information.

◆ computeCorrection()

void computeCorrection ( )
virtual

Compute design variables correction.

Implements constrainedOptimisationMethod.

Definition at line 340 of file SQP.C.

◆ computeMeritFunction()

Foam::scalar computeMeritFunction ( )
virtual

Compute merit function. Could be different than the objective in the presence of constraints

Reimplemented from updateMethod.

Definition at line 365 of file SQP.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), Foam::Info, L(), Foam::mag(), Foam::max(), and Foam::sum().

Here is the call graph for this function:

◆ meritFunctionDirectionalDerivative()

Foam::scalar meritFunctionDirectionalDerivative ( )
virtual

Derivative of the merit function. Could be different than the objective derivative in the presence of constraints

Reimplemented from updateMethod.

Definition at line 382 of file SQP.C.

References Foam::mag(), and Foam::sum().

Here is the call graph for this function:

◆ updateOldCorrection()

void updateOldCorrection ( const scalarField &  oldCorrection)
virtual

Update old correction. Useful for quasi-Newton methods coupled with line search

Reimplemented from updateMethod.

Definition at line 392 of file SQP.C.

References updateMethod::updateOldCorrection().

Here is the call graph for this function:

◆ write()

void write ( )
virtual

Write useful quantities to files.

Reimplemented from updateMethod.

Definition at line 399 of file SQP.C.

References IOstream::defaultPrecision(), Foam::endl(), forAll, Foam::mag(), UPstream::master(), Foam::setw(), Foam::sum(), and updateMethod::write().

Here is the call graph for this function:

Member Data Documentation

◆ etaHessian_

scalar etaHessian_
protected

Step for the Newton method.

Definition at line 63 of file SQP.H.

◆ activeDesignVars_

labelList activeDesignVars_
protected

Map to active design variables.

Definition at line 66 of file SQP.H.

Referenced by SQP::SQP().

◆ scaleFirstHessian_

bool scaleFirstHessian_
protected

Scale the initial unitary Hessian approximation.

Definition at line 69 of file SQP.H.

◆ dumpingThreshold_

scalar dumpingThreshold_
protected

Curvature threshold.

Definition at line 72 of file SQP.H.

◆ LagrangianDerivatives_

scalarField LagrangianDerivatives_
protected

Derivatives of the Lagrangian function.

Definition at line 75 of file SQP.H.

◆ Hessian_

SquareMatrix<scalar> Hessian_
protected

The Hessian inverse. Should have the size of the active design variables

Definition at line 79 of file SQP.H.

◆ HessianOld_

SquareMatrix<scalar> HessianOld_
protected

The previous Hessian inverse.

Definition at line 82 of file SQP.H.

◆ objectiveDerivativesOld_

scalarField objectiveDerivativesOld_
protected

The previous objective derivatives.

Definition at line 85 of file SQP.H.

◆ constraintDerivativesOld_

List<scalarField> constraintDerivativesOld_
protected

The previous constraint derivatives.

Definition at line 88 of file SQP.H.

◆ correctionOld_

scalarField correctionOld_
protected

The previous correction.

Definition at line 91 of file SQP.H.

◆ lamdas_

scalarField lamdas_
protected

Lagrange multipliers.

Definition at line 94 of file SQP.H.

◆ counter_

label counter_
protected

Optimisation cycle count.

Definition at line 97 of file SQP.H.

◆ objFunctionFolder_

fileName objFunctionFolder_
protected

Name of the objective folder.

Definition at line 100 of file SQP.H.

Referenced by SQP::SQP().

◆ meritFunctionFile_

autoPtr<OFstream> meritFunctionFile_
protected

File including the l1 merit function.

Definition at line 103 of file SQP.H.

◆ mu_

scalar mu_
protected

Penalty value for the merit function.

Definition at line 106 of file SQP.H.

◆ delta_

scalar delta_
protected

Safety factor.

Definition at line 109 of file SQP.H.


The documentation for this class was generated from the following files: