The error and convergence order with PETSc

Is there an example of calculating the error and convergence order with PETSc?I tried to change an example of a wave equation, but the convergence order result and error result are different from the results of the program written under FreeFem++.