ENH: added a general framework for normalization and setting targets

for all objective functions.

- The normalization is useful for practically all update methods dealing
with constraints (e.g. SQP, MMA). The normalization factor can be either
given explicitly or, if not given, will be the value of the objective
function in the first optimisation cycle.
- The target value is useful when using the objective as a constraint in
constrained optimisation problems (e.g. drag - dragTarget). It should
only be used with update methods that understand the value of the
constraint (e.g. SQP, MMA) but not when the objective in hand is the
only objective of the optimisation problem. In such a case, a squared
objective should be used (e.g. sqr(drag - dragTarget))
This commit is contained in:
Vaggelis Papoutsis
2020-05-28 11:43:09 +03:00
committed by Andrew Heather
parent 4d67819a2c
commit 6ee7bc66c5
7 changed files with 186 additions and 5 deletions

View File

@ -72,6 +72,7 @@ protected:
const word objectiveName_;
bool computeMeanFields_;
bool nullified_;
bool normalize_;
//- Objective function value and weight
scalar J_;
@ -82,12 +83,21 @@ protected:
//- Objective weight
scalar weight_;
// Objective integration start and end times (for unsteady flows)
//- Normalization factor
autoPtr<scalar> normFactor_;
//- Target value, in case the objective is used as a constraint
// Should be used in caution and with updateMethods than get affected
// by the target value, without requiring a sqr (e.g. SQP, MMA)
scalar target_;
//- Objective integration start and end times (for unsteady flows)
autoPtr<scalar> integrationStartTimePtr_;
autoPtr<scalar> integrationEndTimePtr_;
// Contribution to field sensitivity derivatives
// Topology optimisation
//- Contribution to field sensitivity derivatives
// Topology optimisation or other variants with
// as many design variables as the mesh cells
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
autoPtr<volScalarField> dJdbPtr_;
@ -248,6 +258,12 @@ public:
//- Return the objective function weight
scalar weight() const;
//- Is the objective normalized
bool normalize() const;
//- Normalize all fields allocated by the objective
virtual void doNormalization();
//- Check whether this is an objective integration time
bool isWithinIntegrationTime() const;