I am trying to run an optimization with SimpleGADriver in OpenMDAO. My model includes a cycle (subsystem) with a nonlinear solver, that contains a component that on occasions fails to compute its response. Is there any way to make this driver continue to the next iteration (iteration of the driver) on encountering this error, i.e., is there any way to break the nonlinear solver's solution and proceed with the next iteration of the driver?
Assuming that your component knows when it fails to compute its response, it can raise an om.AnalysisError
. When the SimpleGADriver detects this, it will mark this as a failed point and move on to the next point to evaluate in the current generation. However, if you have nested nonlinear solvers (i.e., solvers in more than one group in the hierarchy above your component), then you also need to set reraise_child_analysiserror
to True in those solvers.
I looked through our documentation, and there isn't an example of this, but you can see AnalysisError usage in this test:
https://github.com/OpenMDAO/OpenMDAO/blob/master/openmdao/test_suite/components/ae_tests.py
You can also see a nested solver case with reraise_child_analysiserror
in this test: