<div dir="ltr">PS: I *did* indeed write a kludge for this, namely catching the ierr output from "ierr = SNESSolve(...)", and then if it equals 71 convert it to a new negative value of SNESConvergedReason and adding a new string "DIVERGED_LU_ZERO_PIVOT", because I have other scripts that diagnose parameter study results and whether they diverged.<div><br></div><div>But the kludge still spews traceback at me. To eliminate that I suppose I'd need to also wrap the default petsc error handler so that it is silent on 71. So I wonder if a SNES API addition could be helpful here if my usage case is common?<div><br></div><div>Ed</div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 8, 2015 at 10:08 AM, Ed Bueler <span dir="ltr"><<a href="mailto:elbueler@alaska.edu" target="_blank">elbueler@alaska.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear PETSc --<div><br></div><div>Context: I am solving a not very smooth and very nonlinear problem using SNES. Robustness is an issue but I think there is no theory to help me, and I am stuck mollifying the problem a bit when divergence happens. Thus I deal with the returned divergence reason (i.e. SNESConvergedReason) by making the problem slightly easier. This deals with DIVERGED_LINE_SEARCH and DIVERGED_LINEAR_SOLVE the way I want, for example.</div><div><br></div><div>The problem is that sometimes zero pivots occur, either in default (GMRES+ILU or GMRES+BJACOBI+sub_ILU) or in domain decomposition (GMRES+ASM+sub_LU).</div><div><br></div><div>I want to catch and deal with these zero pivots in the same way, ideally. Is there a way to make zero pivot propagate through to generate a new negative SNESConvergedReason? Note that DIVERGED_LINEAR_SOLVE would tell me enough; it seems to me a zero pivot during application of the preconditioner *is* a DIVERGED_LINEAR_SOLVE error anyway.</div><div><br></div><div>If not, can I at least catch the zero pivot error so it is not an error (i.e. so the program continues), without ignoring all errors? I think I don't want to push PetscIgnoreErrorHandler, because I am happy with how other errors are handled.</div><div><br></div><div>Thanks,</div><div><br></div><div>Ed<span class="HOEnZb"><font color="#888888"><br clear="all"><div><br></div>-- <br><div>Ed Bueler<br>Dept of Math and Stat and Geophysical Institute<br>University of Alaska Fairbanks<br>Fairbanks, AK 99775-6660<br>301C Chapman and 410D Elvey<br><a href="tel:907%20474-7693" value="+19074747693" target="_blank">907 474-7693</a> and <a href="tel:907%20474-7199" value="+19074747199" target="_blank">907 474-7199</a> (fax <a href="tel:907%20474-5394" value="+19074745394" target="_blank">907 474-5394</a>)</div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Ed Bueler<br>Dept of Math and Stat and Geophysical Institute<br>University of Alaska Fairbanks<br>Fairbanks, AK 99775-6660<br>301C Chapman and 410D Elvey<br>907 474-7693 and 907 474-7199 (fax 907 474-5394)</div>
</div>