PETSc version 3.17.4
Fix/Edit manual page

# PetscAssert

Assert that a particular condition is true

### Synopsis

    #include <petscerror.h>
    void PetscAssert(bool cond, MPI_Comm comm, PetscErrorCode ierr, const char *message, ...)

Collective

### Input Parameters

| cond | - The boolean condition
| comm | - The communicator on which the check can be collective on
| ierr | - A nonzero error code, see include/petscerror.h for the complete list
| message | - Error message in printf format

### Notes

Enabled only in debug builds. Note that any arguments to this macros are still visible to the compiler optimized builds (so must still contain valid code) but are guaranteed to not be executed.

See PetscCheck() for usage and behaviour.

### See Also

PetscCheck(), SETERRQ(), PetscError()

### 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