BUG: ISQP with the ShermanMorrison preconditioner crashes in the absence of bound constraints
Summary
When using the ISQP updateMethod with the ShermanMorrison preconditioner, the optimisation will crash at the first update of the design variables, if the latter have no bounds.
Steps to reproduce
Run the tutorial under $FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/shapeOptimisation/naca0012/laminar/multipleConstraints, after enabling the ShermanMorrison preconditioner in the optimisationDict
updateMethod
{
method ISQP;
preconditioner ShermanMorrison;
....
}
What is the current bug behaviour?
When no bounds are allocated, the tdiag tmp holds a null pointer in the following line of ISQP.C
432 // Contribution from bound constraints, treated as the seed of the
433 // L-BFGS inverse
434 tmp<scalarField> tdiag(nullptr);
435 if (includeBoundConstraints_)
436 {
437 tdiag.reset(lTilda_()/ls_() + uTilda_()/us_());
438 }
which causes a FatalError when the tmp is passed by copy to LBFGS::invHessianVectorProduct
Environment information
- OpenFOAM version : v2312