47 constrainedOptimisationMethod,
58 { preconditioners::invHessian,
"invHessian" },
59 { preconditioners::ShermanMorrison,
"ShermanMorrison" }
100 if (includeBoundConstraints_)
103 const label
n(activeDesignVars_.size());
127 const label m(nConstraints_);
129 if (includeExtraVars_)
132 const scalar t = mesh_.time().timeOutputValue();
139 doAllocateLagrangeMultipliers_ =
false;
146 scalarField LagrangianDerivativesOld(derivativesOld_);
147 forAll(constraintDerivatives_, cI)
149 LagrangianDerivatives_ += lamdas_[cI]*constraintDerivatives_[cI];
150 LagrangianDerivativesOld += lamdas_[cI]*constraintDerivativesOld_[cI];
153 if (includeBoundConstraints_)
155 forAll(activeDesignVars_, aI)
157 const label varI(activeDesignVars_[aI]);
158 const scalar contr(uTilda_()[aI] - lTilda_()[aI]);
159 LagrangianDerivatives_[varI] += contr;
160 LagrangianDerivativesOld[varI] += contr;
165 updateVectors(LagrangianDerivatives_, LagrangianDerivativesOld);
171 const scalarField x(designVars_().getVars(), activeDesignVars_);
175 if (includeBoundConstraints_)
177 lTilda_() = scalar(1);
178 uTilda_() = scalar(1);
187 if (includeExtraVars_)
189 extraVars_() = scalar(1);
190 const scalar
c = c_->
value(mesh_.time().timeOutputValue());
191 z_() =
max(1, 0.5*
c);
192 Info<<
"Penalty multiplier (c):: " <<
c <<
endl;
206 if (includeBoundConstraints_)
208 deltaLTilda_() =
Zero;
210 deltaUTilda_() =
Zero;
214 if (includeExtraVars_)
216 deltaExtraVars_() =
Zero;
227 if (includeBoundConstraints_)
230 (uTilda_()*resFus() + resFuTilda())/us_()
231 - (lTilda_()*resFls() + resFlTilda())/ls_();
235 if (includeExtraVars_)
237 mult += extraVars_()/z_();
238 AMult -= (extraVars_()*resFExtraVars() + resFz())/z_();
243 const label varI(activeDesignVars_[aI]);
244 forAll(constraintDerivatives_, cI)
246 FDx[aI] += constraintDerivatives_[cI][varI]*AMult[cI];
263 forAll(constraintDerivatives_, cI)
265 const scalarField& cDerivsI = constraintDerivatives_[cI];
267 globalSum(
scalarField(cDerivsI, activeDesignVars_)*deltaP_);
269 GsLADp *= lamdas_/gs_;
274 const label varI(activeDesignVars_[aI]);
275 forAll(constraintDerivatives_, cI)
277 rhs[aI] += constraintDerivatives_[cI][varI]*GsLADp[cI];
282 if (includeBoundConstraints_)
284 rhs += (lTilda_()/ls_() + uTilda_()/us_())*deltaP_;
287 rhs = -invHessianVectorProduct(rhs);
289 rhs = 0.95*deltaP_ + 0.05*rhs;
301 scalar res(
sqrt(globalSum(r*r)));
303 scalar rz(globalSum(r*z));
309 scalar a = rz/globalSum(
p*Ap);
312 res =
sqrt(globalSum(r*r));
313 z = preconVectorProduct(r, precon);
315 scalar
beta = rz/rzOld;
318 }
while (iter++ < maxDxIters_ && res > relTol_*resInit);
320 <<
"CG, Solving for deltaP, Initial Residual " << resInit
321 <<
", Final Residual " << res
322 <<
", No Iterations " << iter <<
endl;
335 forAll(constraintDerivatives_, cI)
337 const scalarField& cDerivsI = constraintDerivatives_[cI];
342 if (includeExtraVars_)
344 mult += extraVars_()/z_();
351 const label varI(activeDesignVars_[aI]);
352 forAll(constraintDerivatives_, cI)
354 Ap[aI] += constraintDerivatives_[cI][varI]*GsLAv[cI];
359 if (includeBoundConstraints_)
361 Ap += (lTilda_()/ls_() + uTilda_()/us_())*
vector;
380 precon.
reset(diagPreconditioner().ptr());
384 else if (preconType_ == preconditioners::invHessian)
386 return invHessianVectorProduct(
vector);
388 else if (preconType_ == preconditioners::ShermanMorrison)
390 return ShermanMorrisonPrecon(
vector);
399 tmp<scalarField> tpreconditioner(HessianDiag());
400 scalarField& preconditioner = tpreconditioner.ref();
403 forAll(constraintDerivatives_, cI)
405 scalarField cDerivs(constraintDerivatives_[cI], activeDesignVars_);
406 scalar mult(gs_[cI]/lamdas_[cI]);
407 if (includeExtraVars_)
409 mult += extraVars_()[cI]/z_()[cI];
411 preconditioner +=
sqr(cDerivs)/mult;
414 if (includeBoundConstraints_)
416 preconditioner += lTilda_()/ls_() + uTilda_()/us_();
419 preconditioner = 1./preconditioner;
421 return tpreconditioner;
439 if (includeBoundConstraints_)
441 tdiag.
reset((lTilda_()/ls_() + uTilda_()/us_()).ptr());
446 PtrList<scalarField> r1Updates(cValues_.size());
448 forAll(constraintDerivatives_, cI)
450 const scalarField& cDerivsI = constraintDerivatives_[cI];
455 if (includeExtraVars_)
457 mult += extraVars_()/z_();
461 ShermanMorrisonRank1Update(r1Updates,
vector, tdiag, mult, mult.
size());
479 Ap = invHessianVectorProduct(
p, counter_,
diag.shallowClone());
486 Ap = ShermanMorrisonRank1Update(r1Updates,
p,
diag, mult,
n);
487 tmp<scalarField> tAv =
488 ShermanMorrisonRank1Update(r1Updates, r1Updates[
n],
diag, mult,
n);
490 scalar yHs = globalSum(r1Updates[
n]*Av)/mult[
n];
491 Ap -= Av*globalSum(r1Updates[
n]*Ap)/(1 + yHs)/mult[
n];
508 forAll(constraintDerivatives_, cI)
510 const scalarField& cDerivsI = constraintDerivatives_[cI];
512 globalSum(
scalarField(cDerivsI, activeDesignVars_)*deltaP_);
515 if (includeExtraVars_)
517 mult += extraVars_()/z_();
518 deltaLamda_ += (resFz() + extraVars_()*resFExtraVars())/z_();
520 deltaLamda_ += resFGs() - resFlamda()/lamdas_;
524 deltaGs_ = -(gs_*deltaLamda_ + resFlamda())/lamdas_;
526 if (includeBoundConstraints_)
529 deltaLs_() = deltaP_ + resFls();
532 deltaUs_() = -deltaP_ + resFus();
535 deltaLTilda_() = -(lTilda_()*deltaLs_() + resFlTilda())/ls_();
538 deltaUTilda_() = -(uTilda_()*deltaUs_() + resFuTilda())/us_();
541 if (includeExtraVars_)
543 deltaZ_() = -deltaLamda_ + resFExtraVars();
544 deltaExtraVars_() = - (extraVars_()*deltaZ_() + resFz())/z_();
551 const label
n(p_.size());
552 const label m(cValues_.size());
555 if (includeBoundConstraints_)
557 for (label i = 0; i <
n; ++i)
559 adjustStep(step, ls_()[i], deltaLs_()[i]);
560 adjustStep(step, us_()[i], deltaUs_()[i]);
561 adjustStep(step, lTilda_()[i], deltaLTilda_()[i]);
562 adjustStep(step, uTilda_()[i], deltaUTilda_()[i]);
567 for (label i = 0; i < m; ++i)
569 adjustStep(step, lamdas_[i], deltaLamda_[i]);
570 adjustStep(step, gs_[i], deltaGs_[i]);
571 if (includeExtraVars_)
573 adjustStep(step, extraVars_()[i], deltaExtraVars_()[i]);
574 adjustStep(step, z_()[i], deltaZ_()[i]);
582 reduce(step, minOp<scalar>());
589 Info<<
"Step before line search is " << step <<
endl;
593 scalar normResOld =
sqrt(globalSum(
magSqr(computeResiduals())));
594 scalar maxRes(GREAT);
596 for (label i = 0; i < maxLineSearchIters_ ; ++i)
599 updateSolution(step);
603 scalar normResNew =
sqrt(globalSum(
magSqr(resNew)));
606 if (normResNew < normResOld)
609 <<
"Initial residual = " << normResOld <<
", " 610 <<
"Final residual = " << normResNew <<
", " 611 <<
"No of LineSearch Iterations = " << i + 1
618 if (i != maxLineSearchIters_ - 1)
620 updateSolution(-step);
625 Info<<
tab <<
"Line search did not converge. " 626 <<
"Procceding with the last compute step" <<
endl;
633 Info<<
"Step after line search is " << step <<
nl <<
endl;
647 if (0.99*value + step*
update < scalar(0))
649 step = -0.99*value/
update;
657 lamdas_ += step*deltaLamda_;
658 gs_ += step*deltaGs_;
659 if (includeBoundConstraints_)
661 lTilda_() += step*deltaLTilda_();
662 ls_() += step*deltaLs_();
663 uTilda_() += step*deltaUTilda_();
664 us_() += step*deltaUs_();
666 if (includeExtraVars_)
668 extraVars_() += step*deltaExtraVars_();
669 z_() += step*deltaZ_();
676 const label
n(activeDesignVars_.size());
677 const label m(cValues_.size());
678 label size(includeBoundConstraints_ ? 5*
n + 2*m :
n + 2*m);
679 if (includeExtraVars_)
693 res.rmap(resFGs()(),
identity(m, iRes));
697 res.rmap(resFlamda()(),
identity(m, iRes));
700 if (includeBoundConstraints_)
711 res.rmap(resFlTilda()(),
identity(
n, iRes));
715 res.rmap(resFuTilda()(),
identity(
n, iRes));
719 if (includeExtraVars_)
722 res.rmap(resFExtraVars()(),
identity(m, iRes));
726 res.rmap(resFz(),
identity(m, iRes));
736 tmp<scalarField> tgradL
750 forAll(constraintDerivatives_, cI)
754 *
scalarField(constraintDerivatives_[cI], activeDesignVars_);
757 if (includeBoundConstraints_)
759 gradL += uTilda_() - lTilda_();
768 tmp<scalarField> tinvHFL
772 forAll(constraintDerivatives_, cI)
776 *
scalarField(constraintDerivatives_[cI], activeDesignVars_);
779 if (includeBoundConstraints_)
781 invHFL += uTilda_() - lTilda_();
784 invHFL = invHessianVectorProduct(invHFL);
799 forAll(constraintDerivatives_, cI)
804 scalarField(constraintDerivatives_[cI], activeDesignVars_)*p_
808 if (includeExtraVars_)
819 return (lamdas_*gs_ - eps_);
825 if (includeBoundConstraints_)
827 const scalarField x(designVars_().getVars(), activeDesignVars_);
829 (designVars_().lowerBounds()(), activeDesignVars_);
831 return (
x + p_ -
xMin - ls_());
839 if (includeBoundConstraints_)
841 const scalarField x(designVars_().getVars(), activeDesignVars_);
843 (designVars_().upperBounds()(), activeDesignVars_);
845 return (
xMax -
x - p_ - us_());
853 if (includeBoundConstraints_)
855 return (lTilda_()*ls_() - eps_);
863 if (includeBoundConstraints_)
865 return (uTilda_()*us_() - eps_);
873 if (includeExtraVars_)
875 return (c_->value(mesh_.time().timeOutputValue()) - lamdas_ - z_());
883 if (includeExtraVars_)
885 return (z_()*extraVars_() - eps_);
895 if (includeBoundConstraints_ || !cValues_.empty())
897 scalar resMax(
gMax(
mag(computeResiduals())));
902 <<
"Newton iter " << iter <<
nl <<
endl;
905 if (resMax < 0.9*eps_)
911 computeNewtonDirection();
916 resMax = lineSearch();
918 <<
"max residual = " << resMax <<
", " 919 <<
"eps = " << eps_ <<
nl <<
endl;
922 iter++ < maxNewtonIters_ && (eps_ > epsMin_ || resMax > 0.9*eps_)
924 Info<<
"Finished solving the QP subproblem" <<
nl <<
endl;
925 if (iter == maxNewtonIters_)
928 <<
"Iterative solution of the QP problem did not converge" 933 scalarField vars(designVars_().getVars(), activeDesignVars_);
942 if (includeBoundConstraints_)
948 Info<<
"Max of lTilda*ls " <<
gMax(lTilda_()*ls_()) <<
endl;
949 Info<<
"Max of uTilda*us " <<
gMax(uTilda_()*us_()) <<
endl;
951 if (includeExtraVars_)
953 Info<<
"Min of extraVars " <<
gMin(extraVars_()) <<
endl;
954 Info<<
"Max of extraVars*z " <<
gMax(extraVars_()*z_()) <<
endl;
957 if (includeExtraVars_)
960 <<
"Constraint penalization variables (y) " << extraVars_()
966 computeNewtonDirection();
971 correction_.rmap(p_, activeDesignVars_);
978 correction_ *= etaHessian_;
985 derivativesOld_ = objectiveDerivatives_;
986 if (constraintDerivativesOld_.empty())
988 constraintDerivativesOld_.setSize(constraintDerivatives_.size());
990 forAll(constraintDerivativesOld_, cI)
992 constraintDerivativesOld_[cI] = constraintDerivatives_[cI];
994 correctionOld_ = correction_;
1015 const label nConstraints,
1022 doAllocateLagrangeMultipliers_(true),
1023 includeBoundConstraints_
1025 designVars->upperBounds() && designVars->lowerBounds()
1029 coeffsDict(
type).getOrDefault<bool>(
"includeExtraVars", false)
1031 p_(activeDesignVars_.size(),
Zero),
1032 gs_(nConstraints_, 1),
1035 includeBoundConstraints_ &&
found(
"lTilda") ?
1036 new
scalarField(
"lTilda", *this, activeDesignVars_.size()) :
1042 includeBoundConstraints_ &&
found(
"uTilda") ?
1043 new
scalarField(
"uTilda", *this, activeDesignVars_.size()) :
1047 extraVars_(nullptr),
1050 deltaP_(activeDesignVars_.size(),
Zero),
1051 deltaLamda_(nConstraints_,
Zero),
1052 deltaGs_(nConstraints_,
Zero),
1053 deltaLTilda_(nullptr),
1055 deltaUTilda_(nullptr),
1057 deltaExtraVars_(nullptr),
1060 epsMin_(coeffsDict(
type).getOrDefault<scalar>(
"epsMin", 1.
e-07)),
1061 maxNewtonIters_(coeffsDict(
type).getOrDefault<label>(
"maxIters", 1000)),
1064 coeffsDict(
type).getOrDefault<label>(
"maxLineSearchIters", 10)
1066 maxDxIters_(coeffsDict(
type).getOrDefault<label>(
"maxDpIters", 1000)),
1067 relTol_(coeffsDict(
type).getOrDefault<scalar>(
"relTol", 0.01)),
1070 preconditionerNames.getOrDefault
1072 "preconditioner", coeffsDict(
type), preconditioners::
diag 1076 (coeffsDict(
type).getOrDefault<scalar>(
"targetConstraintReduction", 1)),
1078 (coeffsDict(
type).getOrDefault<bool>(
"disableDamping", false)),
1079 meritFunctionFile_(nullptr)
1081 Info<<
"Preconditioner type of the SQP subproblem is ::" 1096 Info<<
"Reading constraint penalty function type from dict" <<
endl;
1101 Info<<
"Setting constant penalty factor" <<
endl;
1102 c_.reset(
new Function1Types::Constant<scalar>(
"c", 100));
1120 LagrangianDerivatives_ = objectiveDerivatives_;
1143 scalar
L = objectiveValue_ + mu_*
sum(
pos(cValues_)*cValues_);
1152 globalSum(objectiveDerivatives_*correction_)
1153 - mu_*
sum(
pos(cValues_)*cValues_);
1162 correctionOld_ = oldCorrection;
1168 if (includeBoundConstraints_)
1170 uTilda_().writeEntry(
"uTilda",
os);
1171 lTilda_().writeEntry(
"lTilda",
os);
tmp< scalarField > preconVectorProduct(const scalarField &vector, autoPtr< scalarField > &precon)
Preconditioner-vector product for CG.
tmp< scalarField > resFuTilda()
Residual of the complementarity slackness for the upper bound constraints.
const Type & value() const noexcept
Return const reference to value.
tmp< scalarField > diagPreconditioner()
Diagonal preconditioner of the deltaP eqn.
void size(const label n)
Older name for setAddressableSize.
virtual void updateOldCorrection(const scalarField &oldCorrection)
Update old correction. Useful for quasi-Newton methods coupled with line search.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
scalarField p_
The set of design variables being updated during the subproblem.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
const vector L(dict.get< vector >("L"))
Type gMin(const FieldField< Field, Type > &f)
void updateYS()
Update the vectors accosiated with the Hessian matrix.
void initialize()
Allocate fields related to constraints.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
virtual scalar computeMeritFunction()
Compute merit function. Could be different than the objective in the presence of constraints.
autoPtr< scalarField > deltaUTilda_
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool addToFile(Ostream &os) const
Write continuation info.
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 > resFlTilda()
Residual of the complementarity slackness for the lower bound constraints.
autoPtr< scalarField > uTilda_
Lagrange multipliers for the upper bound constraints.
bool includeBoundConstraints_
Are bound constraints included?
autoPtr< scalarField > lTilda_
Lagrange multipliers for the lower bound constraints.
#define addProfiling(Name,...)
Define profiling trigger with specified name and description string. The description is generated by ...
virtual bool writeData(Ostream &os) const
Write useful quantities to files.
virtual scalar meritFunctionDirectionalDerivative()
Derivative of the merit function. Could be different than the objective derivative in the presence of...
label preconType_
Which preconditioner to use for the solution of the subproblem.
tmp< scalarField > computeRHSForDeltaX(const scalarField &FDx)
Compute the RHS for the deltaX equation.
constexpr char tab
The tab '\t' character(0x09)
void computeCorrection()
Compute design variables correction.
autoPtr< scalarField > deltaLs_
A class for managing references or pointers (no reference counting)
Macros for easy insertion into run-time selection tables.
void adjustStep(scalar &step, const scalar value, const scalar update)
Adjust step to satisfy cireteria.
autoPtr< Function1< scalar > > c_
Multiplier of the additional variables y in the Lagrangian, to make them 'expensive'.
virtual scalar meritFunctionConstraintPart() const
Get the part the merit function that depends on the constraints.
void CGforDeltaP(const scalarField &FDx)
CG algorithm for the solution of the deltaP eqn.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry (const access) with the given keyword.
#define forAll(list, i)
Loop across all elements in list.
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
tmp< scalarField > resFExtraVars()
Residual of the Lagrangian derivative wrt the extra variables.
tmp< scalarField > resFL()
Residual of the gradient of the Lagrangian.
void updateSizes()
Update sizes of fields related to the active design variables.
tmp< scalarField > resFlamda()
Residual of the complementarity slackness for the inequality constraints.
dimensionedScalar pos(const dimensionedScalar &ds)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
const labelList & activeDesignVars_
Map to active design variables.
autoPtr< scalarField > deltaLTilda_
virtual void updateOldCorrection(const scalarField &oldCorrection)
Update old correction. Useful for quasi-newton methods coupled with line search.
const dimensionedScalar e
Elementary charge.
void setSize(const label n)
Alias for resize()
void solveDeltaPEqn()
Solve the equation for deltaX, which is the expensive part of the Newtopn step.
Type gSum(const FieldField< Field, Type > &f)
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
void computeNewtonDirection()
Compute direction for the Newton problem.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
PtrList< scalarField > s_
The previous correction. Holds nPrevSteps_ fields.
tmp< scalarField > resFls()
Residual of the lower bounds slackness.
scalar lineSearch()
Perform line search and return max residual corresponding to the updated solution.
tmp< scalarField > computeResiduals()
Compute and return residuals based on the current solution.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
label nPrevSteps_
Number of old corrections and grad differences kept.
bool useSDamping_
Use damping for s to ensure positive-definitiveness.
bool disableDamping_
Disable damping.
Base class for Sequantial Quadratic Programming (SQP) methods.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
virtual bool writeData(Ostream &os) const
Write useful quantities to files.
void allocateBoundMultipliers()
Allocate multipliers for the bound constraints.
#define DebugInfo
Report an information message using Foam::Info.
tmp< scalarField > resFz()
Residual of the complementarity slackness for the extra variables.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const List< word > & names() const noexcept
The list of enum names, in construction order. Same as toc()
Istream and Ostream manipulators taking arguments.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
int debug
Static debugging option.
Type gMax(const FieldField< Field, Type > &f)
tmp< scalarField > resFGs()
Residual of the inequality constraint slackness.
OBJstream os(runTime.globalPath()/outputName)
tmp< scalarField > ShermanMorrisonPrecon(const scalarField &vector)
Use the Sherman-Morrison formula to compute the matrix-free product of the approximate inverse of the...
void solveSubproblem()
Solve subproblem using a Newton optimiser.
defineTypeNameAndDebug(combustionModel, 0)
dictionary coeffsDict(const word &type) const
Return optional dictionary with parameters specific to each method.
bool useYDamping_
Use damping for s to ensure positive-definitiveness.
An L-BFGS-based SQP algorithm for computing the update of the design variables in the presence of ine...
void updateSolution(const scalar step)
Update the current solution using the known direction and the given step length.
virtual bool writeMeritFunction(const updateMethod &UpdateMethod)
Write info about the merit function.
static const Enum< preconditioners > preconditionerNames
Names of preconditioners for the subproblem.
virtual bool writeAuxiliaryData()
Write merit function information.
autoPtr< scalarField > ls_
Slack variables the lower bound constraints.
#define WarningInFunction
Report a warning using Foam::Warning.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
bool includeExtraVars_
Are additional design variables included?
Mesh data needed to do the Finite Volume discretisation.
const dimensionedScalar c
Speed of light in a vacuum.
PtrList< scalarField > y_
The previous differences of derivatives. Holds nPrevSteps_ fields.
tmp< scalarField > matrixVectorProduct(const scalarField &vector)
Procudt of the LHS of the deltaP eqn with a vector.
The quasi-Newton Limited-memory BFGS formula. Keeps nPrevSteps_ of the y and s vectors and approximat...
messageStream Info
Information stream (stdout output on master, null elsewhere)
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
autoPtr< scalarField > us_
Slack variables the upper bound constraints.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
tmp< scalarField > resFus()
Residual of the upper bounds slackness.
A class for managing temporary objects.
tmp< scalarField > invHFL()
Product of the inverse Hessian with the residual of the gradient of the Lagrangian.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
void storeOldFields()
Store old fields needed for the next iter.
autoPtr< scalarField > deltaUs_
void allocateLagrangeMultipliers()
Allocate Lagrange multipliers for the inequality constraints.
void zeroUpdates()
Zero the updates computed in the previous optimisation cycle.
void reduce(T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) using linear/tree communication schedule.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
void reset(T *p=nullptr) noexcept
Delete managed pointer and set to new given pointer.
static constexpr const zero Zero
Global zero (0)