Barry Smith <[email protected]> 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).

Attachment: pgpRAXCUChhpv.pgp
Description: PGP signature

Reply via email to