DBFGS Class Reference

The quasi-Newton BFGS formula with the dampening proposed by Powell. More...

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

Public Member Functions

 TypeName ("DBFGS")
 Runtime type information. More...
 
 DBFGS (const fvMesh &mesh, const dictionary &dict)
 Construct from components. More...
 
virtual ~DBFGS ()=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...
 
- 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...
 
scalarFieldreturnCorrection ()
 Return the correction of the design variables. More...
 
void writeCorrection ()
 
virtual scalar computeMeritFunction ()
 
virtual scalar meritFunctionDirectionalDerivative ()
 
boolinitialEtaSet ()
 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...
 
- 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...
 

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 initial unitary Hessian approximation. More...
 
scalar curvatureThreshold_
 Curvature threshold. More...
 
SquareMatrix< scalar > Hessian_
 The Hessian. Should have the size of the active design variables. More...
 
SquareMatrix< scalar > HessianOld_
 The previous Hessian. More...
 
scalarField derivativesOld_
 The previous derivatives. More...
 
scalarField correctionOld_
 The previous correction. More...
 
label counter_
 Optimisation cycle counter. More...
 
scalar gamma_
 Threshold for damping. More...
 
- Protected Attributes inherited from updateMethod
const fvMeshmesh_
 
const dictionary dict_
 
IOdictionary optMethodIODict_
 Used to output values useful for continuation runs. More...
 
scalarField objectiveDerivatives_
 Derivatives of the objective functions. More...
 
PtrList< scalarFieldconstraintDerivatives_
 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< updateMethodNew (const fvMesh &mesh, const dictionary &dict)
 Return a reference to the selected turbulence model. More...
 

Detailed Description

The quasi-Newton BFGS formula with the dampening proposed by Powell.

Source files

Definition at line 54 of file DBFGS.H.

Constructor & Destructor Documentation

◆ DBFGS()

DBFGS ( const fvMesh mesh,
const dictionary dict 
)

Construct from components.

Definition at line 173 of file DBFGS.C.

References Foam::endl(), and Foam::Info.

Here is the call graph for this function:

◆ ~DBFGS()

virtual ~DBFGS ( )
virtualdefault

Destructor.

Member Function Documentation

◆ allocateMatrices()

void allocateMatrices ( )
protected

Allocate matrices in the first optimisation cycle.

Definition at line 49 of file DBFGS.C.

References DBFGS::activeDesignVars_, DBFGS::Hessian_, DBFGS::HessianOld_, Foam::I, Foam::identity(), and updateMethod::objectiveDerivatives_.

Here is the call graph for this function:

◆ updateHessian()

void updateHessian ( )
protected

Update approximation of the inverse Hessian.

Definition at line 67 of file DBFGS.C.

References DebugInfo, Foam::endl(), forAll, Foam::Info, s, WarningInFunction, y, and Foam::Zero.

Here is the call graph for this function:

◆ update()

void update ( )
protected

Update design variables.

Definition at line 111 of file DBFGS.C.

References Foam::endl(), forAll, Foam::Info, Foam::inv(), Field< Type >::map(), and Foam::Zero.

Here is the call graph for this function:

◆ readFromDict()

void readFromDict ( )
protected

Read old info from dict.

Definition at line 148 of file DBFGS.C.

References Foam::identity(), n, and Foam::Zero.

Here is the call graph for this function:

◆ TypeName()

TypeName ( "DBFGS"  )

Runtime type information.

◆ computeCorrection()

void computeCorrection ( )
virtual

Compute design variables correction.

Implements updateMethod.

Definition at line 224 of file DBFGS.C.

References update().

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 240 of file DBFGS.C.

References updateMethod::updateOldCorrection().

Here is the call graph for this function:

◆ write()

void write ( )
virtual

Write old info to dict.

Reimplemented from updateMethod.

Definition at line 247 of file DBFGS.C.

References 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 DBFGS.H.

◆ nSteepestDescent_

label nSteepestDescent_
protected

Number of first steepest descent steps.

Definition at line 66 of file DBFGS.H.

◆ activeDesignVars_

labelList activeDesignVars_
protected

Map to active design variables.

Definition at line 69 of file DBFGS.H.

Referenced by DBFGS::allocateMatrices().

◆ scaleFirstHessian_

bool scaleFirstHessian_
protected

Scale the initial unitary Hessian approximation.

Definition at line 72 of file DBFGS.H.

◆ curvatureThreshold_

scalar curvatureThreshold_
protected

Curvature threshold.

Definition at line 75 of file DBFGS.H.

◆ Hessian_

SquareMatrix<scalar> Hessian_
protected

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

Definition at line 78 of file DBFGS.H.

Referenced by DBFGS::allocateMatrices().

◆ HessianOld_

SquareMatrix<scalar> HessianOld_
protected

The previous Hessian.

Definition at line 81 of file DBFGS.H.

Referenced by DBFGS::allocateMatrices().

◆ derivativesOld_

scalarField derivativesOld_
protected

The previous derivatives.

Definition at line 84 of file DBFGS.H.

◆ correctionOld_

scalarField correctionOld_
protected

The previous correction.

Definition at line 87 of file DBFGS.H.

◆ counter_

label counter_
protected

Optimisation cycle counter.

Definition at line 90 of file DBFGS.H.

◆ gamma_

scalar gamma_
protected

Threshold for damping.

Definition at line 93 of file DBFGS.H.


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