[petsc-dev] NaN constant?

Jed Brown jed at jedbrown.org
Wed Oct 28 23:44:45 CDT 2015


Adrian Croucher <a.croucher at auckland.ac.nz> writes:

> The reason I'm using NaNs is that John O'Sullivan asked on here some
> time ago about how to make a SNES abort when something goes wrong in
> the function evaluation (in our case, probably the solution going out
> of range of thermodynamic functions). The answer he got was you could
> put a NaN or Inf anywhere in the function vector to make the SNES return
> SNES_DIVERGED_FNORM_NAN.

SNESSetFunctionDomainError is the supported API for this purpose.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20151028/a3763ba2/attachment.sig>


More information about the petsc-dev mailing list