:orphan: # DMComputeError Computes the error assuming the user has provided the exact solution functions ## Synopsis ``` #include "petscdm.h" #include "petscdmlabel.h" #include "petscds.h" PetscErrorCode DMComputeError(DM dm, Vec sol, PetscReal errors[], Vec *errorVec) ``` Collective ## Input Parameters - ***dm -*** The `DM` - ***sol -*** The solution vector ## Input/Output Parameter - ***errors -*** An array of length Nf, the number of fields, or `NULL` for no output; on output contains the error in each field ## Output Parameter - ***errorVec -*** A vector to hold the cellwise error (may be `NULL`) ## Note The exact solutions come from the `PetscDS` object, and the time comes from `DMGetOutputSequenceNumber()`. ## See Also [](ch_dmbase), `DM`, `DMMonitorSet()`, `DMGetRegionNumDS()`, `PetscDSGetExactSolution()`, `DMGetOutputSequenceNumber()` ## Level developer ## Location src/dm/interface/dm.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/interface/dm.c) [Index of all DM routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)