petsc-main 2021-04-20
Report Typos and Errors


Computes the error assuming the user has given exact solution functions


#include "petscdm.h"          
#include "petscdmlabel.h"     
#include "petscds.h"     
PetscErrorCode DMComputeError(DM dm, Vec sol, PetscReal errors[], Vec *errorVec)
Collective on DM

Input Parameters

dm - The DM
sol - The solution vector
errors - An array of length Nf, the number of fields, or NULL for no output
errorVec - A Vec pointer, or NULL for no output

Output Parameters

errors - The error in each field
errorVec - Creates a vector to hold the cellwise error

Note: The exact solutions come from the PetscDS object, and the time comes from DMGetOutputSequenceNumber().

See Also

DMMonitorSet(), DMGetRegionNumDS(), PetscDSGetExactSolution(), DMGetOutputSequenceNumber()




Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages