334 ISQP(
const ISQP&) =
delete;
337 void operator=(
const ISQP&) =
delete;
360 virtual ~ISQP() =
default;
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
bool doAllocateLagrangeMultipliers_
Should Lagrange multipliers be allocated.
scalar lineSearch()
Perform line search and return max residual corresponding to the updated solution.
tmp< scalarField > matrixVectorProduct(const scalarField &vector)
Procudt of the LHS of the deltaP eqn with a vector.
void updateSolution(const scalar step)
Update the current solution using the known direction and the given step length.
scalar cRed_
Percentage reduction for the constraints.
tmp< scalarField > resFls()
Residual of the lower bounds slackness.
void CGforDeltaP(const scalarField &FDx)
CG algorithm for the solution of the deltaP eqn.
void solveSubproblem()
Solve subproblem using a Newton optimiser.
void computeCorrection()
Compute design variables correction.
virtual scalar meritFunctionDirectionalDerivative()
Derivative of the merit function. Could be different than the objective derivative in the presence of...
bool includeExtraVars_
Are additional design variables included?
tmp< scalarField > resFL()
Residual of the gradient of the Lagrangian.
void initialize()
Allocate fields related to constraints.
virtual bool writeAuxiliaryData()
Write merit function information.
autoPtr< Function1< scalar > > c_
Multiplier of the additional variables y in the Lagrangian, to make them 'expensive'.
tmp< scalarField > invHFL()
Product of the inverse Hessian with the residual of the gradient of the Lagrangian.
tmp< scalarField > resFz()
Residual of the complementarity slackness for the extra variables.
void adjustStep(scalar &step, const scalar value, const scalar update)
Adjust step to satisfy cireteria.
autoPtr< scalarField > z_
Lagrange multipliers for positive extra variables.
virtual bool writeData(Ostream &os) const
Write useful quantities to files.
tmp< scalarField > resFExtraVars()
Residual of the Lagrangian derivative wrt the extra variables.
virtual scalar meritFunctionConstraintPart() const
Get the part the merit function that depends on the constraints.
tmp< scalarField > preconVectorProduct(const scalarField &vector, autoPtr< scalarField > &precon)
Preconditioner-vector product for CG.
static const Enum< preconditioners > preconditionerNames
Names of preconditioners for the subproblem.
scalarField p_
The set of design variables being updated during the subproblem.
void computeNewtonDirection()
Compute direction for the Newton problem.
autoPtr< scalarField > us_
Slack variables the upper bound constraints.
scalar epsMin_
Final eps quantity to be reached during the solution of the subproblem.
autoPtr< scalarField > deltaUs_
tmp< scalarField > resFuTilda()
Residual of the complementarity slackness for the upper bound constraints.
autoPtr< scalarField > deltaUTilda_
autoPtr< OFstream > meritFunctionFile_
File including the l1 merit function.
autoPtr< scalarField > deltaLs_
void zeroUpdates()
Zero the updates computed in the previous optimisation cycle.
virtual scalar computeMeritFunction()
Compute merit function. Could be different than the objective in the presence of constraints.
tmp< scalarField > ShermanMorrisonRank1Update(const PtrList< scalarField > &r1Updates, const scalarField &p, const refPtr< scalarField > &diag, const scalarField &mult, label n)
Recursive (naive) implementation of the rank-1 update.
tmp< scalarField > resFGs()
Residual of the inequality constraint slackness.
scalar eps_
Infinitesimal quantity.
preconditioners
Enumeration of preconditioners for the subproblem.
autoPtr< scalarField > deltaExtraVars_
label maxDxIters_
Maxmimum number of iterations for the deltaX equation.
void allocateBoundMultipliers()
Allocate multipliers for the bound constraints.
tmp< scalarField > resFus()
Residual of the upper bounds slackness.
label maxLineSearchIters_
Maxmimum number of line search iterations for each iteration of the subproblem.
autoPtr< scalarField > deltaZ_
scalar relTol_
Relative tolerance of the CG solver, solving for deltaP_.
autoPtr< scalarField > extraVars_
Extra variables for finding solutions even in infeasible problems.
autoPtr< scalarField > ls_
Slack variables the lower bound constraints.
tmp< scalarField > diagPreconditioner()
Diagonal preconditioner of the deltaP eqn.
tmp< scalarField > resFlamda()
Residual of the complementarity slackness for the inequality constraints.
bool includeBoundConstraints_
Are bound constraints included?
bool disableDamping_
Disable damping.
autoPtr< scalarField > lTilda_
Lagrange multipliers for the lower bound constraints.
virtual void updateOldCorrection(const scalarField &oldCorrection)
Update old correction. Useful for quasi-Newton methods coupled with line search.
void updateYS()
Update the vectors accosiated with the Hessian matrix.
virtual ~ISQP()=default
Destructor.
tmp< scalarField > resFlTilda()
Residual of the complementarity slackness for the lower bound constraints.
autoPtr< scalarField > uTilda_
Lagrange multipliers for the upper bound constraints.
TypeName("ISQP")
Runtime type information.
void storeOldFields()
Store old fields needed for the next iter.
tmp< scalarField > computeResiduals()
Compute and return residuals based on the current solution.
void updateSizes()
Update sizes of fields related to the active design variables.
void solveDeltaPEqn()
Solve the equation for deltaX, which is the expensive part of the Newtopn step.
autoPtr< scalarField > deltaLTilda_
scalarField gs_
Slack variables for the inequality constraints.
label maxNewtonIters_
Maxmimum number of Newton iterations for the subproblem.
label preconType_
Which preconditioner to use for the solution of the subproblem.
tmp< scalarField > ShermanMorrisonPrecon(const scalarField &vector)
Use the Sherman-Morrison formula to compute the matrix-free product of the approximate inverse of the...
void allocateLagrangeMultipliers()
Allocate Lagrange multipliers for the inequality constraints.
tmp< scalarField > computeRHSForDeltaX(const scalarField &FDx)
Compute the RHS for the deltaX equation.
virtual void update()
Update design variables.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
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.
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 references or pointers (no reference counting).
A class for managing temporary objects.
label nConstraints() const
Get the number of constraints.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.