46 constrainedOptimisationMethod,
78 rho_.setSize(cValues_.size() + 1, raa0_);
81 oldObjectiveValue_ = objectiveValue_;
82 oldCValues_ = cValues_;
86 const scalarField x(designVars_().getVars(), activeDesignVars_);
88 (designVars_().lowerBounds()(), activeDesignVars_);
90 (designVars_().upperBounds()(), activeDesignVars_);
93 (objectiveDerivatives_, activeDesignVars_);
98 /globalSum(
x.size())*globalSum(
mag(activeObjDerivs)*span);
101 forAll(constraintDerivatives_, i)
105 constraintDerivatives_[i], activeDesignVars_
109 /globalSum(
x.size())*globalSum(
mag(activeDerivs)*span);
116 if (dynamicRhoInitialisation_)
118 Info<<
"-----------------------------------------" <<
endl;
119 Info<<
"Solving sub problems for initializing rho" <<
endl;
120 Info<<
"-----------------------------------------" <<
endl;
131 designVars_().storeDesignVariables();
132 x0_.
map(designVars_().getVars(), activeDesignVars_);
134 Info<<
"Initial pseudo update of the design variables" <<
endl;
139 designVars_().update(correction_);
145 while (!converged() && iter++ < 10)
147 Info<<
nl <<
"Dynamic rho initialisation iteration " << iter
149 designVars_().resetDesignVariables();
152 designVars_().update(correction_);
155 Info<<
"-----------------------------------------" <<
endl;
156 Info<<
"Dynamic rho initialisation converged in " << iter
157 <<
" iterations " <<
endl;
158 Info<<
"-----------------------------------------" <<
endl;
165 designVars_().resetDesignVariables();
170 rho_ *= dynamicRhoMult_;
175 rho_ =
max(rho_, scalar(1.
e-6));
178 <<
"Computed r values " << rho_ <<
endl;
185 const scalarField x(designVars_().getVars(), activeDesignVars_);
186 const scalarField xMin(designVars_().lowerBoundsRef(), activeDesignVars_);
187 const scalarField xMax(designVars_().upperBoundsRef(), activeDesignVars_);
196 (
x[i] - x0_[i])*(x0_[i] - x00_[i]) < scalar(0)
197 ? asymDecr_ : asymIncr_
199 lower_[i] =
x[i] -
gamma*(x0_[i] - lower_[i]);
200 upper_[i] =
x[i] +
gamma*(upper_[i] - x0_[i]);
211 lower_ =
x - sInit_*span;
212 upper_ =
x + sInit_*span;
216 a_ =
max(a_,
x - move_*span);
217 b_ =
min(
xMax, upper_ - 0.1*(upper_ -
x));
218 b_ =
min(b_,
x + move_*span);
224 const label m(cValues_.size());
228 alpha_.setSize(m,
Zero);
229 if (coeffsDict(typeName).
found(
"c"))
231 Info<<
"Reading constraint penalty function type from dict" <<
endl;
236 Info<<
"Setting constant penalty factor" <<
endl;
237 c_.reset(
new Function1Types::Constant<scalar>(
"c", 100));
239 d_.setSize(m, coeffsDict(typeName).getOrDefault<scalar>(
"d", 1));
240 deltaLamda_.setSize(m,
Zero);
241 deltaY_.setSize(m,
Zero);
242 deltaS_.setSize(m,
Zero);
243 deltaMu_.setSize(m,
Zero);
245 const scalar t = mesh_.time().timeOutputValue();
246 Info<<
"Penalty multiplier (c):: " << c_->value(t) <<
endl;
254 xNew_ = 0.5*(a_ + b_);
255 ksi_ =
max(scalar(1), 1./(xNew_ - a_));
256 Eta_ =
max(scalar(1), 1./(b_ - xNew_));
259 y_.setSize(m, scalar(1));
260 lamda_.setSize(m, scalar(1));
261 s_.setSize(m, scalar(1));
262 mu_.setSize(m,
Zero);
263 mu_ =
max(scalar(1), 0.5*c_->value(t));
274 x0_.map(designVars_().getVars(), activeDesignVars_);
287 designVars_().lowerBoundsRef(), activeDesignVars_
291 designVars_().upperBoundsRef(), activeDesignVars_
299 1.001*
max(derivs, scalar(0))
300 + 0.001*
max(-derivs, scalar(0))
301 + r/(upperBounds - lowerBounds)
314 p(derivs, r,
scalarField(designVars_().getVars(), activeDesignVars_));
327 designVars_().lowerBoundsRef(), activeDesignVars_
331 designVars_().upperBoundsRef(), activeDesignVars_
339 0.001*
max(derivs, scalar(0))
340 + 1.001*
max(-derivs, scalar(0))
341 + r/(upperBounds - lowerBounds)
354 q(derivs, r,
scalarField(designVars_().getVars(), activeDesignVars_));
369 constraintDerivatives_[i], activeDesignVars_
373 res[i] = globalSum(pI/(upper_ - vars) + qI/(vars - lower_));
382 const scalarField vars(designVars_().getVars(), activeDesignVars_);
391 const scalarField activeObjDerivs(objectiveDerivatives_, activeDesignVars_);
394 forAll(constraintDerivatives_, cI)
398 constraintDerivatives_[cI], activeDesignVars_
400 res += lamda_[cI]*
p(activeDerivs, rho_[cI + 1]);
409 const scalarField activeObjDerivs(objectiveDerivatives_, activeDesignVars_);
410 tmp<scalarField> tres(q(activeObjDerivs, rho_[0]));
412 forAll(constraintDerivatives_, cI)
416 constraintDerivatives_[cI], activeDesignVars_
418 res += lamda_[cI]*q(activeDerivs, rho_[cI + 1]);
453 p(dfdx,
rho, xInit)*(1./(upper_ -
x) - 1./(upper_ - xInit))
454 + q(dfdx,
rho, xInit)*(1./(
x - lower_) - 1./(xInit - lower_))
491 field = defaultField;
502 const label
n(xNew_.size());
503 const label m(cValues_.size());
504 const scalarField x(designVars_().getVars(), activeDesignVars_);
507 tmp<scalarField> tpL(pLamda());
509 tmp<scalarField> tqL(qLamda());
519 scalar(2)*pL/
pow3(upper_ - xNew_)
520 + scalar(2)*qL/
pow3(xNew_ - lower_)
528 for (label i = 0; i < m; ++i)
532 constraintDerivatives_[i], activeDesignVars_
534 tmp<scalarField> tp =
p(activeDerivs, rho_[i + 1]);
535 tmp<scalarField> tq = q(activeDerivs, rho_[i + 1]);
546 pL/
sqr(upper_ - xNew_) - qL/
sqr(xNew_ - lower_)
550 const scalar t = mesh_.time().timeOutputValue();
553 c_->value(t) + d_*y_ - lamda_ - eps_/y_
555 scalar deltaZTilda = alpha0_ -
sum(lamda_*alpha_) - eps_/z_;
574 scalar zRatio(z_/zeta_);
578 for (label i = 0; i < m; ++i)
581 for (label j = 0; j < m; ++j)
583 for (label l = 0; l <
n; ++l)
586 lhs[i][j] += DxInv[l]*
G[i][l]*
G[j][l];
590 for (label l = 0; l <
n; ++l)
593 rhs[i] -= DxInv[l]*
G[i][l]*deltaXTilda[l];
599 reduce(lhs, sumOp<scalarSquareMatrix>());
604 rhs += deltaLamdaYTilda + alpha_*deltaZTilda*zRatio;
605 for (label i = 0; i < m; ++i)
608 for (label j = 0; j < m; ++j)
611 lhs[i][j] += alpha_[i]*alpha_[j]*zRatio;
614 lhs[i][i] += DLamdaY[i];
616 solve(deltaLamda_, lhs, rhs);
617 deltaZ_ = (
sum(alpha_*deltaLamda_) - deltaZTilda)*zRatio;
623 deltaX_ = - DxInv*(
G.Tmul(deltaLamda_) + deltaXTilda);
626 deltaY_ = DYInv*(deltaLamda_ - deltaYTilda);
629 deltaS_ = (-s_*deltaLamda_ + eps_)/lamda_ - s_;
632 deltaZeta_ = -zeta_/z_*deltaZ_ - zeta_ + eps_/z_;
635 deltaMu_ = (-mu_*deltaY_ + eps_)/y_ - mu_;
638 deltaEta_ = (Eta_*deltaX_ + eps_)/(b_ - xNew_) - Eta_;
641 deltaKsi_ = (-ksi_*deltaX_ + eps_)/(xNew_ - a_) - ksi_;
647 const label
n(xNew_.size());
648 const label m(cValues_.size());
652 for (label i = 0; i <
n; ++i)
656 xNew_[i] + step*deltaX_[i] - a_[i] - 0.01*(xNew_[i] - a_[i])
660 step = -0.99*(xNew_[i] - a_[i])/deltaX_[i];
665 -xNew_[i] - step*deltaX_[i] + b_[i] - 0.01*(b_[i] - xNew_[i])
669 step = 0.99*(b_[i] - xNew_[i])/deltaX_[i];
672 adjustStep(step, ksi_[i], deltaKsi_[i]);
673 adjustStep(step, Eta_[i], deltaEta_[i]);
676 for (label i = 0; i < m; ++i)
678 adjustStep(step, y_[i], deltaY_[i]);
679 adjustStep(step, lamda_[i], deltaLamda_[i]);
680 adjustStep(step, mu_[i], deltaMu_[i]);
681 adjustStep(step, s_[i], deltaS_[i]);
684 adjustStep(step, z_, deltaZ_);
685 adjustStep(step, zeta_, deltaZeta_);
691 reduce(step, minOp<scalar>());
696 Info<<
"Step before line search is " << step <<
endl;
700 scalar normResOld =
sqrt(globalSum(
magSqr(computeResiduals())));
701 scalar maxRes(GREAT);
703 for (label i = 0; i < maxLineSearchIters_ ; ++i)
706 updateSolution(step);
710 scalar normResNew =
sqrt(globalSum(
magSqr(resNew)));
713 if (normResNew < normResOld)
716 <<
"Initial residual = " << normResOld <<
", " 717 <<
"Final residual = " << normResNew <<
", " 718 <<
"No of LineSearch Iterations = " << i + 1
725 updateSolution(-step);
729 if (i == maxLineSearchIters_ - 1)
732 Info<<
"Line search could not find a step that reduced" 733 <<
" residuals while satisfying the constraints" <<
nl 734 <<
"Increasing eps to " << eps_ <<
endl;
741 Info<<
"Step after line search is " << step <<
nl <<
endl;
755 if (0.99*value + step*
update < scalar(0))
757 step = -0.99*value/
update;
764 xNew_ += step*deltaX_;
767 lamda_ += step*deltaLamda_;
768 ksi_ += step*deltaKsi_;
769 Eta_ += step*deltaEta_;
770 mu_ += step*deltaMu_;
771 zeta_ += step*deltaZeta_;
778 const label
n(xNew_.size());
779 const label m(cValues_.size());
787 (pLamda()/
sqr(upper_ - xNew_) - qLamda()/
sqr(xNew_ - lower_));
788 for (label i = 0; i <
n; ++i)
790 res[iRes++] = dPsidx[i] - ksi_[i] + Eta_[i];
794 const scalar t = mesh_.time().timeOutputValue();
795 for (label i = 0; i < m; ++i)
797 res[iRes++] = c_->value(t) + d_[i]*y_[i] - lamda_[i] - mu_[i];
801 res[iRes++] = alpha0_ - zeta_ -
sum(lamda_*alpha_);
805 for (label i = 0; i < m; ++i)
807 res[iRes++] = gb[i] - alpha_[i]*z_ - y_[i] + s_[i];
811 for (label i = 0; i <
n; ++i)
813 res[iRes++] = ksi_[i]*(xNew_[i] - a_[i]) - eps_;
817 for (label i = 0; i <
n; ++i)
819 res[iRes++] = Eta_[i]*(b_[i] - xNew_[i]) - eps_;
823 for (label i = 0; i < m; ++i)
825 res[iRes++] = mu_[i]*y_[i] - eps_;
829 res[iRes++] = z_*zeta_ - eps_;
832 for (label i = 0; i < m; ++i)
834 res[iRes++] = lamda_[i]*s_[i] - eps_;
849 || (continuousNormalisation_ && counter_ < lastNormalisationStep_)
852 scalarField activeSens(objectiveDerivatives_, activeDesignVars_);
853 Jnorm_.reset(
new scalar(
Foam::sqrt(globalSum(
sqr(activeSens)))));
856 forAll(constraintDerivatives_, cI)
859 (constraintDerivatives_[cI], activeDesignVars_);
862 Info<<
"Computed normalisation factors " <<
nl 863 <<
"J: " << Jnorm_() <<
nl 864 <<
"C: " << Cnorm_() <<
endl;
868 objectiveValue_ /= Jnorm_() + SMALL;
869 objectiveDerivatives_ /= Jnorm_() + SMALL;
872 cValues_ *= cw_/(Cnorm_() + SMALL);
873 forAll(constraintDerivatives_, cI)
875 constraintDerivatives_[cI] *= cw_/(Cnorm_()[cI] + SMALL);
886 const dictionary&
dict,
887 autoPtr<designVariables>& designVars,
888 const label nConstraints,
892 constrainedOptimisationMethod(
mesh,
dict, designVars, nConstraints,
type),
893 updateMethod(
mesh,
dict, designVars, nConstraints,
type),
894 x0_(getOrDefaultScalarField(
"x0", activeDesignVars_.size())),
895 x00_(getOrDefaultScalarField(
"x00", activeDesignVars_.size())),
896 xNew_(activeDesignVars_.size()),
897 oldObjectiveValue_(getOrDefault<scalar>(
"J0",
Zero)),
898 oldCValues_(getOrDefaultScalarField(
"C0", nConstraints_)),
900 z_(coeffsDict(
type).getOrDefault<scalar>(
"z", 1.)),
901 alpha0_(coeffsDict(
type).getOrDefault<scalar>(
"alpha0", 1.)),
906 lower_(xNew_.size(), -GREAT),
907 upper_(xNew_.size(), GREAT),
911 boundRho_(coeffsDict(
type).getOrDefault<bool>(
"boundRho", false)),
912 correctDVs_(coeffsDict(
type).getOrDefault<bool>(
"correct", true)),
917 zeta_(coeffsDict(
type).getOrDefault<scalar>(
"zeta", 1.)),
921 deltaX_(xNew_.size(),
Zero),
926 deltaEta_(xNew_.size(),
Zero),
927 deltaKsi_(xNew_.size(),
Zero),
929 maxNewtonIters_(coeffsDict(
type).getOrDefault<label>(
"maxIters", 6000)),
932 coeffsDict(
type).getOrDefault<label>(
"maxLineSearchIters", 10)
934 initializeEverySubproblem_
935 (coeffsDict(
type).getOrDefault<bool>(
"initializeEverySubproblem", false)),
936 asymDecr_(coeffsDict(
type).getOrDefault<scalar>(
"asymptoteDecrease", 0.7)),
937 asymIncr_(coeffsDict(
type).getOrDefault<scalar>(
"asymptoteIncrease", 1.2)),
938 sInit_(coeffsDict(
type).getOrDefault<scalar>(
"sInit", 0.5)),
939 move_(coeffsDict(
type).getOrDefault<scalar>(
"move", 0.5)),
940 raa0_(coeffsDict(
type).getOrDefault<scalar>(
"raa0", 1.
e-05)),
941 maxInitRhoMult_(coeffsDict(
type).getOrDefault<scalar>(
"maxInitRhoMult", 0.1)),
942 maxRhoMult_(coeffsDict(
type).getOrDefault<scalar>(
"maxRhoMult", 10)),
943 variableRho_(coeffsDict(
type).getOrDefault<bool>(
"variableRho", false)),
944 dynamicRhoInitialisation_
945 (coeffsDict(
type).getOrDefault<bool>(
"dynamicRhoInitialisation", false)),
947 (coeffsDict(
type).getOrDefault<scalar>(
"dynamicRhoMult", 0.1)),
948 normalise_(coeffsDict(
type).getOrDefault<bool>(
"normalise", false)),
949 continuousNormalisation_
950 (coeffsDict(
type).getOrDefault<bool>(
"continuousNormalisation", false)),
953 cw_(coeffsDict(
type).getOrDefault<scalar>(
"constraintWeight", 1)),
954 lastNormalisationStep_
956 coeffsDict(
type).getOrDefault<label>(
"lastNormalisationStep", 20)
960 if (!designVars().lowerBounds() || !designVars().upperBounds())
963 <<
"Lower and upper design variable bounds must be set for MMA" 1022 if (initializeEverySubproblem_)
1027 scalar resMax(
gMax(
mag(computeResiduals())));
1032 <<
"Newton iter " << iter <<
nl <<
endl;
1035 if (resMax < 0.9*eps_)
1041 computeNewtonDirection();
1046 resMax = lineSearch();
1048 <<
"max residual = " << resMax <<
", " 1049 <<
"eps = " << eps_ <<
nl <<
endl;
1051 mesh_.time().printExecutionTime(
Info);
1052 }
while (iter++ < maxNewtonIters_ && (eps_ > 1.
e-07 || resMax > 0.9*eps_));
1054 Info<<
"Solved the MMA Newton problem in " << iter <<
" iterations " 1058 <<
"Constraint penalization variables (y) " << y_ <<
endl;
1061 const scalarField& oldVars = designVars_().getVars();
1062 forAll(activeDesignVars_, avI)
1064 const label vI(activeDesignVars_[avI]);
1065 correction_[vI] = xNew_[avI] - oldVars[vI];
1074 label m(cValues_.size());
1081 const scalarField activeObjDerivs(objectiveDerivatives_, activeDesignVars_);
1082 vals[0] = objectiveValue_;
1083 approx[0] = fTilda(x0_, xNew_, oldObjectiveValue_, activeObjDerivs, rho_[0]);
1086 forAll(constraintDerivatives_, i)
1090 constraintDerivatives_[i], activeDesignVars_
1092 vals[i + 1] = cValues_[i];
1094 fTilda(x0_, xNew_, oldCValues_[i], activeDerivs, rho_[i + 1]);
1102 return valsAndApproxs_;
1112 const scalarField xMin(designVars_().lowerBounds()(), activeDesignVars_);
1113 const scalarField xMax(designVars_().upperBounds()(), activeDesignVars_);
1115 scalar d = globalSum
1117 (upper_ - lower_)*
sqr(xNew_ - x0_)
1118 /(upper_ - xNew_)/(xNew_ - lower_)/(
xMax -
xMin)
1124 const scalar
delta = (vals[i] - approx[i])/d;
1127 rho_[i] =
min(1.1*(rho_[i] +
delta), maxRhoMult_*rho_[i]);
1131 <<
"Updated rho values to " << rho_ <<
endl;
1143 variableRho_ = varRho;
1149 updateValuesAndApproximations();
1153 bool isConverged(
true);
1157 <<
nl <<
"MMA, objective/constraint " << i <<
nl 1158 <<
"Approximation " << approx[i]
1159 <<
" | old value " << vals[i] <<
nl <<
endl;
1160 isConverged = isConverged && (approx[i] - vals[i] > 0.);
1169 x0_.writeEntry(
"x0",
os);
1170 x00_.writeEntry(
"x00",
os);
1171 lower_.writeEntry(
"lower",
os);
1172 upper_.writeEntry(
"upper",
os);
tmp< scalarField > pLamda()
p and q functions, using the dual lamda
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
scalarField ksi_
Lagrange multipliers for the lower limits constraints.
void size(const label n)
Older name for setAddressableSize.
void setVariableRho(bool varRho=true)
Set variable rho.
void solveSubproblem()
Solve subproblem using a Newton optimiser.
void computeCorrection()
Compute design variables correction.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void setOrDefaultScalarField(scalarField &field, const word &name, const label size, const scalarField &defaultField)
Read in scalarField from self (potentially in binary), or allocate field with the size of the active ...
tmp< scalarField > b()
The rhs of the contraint approximations.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
tmp< scalarField > qLamda()
const dimensionedScalar G
Newtonian constant of gravitation.
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)
void computeNewtonDirection()
Compute direction for the Newton problem.
void updateValuesAndApproximations()
Compute objective/constraint values and their approximations.
void updateSolution(const scalar step)
Update the current solution using the known direction and the given step length.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool writeData(Ostream &os) const
Write useful quantities to files.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
tmp< scalarField > p(const scalarField &derivs, const scalar r, const scalarField &x)
p and q functions, used to approximate the objective and contraints
bool converged()
Checks convergence of GCMMA.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
Macros for easy insertion into run-time selection tables.
void reduce(T &value, [[maybe_unused]] BinaryOp bop, [[maybe_unused]] const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce)
scalarField b_
Upper design variables constraints.
#define forAll(list, i)
Loop across all elements in list.
scalarField lower_
Lower design variables asymptotes.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
tmp< scalarField > q(const scalarField &derivs, const scalar r, const scalarField &x)
const labelList & activeDesignVars_
Map to active design variables.
void normalise()
Normalise the objective and constraints if necessary.
const dimensionedScalar e
Elementary charge.
void setSize(const label n)
Alias for resize()
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
tmp< scalarField > getOrDefaultScalarField(const word &name, const label size, const scalar value=Zero)
Read in scalarField from self (potentially in binary), or allocate field with the size of the active ...
void updateRho()
Update rho value if needed.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const scalarField & getRho() const
Get rho value if needed.
tmp< scalarField > gConstr(const scalarField &vars)
g of all constraint functions
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
void adjustStep(scalar &step, const scalar value, const scalar update)
Adjust step to satisfy cireteria.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
scalarField x00_
The twice previous design variables. Used to compute new bounds.
errorManip< error > abort(error &err)
SolverPerformance< Type > solve(faMatrix< Type > &, const dictionary &solverControls)
Solve returning the solution statistics given convergence tolerance.
#define DebugInfo
Report an information message using Foam::Info.
void map(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 map from the given field
int debug
Static debugging option.
Type gMax(const FieldField< Field, Type > &f)
OBJstream os(runTime.globalPath()/outputName)
defineTypeNameAndDebug(combustionModel, 0)
dimensionedScalar pow3(const dimensionedScalar &ds)
scalarField a_
Lower design variables constraints.
tmp< scalarField > computeResiduals()
Compute and return residuals based on the current solution.
scalarField xNew_
The set of design variables being updated during the subproblem.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
void updateSizes()
Update sizes of fields related to the active design variables.
scalar lineSearch()
Perform line search and return max residual corresponding to the updated solution.
const PtrList< scalarField > & getValuesAndApproximations() const
Get objective/constraint values and their approximations.
void zeroUpdates()
Zero the updates computed in the previous optimisation cycle.
messageStream Info
Information stream (stdout output on master, null elsewhere)
void initializeRho()
Initialize rho constants in the (p, q) functions.
scalarField upper_
Upper design variables asymptotes.
scalarField Eta_
Lagrange multipliers for the upper limits constraints.
A class for managing temporary objects.
void updateBounds()
Update the bounds associated with the design variables.
static void listReduce(UList< T > &values, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce list elements (list must be equal size on all ranks), applying bop to each list element...
SquareMatrix< scalar > scalarSquareMatrix
virtual bool writeData(Ostream &os) const
Write continuation data under uniform.
void initialize()
Allocate fields related to constraints.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
void storeOldValues()
Store old objcective and constraint values.
scalar fTilda(const scalarField &xInit, const scalarField &x, const scalar f, const scalarField &dfdx, const scalar rho)
Computation of the approximate function.
scalarField x0_
The previous design variables. Used to compute new bounds.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
RectangularMatrix< scalar > scalarRectangularMatrix
static constexpr const zero Zero
Global zero (0)