Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
updateMethod Class Referenceabstract

Abstract base class for optimisation methods. More...

Inheritance diagram for updateMethod:
Inheritance graph
[legend]
Collaboration diagram for updateMethod:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("updateMethod")
 
 declareRunTimeSelectionTable (autoPtr, updateMethod, dictionary,(const fvMesh &mesh, const dictionary &dict),(mesh, dict))
 
 updateMethod (const fvMesh &mesh, const dictionary &dict)
 
virtual ~updateMethod ()=default
 
void setObjectiveDeriv (const scalarField &derivs)
 
void setConstraintDeriv (const PtrList< scalarField > &derivs)
 
void setObjectiveValue (const scalar value)
 
void setConstraintValues (const scalarField &values)
 
void setStep (const scalar eta)
 
void setGlobalSum (const bool useGlobalSum)
 
virtual void computeCorrection ()=0
 
scalarFieldreturnCorrection ()
 
void writeCorrection ()
 
virtual scalar computeMeritFunction ()
 
virtual scalar meritFunctionDirectionalDerivative ()
 
boolinitialEtaSet ()
 
virtual void updateOldCorrection (const scalarField &oldCorrection)
 
virtual void write ()
 

Static Public Member Functions

static autoPtr< updateMethodNew (const fvMesh &mesh, const dictionary &dict)
 

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)
 
scalar globalSum (tmp< scalarField > &tfield)
 
dictionary coeffsDict ()
 

Protected Attributes

const fvMeshmesh_
 
const dictionary dict_
 
IOdictionary optMethodIODict_
 
scalarField objectiveDerivatives_
 
PtrList< scalarFieldconstraintDerivatives_
 
scalar objectiveValue_
 
scalarField cValues_
 
scalarField correction_
 
scalarField cumulativeCorrection_
 
scalar eta_
 
bool initialEtaSet_
 
word correctionFolder_
 
bool globalSum_
 

Detailed Description

Abstract base class for optimisation methods.

Source files

Definition at line 50 of file updateMethod.H.

Constructor & Destructor Documentation

◆ updateMethod()

updateMethod ( const fvMesh mesh,
const dictionary dict 
)

Definition at line 194 of file updateMethod.C.

References dict, UPstream::master(), Foam::mkDir(), and dictionary::readIfPresent().

Here is the call graph for this function:

◆ ~updateMethod()

virtual ~updateMethod ( )
virtualdefault

Member Function Documentation

◆ leftMult()

const Foam::scalarField leftMult ( const scalarField s,
const SquareMatrix< scalar > &  m 
)
protected

Definition at line 38 of file updateMethod.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, Matrix::n(), s, and Foam::Zero.

Here is the call graph for this function:

◆ rightMult()

const Foam::scalarField rightMult ( const SquareMatrix< scalar > &  m,
const scalarField s 
)
protected

Definition at line 65 of file updateMethod.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, Matrix::n(), s, and Foam::Zero.

Here is the call graph for this function:

◆ outerProd()

Foam::SquareMatrix< Foam::scalar > outerProd ( const scalarField a,
const scalarField b 
)
protected

Definition at line 92 of file updateMethod.C.

References Foam::abort(), Foam::constant::physicoChemical::b, Foam::FatalError, FatalErrorInFunction, forAll, and Foam::Zero.

Here is the call graph for this function:

◆ inv()

Foam::SquareMatrix< Foam::scalar > inv ( SquareMatrix< scalar >  A)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ globalSum() [1/2]

Foam::scalar globalSum ( const scalarField field)
protected

Definition at line 168 of file updateMethod.C.

References field(), Foam::gSum(), and Foam::sum().

Referenced by constraintProjection::computeCorrection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ globalSum() [2/2]

Foam::scalar globalSum ( tmp< scalarField > &  tfield)
protected

Definition at line 183 of file updateMethod.C.

References tmp::clear().

Here is the call graph for this function:

◆ coeffsDict()

Foam::dictionary coeffsDict ( )
protected

Definition at line 247 of file updateMethod.C.

References dictionary::subOrEmptyDict(), and Foam::type().

Referenced by SQP::SQP(), and SR1::SR1().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TypeName()

TypeName ( "updateMethod"  )

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
updateMethod  ,
dictionary  ,
(const fvMesh &mesh, const dictionary &dict ,
(mesh, dict  
)

◆ New()

Foam::autoPtr< Foam::updateMethod > New ( const fvMesh mesh,
const dictionary dict 
)
static

Definition at line 256 of file updateMethod.C.

References dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, dictionary::get(), Foam::Info, and mesh.

Here is the call graph for this function:

◆ setObjectiveDeriv()

void setObjectiveDeriv ( const scalarField derivs)

Definition at line 284 of file updateMethod.C.

◆ setConstraintDeriv()

void setConstraintDeriv ( const PtrList< scalarField > &  derivs)

Definition at line 291 of file updateMethod.C.

◆ setObjectiveValue()

void setObjectiveValue ( const scalar  value)

Definition at line 299 of file updateMethod.C.

◆ setConstraintValues()

void setConstraintValues ( const scalarField values)

Definition at line 305 of file updateMethod.C.

References Foam::HashTableOps::values().

Here is the call graph for this function:

◆ setStep()

void setStep ( const scalar  eta)

Definition at line 311 of file updateMethod.C.

◆ setGlobalSum()

void setGlobalSum ( const bool  useGlobalSum)

Definition at line 317 of file updateMethod.C.

◆ computeCorrection()

virtual void computeCorrection ( )
pure virtual

◆ returnCorrection()

Foam::scalarField & returnCorrection ( )

Definition at line 323 of file updateMethod.C.

◆ writeCorrection()

void writeCorrection ( )

Definition at line 330 of file updateMethod.C.

References Foam::endl(), forAll, UPstream::master(), and Foam::Zero.

Here is the call graph for this function:

◆ computeMeritFunction()

Foam::scalar computeMeritFunction ( )
virtual

Reimplemented in SQP.

Definition at line 364 of file updateMethod.C.

◆ meritFunctionDirectionalDerivative()

Foam::scalar meritFunctionDirectionalDerivative ( )
virtual

Reimplemented in SQP.

Definition at line 370 of file updateMethod.C.

◆ initialEtaSet()

bool & initialEtaSet ( )

Definition at line 376 of file updateMethod.C.

◆ updateOldCorrection()

void updateOldCorrection ( const scalarField oldCorrection)
virtual

Reimplemented in SQP, LBFGS, DBFGS, BFGS, SR1, and conjugateGradient.

Definition at line 383 of file updateMethod.C.

Referenced by BFGS::updateOldCorrection(), SR1::updateOldCorrection(), DBFGS::updateOldCorrection(), LBFGS::updateOldCorrection(), and SQP::updateOldCorrection().

Here is the caller graph for this function:

◆ write()

void write ( )
virtual

Reimplemented in SQP, LBFGS, DBFGS, BFGS, SR1, and conjugateGradient.

Definition at line 391 of file updateMethod.C.

References IOstreamOption::ASCII.

Referenced by conjugateGradient::write(), BFGS::write(), SR1::write(), DBFGS::write(), LBFGS::write(), and SQP::write().

Here is the caller graph for this function:

Member Data Documentation

◆ mesh_

const fvMesh& mesh_
protected

Definition at line 56 of file updateMethod.H.

◆ dict_

const dictionary dict_
protected

Definition at line 58 of file updateMethod.H.

◆ optMethodIODict_

IOdictionary optMethodIODict_
protected

Definition at line 61 of file updateMethod.H.

◆ objectiveDerivatives_

scalarField objectiveDerivatives_
protected

◆ constraintDerivatives_

PtrList<scalarField> constraintDerivatives_
protected

Definition at line 67 of file updateMethod.H.

Referenced by constraintProjection::computeCorrection().

◆ objectiveValue_

scalar objectiveValue_
protected

Definition at line 70 of file updateMethod.H.

◆ cValues_

scalarField cValues_
protected

Definition at line 73 of file updateMethod.H.

Referenced by constraintProjection::computeCorrection().

◆ correction_

scalarField correction_
protected

◆ cumulativeCorrection_

scalarField cumulativeCorrection_
protected

Definition at line 80 of file updateMethod.H.

◆ eta_

scalar eta_
protected

◆ initialEtaSet_

bool initialEtaSet_
protected

Definition at line 86 of file updateMethod.H.

◆ correctionFolder_

word correctionFolder_
protected

Definition at line 94 of file updateMethod.H.

◆ globalSum_

bool globalSum_
protected

Definition at line 97 of file updateMethod.H.


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