Skip to content
Snippets Groups Projects
Commit e5d5e7b0 authored by Vaggelis Papoutsis's avatar Vaggelis Papoutsis Committed by Andrew Heather
Browse files

ENH: added the option to stop the normalisation

of the objective and constraint gradients in MMA, at a specific
optimisation cycle
parent bf18fb75
Branches
Tags
1 merge request!649ENH: update of the adjoint library and introduction of topology optimisation
......@@ -830,7 +830,11 @@ void Foam::MMA::normalise()
if (normalise_)
{
// Compute normalisation factors
if (!Jnorm_ || continuousNormalisation_)
if
(
!Jnorm_
|| (continuousNormalisation_ && counter_ < lastNormalisationStep_)
)
{
scalarField activeSens(objectiveDerivatives_, activeDesignVars_);
Jnorm_.reset(new scalar(Foam::sqrt(globalSum(sqr(activeSens)))));
......@@ -933,7 +937,11 @@ Foam::MMA::MMA
(coeffsDict(type).getOrDefault<bool>("continuousNormalisation", false)),
Jnorm_(nullptr),
Cnorm_(nullptr),
cw_(coeffsDict(type).getOrDefault<scalar>("constraintWeight", 1))
cw_(coeffsDict(type).getOrDefault<scalar>("constraintWeight", 1)),
lastNormalisationStep_
(
coeffsDict(type).getOrDefault<label>("lastNormalisationStep", 20)
)
{
// Check that the design variables bounds have been set
if (!designVars().lowerBounds() || !designVars().upperBounds())
......
......@@ -248,6 +248,9 @@ protected:
//- Constaint weight after the normalisation
scalar cw_;
//- Constaint weight after the normalisation
label lastNormalisationStep_;
// Protected Member Functions
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment