[petsc-users] SNESSetFunctionDomainError

Jed Brown jed at jedbrown.org
Sun Aug 24 23:05:05 CDT 2014


Barry Smith <bsmith at mcs.anl.gov> writes:
>    I tried once to convert PETSc errors to be more “exception like”
>    and let them be caught and handled. It worked but was kind of
>    clunky so I gave up on it and decided that anything we wanted to be
>    “handled” instead of just passed up as an error would be code
>    instead of errors. 

This is valuable for debugging.  Using exceptions for control flow
breaks the ability to find real errors by simply breaking on PetscError.

>    This may even be when the SNESFunctionDomainError was
>    introduced. The simplest fix is for MatMult_MFFD() to generate a
>    regular error when it sees a domain error which will stop the code;
>    in the longer run we may want to propagate it up without generating
>    a full error.

SETERRQ is not an option here because the application wants to handle
the error.  Better to mark the result Vec as invalid (either in-band or
out-of-band).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140824/40e0d70d/attachment.pgp>


More information about the petsc-users mailing list