BUG: continuation of updateMethods with empty activeDesignVariables
When activeDesignVariables are not set explicitly, all design variables are treated as active. These are allocated properly when starting from 0 but not when starting from an intermediate optimisation cycle (e.g. running 5 optimisation cycles, stopping and restarting). The bug affects the BFGS, DBFGS, LBFGS, SR1, SQP and conjugateGradient updateMethods.
Steps to reproduce
- Copy an optimisation case using BFGS, say $FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/shapeOptimisation/sbend/turbulent/opt/BFGS/op1
- Comment out the activeDesignVariables in optimisationDict.
- Run for a number of optimisation cycles using adjointOptimisationFoam, say 5.
- Change the endTime to 10, to run another 5 optimisation cycles and re-run adjointOptimisationFoam. The solver will crash upon trying to compute the update of the design variables since the activeDesignVariables list will be empty.