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