I have a problem that, depending on material parameters, the simulation can diverge, getting nan residual. Is there any parameter that I can set to force the solver to stop when reaching nan? A maximum value of residual? Because, it does not stop and the computer crashes as a consequence.