Check solution and clean up
283: /* Check the error */
285: VecAXPY(&neg_one,u,x);
286: VecNorm(x,NORM_2,&norm);
287: /* Optional: Scale the norm: norm *= sqrt(1.0/((m+1)*(n+1))); */
290: /* Print convergence information. PetscPrintf() produces a single
print statement from all processes that share a communicator.
An alternative is PetscFPrintf(), which prints to a file. */
294: PetscPrintf(PETSC_COMM_WORLD,"Norm of error %A iterations %d\n",norm,its);
All PETSc objects should be destroyed when they are no longer needed. */
301: VecDestroy(u); VecDestroy(x);
302: VecDestroy(b); MatDestroy(A);
305: /* Always call PetscFinalize() before exiting a program. This routine
– finalizes the PETSc libraries as well as MPI
– provides summary and diagnostic information if certain runtime
options are chosen (e.g., –log_summary). */