//Initializations
// ierr = KSPGMRESSetRestart(ksp, 16); CHKERRQ(ierr);
- ierr = KSPSetTolerances(ksp, 1e-10, 1e-10, PETSC_DEFAULT, 16); CHKERRQ(ierr);
+ ierr = KSPSetTolerances(ksp, 1e-13, 1e-13, PETSC_DEFAULT, 16); CHKERRQ(ierr);
ierr = KSPSetInitialGuessNonzero(ksp, PETSC_TRUE); CHKERRQ(ierr);
- //Error
+ KSPGetResidualNorm(ksp,&norm);
+
+ /* //Error
ierr = VecCopy(x, residu); CHKERRQ(ierr);
ierr = VecAXPY(residu, -1, x_old); CHKERRQ(ierr);
ierr = VecNorm(residu, NORM_INFINITY, &norm); CHKERRQ(ierr);
-
+ */
ierr = PetscPrintf(PETSC_COMM_WORLD, "Norm of error %g, outer iteration %D\n", norm, giter); CHKERRQ(ierr);
+ KSPGetResidualNorm(ksp,&norm);
+
+ /*
//Error
ierr = VecCopy(x, residu); CHKERRQ(ierr);
ierr = VecAXPY(residu, -1, x_old); CHKERRQ(ierr);
ierr = VecNorm(residu, NORM_INFINITY, &norm); CHKERRQ(ierr);
-
+ */
ierr = PetscPrintf(PETSC_COMM_WORLD, "Norm of error %g, outer iteration %D\n", norm, giter); CHKERRQ(ierr);
}
-
+
/*
Free work space. All PETSc objects should be destroyed when they