[petsc-users] Example 23 of ksp problems

Fazlul Huq huq2090 at gmail.com
Mon Nov 26 21:30:56 CST 2018


Hello PETSc developers,

I went through the ex23.c of ksp section attached herewith but I don't
understand the following part:
***********************************************
tol=1000.*PETSC_MACHINE_EPSILON
************************************************
and,
************************************************
ierr = VecAXPY(x,-1.0,u);CHKERRQ(ierr);
 ierr = VecNorm(x,NORM_2,&norm);CHKERRQ(ierr);
 ierr = KSPGetIterationNumber(ksp,&its);CHKERRQ(ierr);
 if (norm > tol) {
 ierr = PetscPrintf(PETSC_COMM_WORLD,"Norm of error %g, Iterations %D\n",
(double)norm,its);CHKERRQ(ierr);
  }
************************************************
I don't understand what is "tol" here and "*PETSC_MACHINE_EPSILON"?
The if condition is also not clear to me.

Thanks.
Sincerely,
Huq
-- 

Fazlul Huq
Graduate Research Assistant
Department of Nuclear, Plasma & Radiological Engineering (NPRE)
University of Illinois at Urbana-Champaign (UIUC)
E-mail: huq2090 at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20181126/a39c17dd/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ex23.c
Type: text/x-csrc
Size: 7674 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20181126/a39c17dd/attachment.bin>


More information about the petsc-users mailing list