- PetscScalar T1,T2;
- T1 = MPI_Wtime();
- ierr = KSPSolve(ksp,b,x);CHKERRQ(ierr);
- T2 = MPI_Wtime();
- /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Check solution and clean up
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
- /*
- Check the error
- */
- Vec sol;
- VecDuplicate(b,&sol);
- MatMult(A,x,sol);
- VecAXPY(sol,-1,b);
- VecNorm(sol, NORM_2, &norm);
- ierr = KSPGetIterationNumber(ksp,&its);CHKERRQ(ierr);
- ierr = PetscPrintf(PETSC_COMM_WORLD,"Norm of error %g iterations %D\n",(double)norm,its);CHKERRQ(ierr);
- ierr = PetscPrintf(PETSC_COMM_WORLD, "\t\t\t -- Execution time : %g (s)\n\n\n", T2-T1); CHKERRQ(ierr);
-
-
+ /* PetscScalar T1,T2; */
+ /* T1 = MPI_Wtime(); */
+ /* ierr = KSPSetUp(ksp); CHKERRQ(ierr); */
+ /* ierr = KSPSolve(ksp,b,x);CHKERRQ(ierr); */
+ /* T2 = MPI_Wtime(); */
+ /* /\* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+ /* Check solution and clean up */
+ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *\/ */
+
+ /* /\* */
+ /* Check the error */
+ /* *\/ */
+ /* Vec sol; */
+ /* VecDuplicate(b,&sol); */
+ /* MatMult(A,x,sol); */
+ /* VecAXPY(sol,-1,b); */
+ /* VecNorm(sol, NORM_2, &norm); */
+ /* ierr = KSPGetIterationNumber(ksp,&its);CHKERRQ(ierr); */
+ /* ierr = PetscPrintf(PETSC_COMM_WORLD,"Norm of error %g iterations %D\n",(double)norm,its);CHKERRQ(ierr); */
+ /* ierr = PetscPrintf(PETSC_COMM_WORLD, "\t\t\t -- Execution time : %g (s)\n\n\n", T2-T1); CHKERRQ(ierr); */
+
+
+
+
+ //version to control the error
+ {