-
Notifications
You must be signed in to change notification settings - Fork 69
Description
Proposed feature.
The current _refine_iter implementation (in dymos/grid_refinement/refinement.py) will continue refining even if the optimization fails to converge. I could see this being desirable in some cases, but there are some instances where the problem is truly infeasible. In these infeasible cases the refinement will continue until it hits its limit, which can make iterating over high level trajectory parameters cumbersome.
I propose adding a terminate_on_fail argument to _refine_iter (and exposing it in the run_problem interface). I think the implementation is very straightforward; add the following check in the refinement iteration loop here:
if not failed.success and terminate_on_fail:
breakThough I'm not positive that the .success attribute is available in drivers other than the pyOptSparse one.
It may also be desirable to have the option to avoid running the simulation in run_problem if the optimization (or nonlinear solve) fails.
I could open a PR with a proposed implementation if that'd be helpful.
Example
No response