39 #ifndef updateMethod_H 40 #define updateMethod_H 206 void setStep(
const scalar eta);
240 virtual void write();
void setConstraintDeriv(const PtrList< scalarField > &derivs)
Set constraints derivative.
virtual scalar computeMeritFunction()
Compute merit function. Could be different than the objective in the presence of constraints.
virtual scalar meritFunctionDirectionalDerivative()
Directional derivative of the merit function, in the direction of the correction. Could be different ...
scalarField cValues_
Constraint values.
TypeName("updateMethod")
Runtime type information.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
declareRunTimeSelectionTable(autoPtr, updateMethod, dictionary,(const fvMesh &mesh, const dictionary &dict),(mesh, dict))
Abstract base class for optimisation methods.
const scalarField rightMult(const SquareMatrix< scalar > &, const scalarField &)
bool & initialEtaSet()
Return whether initial eta was set.
const scalarField leftMult(const scalarField &, const SquareMatrix< scalar > &)
void setConstraintValues(const scalarField &values)
Set constraints derivative.
virtual void computeCorrection()=0
Return the correction of the design variables.
PtrList< scalarField > constraintDerivatives_
Derivatives of the constraints.
scalar eta_
Step multiplying the correction.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
static autoPtr< updateMethod > New(const fvMesh &mesh, const dictionary &dict)
Return a reference to the selected turbulence model.
scalar objectiveValue_
Objective value.
virtual void updateOldCorrection(const scalarField &oldCorrection)
Update old correction. useful for quasi-newton methods coupled with line search.
void setStep(const scalar eta)
Set step for optimisation methods.
A class for handling words, derived from Foam::string.
SquareMatrix< scalar > inv(SquareMatrix< scalar > A)
void setObjectiveValue(const scalar value)
Set constraints derivative.
void setObjectiveDeriv(const scalarField &derivs)
Set objective derivative.
scalar globalSum(const scalarField &field)
Compute either global or local sum, based on globalSum flag.
void setGlobalSum(const bool useGlobalSum)
Set globalSum variable.
bool initialEtaSet_
Is initially set?
bool globalSum_
Whether to use gSum or sum in the inner products.
scalarField objectiveDerivatives_
Derivatives of the objective functions.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Mesh data needed to do the Finite Volume discretisation.
SquareMatrix< scalar > outerProd(const scalarField &, const scalarField &)
scalarField correction_
Design variables correction.
virtual void write()
Write useful quantities to files.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
scalarField cumulativeCorrection_
Cumulative design variables correction throughout the optimisation loop.
Macros to ease declaration of run-time selection tables.
A class for managing temporary objects.
word correctionFolder_
Folder storing the corrections to file.
IOdictionary optMethodIODict_
Used to output values useful for continuation runs.
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
scalarField & returnCorrection()
Return the correction of the design variables.
virtual ~updateMethod()=default
Destructor.
dictionary coeffsDict()
Return optional dictionary with parameters specific to each method.