48 #ifndef designVariablesUpdate_H 49 #define designVariablesUpdate_H
PtrList< adjointSolverManager > & adjointSolvManagers_
OFstream CPUcostFile_
Output file.
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix by subtracting the matrix multiplied by the current fi...
A class encapsulating functionality neccessary to perform an optimisation loop, such as updating the ...
void writeCPUcostHeader()
Write CPU cost header.
label nPrimalSolutions_
Primal evaluations performed so far.
void postUpdate(const scalarField &oldCorrection)
Steps to be executed after the susccessfull update of the design varibles, i.e. the last step of line...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
label nAdjointSolvers() const
Get total number of adjoint solvers.
label nAdjointSolutions_
Adjoint evaluations performed so far.
Output to file stream, using an OSstream.
bool convergenceCriteriaDefined_
Is at least a single convergence criterion defined.
label nAdjointsPerCycle_
Adjoint solutions per optimisation cycle.
autoPtr< designVariables > & designVars_
label nConstraints(PtrList< adjointSolverManager > &adjointSolverManagers) const
Get the number of adjoint solvers that correspond to constraints.
autoPtr< lineSearch > & getLineSearch()
Get a reference to the line search object.
autoPtr< scalar > objectiveThreshold_
The relative update of the objective value w.r.t. to its last value should be smaller than this value...
tmp< scalarField > computeDirection()
Compute update direction.
scalar feasibilityThreshold_
In case of a constrained optimisation, the sum of positive constraints should be lower than this valu...
void write()
Write useful quantities to files.
scalar CPUcost_
CPU cost (in seconds)
scalar computeObjectiveValue()
Sum objective values from all adjointSolverManagers.
scalar meritFunctionDirectionalDerivative()
Derivative of the merit function.
scalar computeMeritFunction()
Compute the merit function of the optimisation problem.
void writeToCostFile(bool zeroAdjointSolns=false)
Write to cost file.
autoPtr< scalar > designVarsThreshold_
The maximum of the correction/designVariables values must be lower that this threshold to consider th...
TypeName("designVariablesUpdate")
Runtime type information.
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.
void updateOldCorrection(const scalarField &)
Update old correction. Needed for quasi-Newton Methods.
void update()
Update design variables.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
autoPtr< designVariables > & getDesignVariables()
Get access to design variables.
virtual ~designVariablesUpdate()=default
Destructor.
autoPtr< updateMethod > updateMethod_
Method to update the design variables based on the provided sensitivity derivatives.
A class for managing temporary objects.
void updateGradientsAndValues()
Compute cumulative objective and constraint gradients.
PtrList< adjointSolverManager > & adjointSolverManagers
void setOldObjectiveValue()
Set the old objective value known by the updateMethod.
autoPtr< lineSearch > lineSearch_
Line search mechanism to approximate the update step length.
label nPrimalsPerCycle_
Primal solutions per optimisation cycle.
void checkConvergence(const scalarField &oldCorrection)
Check if the optimisation loop has converged based on the provided criteria.