# DMSNESCheckDiscretization
Check the discretization error of the exact solution 
## Synopsis
```
#include "petscdmplex.h" 
#include "petscsnes.h"   
PetscErrorCode DMSNESCheckDiscretization(SNES snes, DM dm, PetscReal t, Vec u, PetscReal tol, PetscReal error[])
```

## Input Parameters

- ***snes -*** the `SNES` object
- ***dm   -*** the `DM`
- ***t    -*** the time
- ***u    -*** a `DM` vector
- ***tol  -*** A tolerance for the check, or -1 to print the results instead



## Output Parameters

- ***error -*** An array which holds the discretization error in each field, or NULL



## Note
The user must call `PetscDSSetExactSolution()` beforehand




## See Also
 `PetscDSSetExactSolution()`, `DNSNESCheckFromOptions()`, `DMSNESCheckResidual()`, `DMSNESCheckJacobian()`, `PetscDSSetExactSolution()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/utils/dmplexsnes.c.html#DMSNESCheckDiscretization">src/snes/utils/dmplexsnes.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/utils/dmplexsnes.c)


[Index of all SNES routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
