void CHKERRQ(PetscErrorCode errorcode)
Experienced users can set the error handler with PetscPushErrorHandler().
CHKERRQ(n) is fundamentally a macro replacement for if (n) return(PetscError(...,n,...));
Although typical usage resembles "void CHKERRQ(PetscErrorCode)" as described above, for certain uses it is highly inappropriate to use it in this manner as it invokes return(PetscErrorCode). In particular, it cannot be used in functions which return(void) or any other datatype. In these types of functions, a more appropriate construct for using PETSc Error Handling would be if (n) {PetscError(....); return(YourReturnType);}
Level:beginner
Location:src/sys/error/../../../include/petscerror.h
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages