[petsc-users] how to catch zero pivot errors underneath SNES

Ed Bueler elbueler at alaska.edu
Wed Apr 8 12:26:02 CDT 2015


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.

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?

Ed



On Wed, Apr 8, 2015 at 10:08 AM, Ed Bueler <elbueler at alaska.edu> wrote:

> Dear PETSc --
>
> 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.
>
> 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).
>
> 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.
>
> 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.
>
> Thanks,
>
> Ed
>
> --
> Ed Bueler
> Dept of Math and Stat and Geophysical Institute
> University of Alaska Fairbanks
> Fairbanks, AK 99775-6660
> 301C Chapman and 410D Elvey
> 907 474-7693 and 907 474-7199  (fax 907 474-5394)
>



-- 
Ed Bueler
Dept of Math and Stat and Geophysical Institute
University of Alaska Fairbanks
Fairbanks, AK 99775-6660
301C Chapman and 410D Elvey
907 474-7693 and 907 474-7199  (fax 907 474-5394)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150408/d171d465/attachment.html>


More information about the petsc-users mailing list