[petsc-users] Example 1 of Vector section

Fazlul Huq huq2090 at gmail.com
Mon Sep 24 20:02:05 CDT 2018


Hello All,

I am looking through the example problems given in PETSc. In the very first
example, ex1 of vector section, I don't understand the following part,
especially the term "PETSC_SMALL". What does this mean?
Here, in the second line we already assign zero to v. What is the meaning
of "if" condition then?

ierr = VecScale(x,two);CHKERRQ(ierr);
  ierr = VecNorm(x,NORM_2,&norm);CHKERRQ(ierr);
  v    = norm-2.0*PetscSqrtReal((PetscReal)n); if (v > -PETSC_SMALL && v <
PETSC_SMALL) v = 0.0;
  ierr = PetscPrintf(PETSC_COMM_WORLD,"VecScale
%g\n",(double)v);CHKERRQ(ierr);


All the best.
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/20180924/c9c39e38/attachment.html>


More information about the petsc-users mailing list