<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Sep 24, 2018 at 9:02 PM Fazlul Huq <<a href="mailto:huq2090@gmail.com">huq2090@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div style="font-family:comic sans ms,sans-serif">Hello All,</div><div style="font-family:comic sans ms,sans-serif"><br></div><div style="font-family:comic sans ms,sans-serif">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? <br></div></div></div></blockquote><div><br></div><div>This checks that we get the norm we expect. PETSC_SMALL is a small difference we are willing to accept</div><div>due to roundoff error.</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div style="font-family:comic sans ms,sans-serif"></div><div style="font-family:comic sans ms,sans-serif">Here, in the second line we already assign zero to v. What is the meaning of "if" condition then?<br></div><div style="font-family:comic sans ms,sans-serif"><br clear="all"></div>ierr = VecScale(x,two);CHKERRQ(ierr);<br> ierr = VecNorm(x,NORM_2,&norm);CHKERRQ(ierr);<br> v = norm-2.0*PetscSqrtReal((PetscReal)n); if (v > -PETSC_SMALL && v < PETSC_SMALL) v = 0.0;<br> ierr = PetscPrintf(PETSC_COMM_WORLD,"VecScale %g\n",(double)v);CHKERRQ(ierr);</div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><div style="font-family:comic sans ms,sans-serif">All the best.</div><div style="font-family:comic sans ms,sans-serif">Sincerely,</div><div style="font-family:comic sans ms,sans-serif">Huq<br></div></div><div dir="ltr">-- <br><div dir="ltr" class="m_-8517623718547065421gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><br><div><font face="comic sans ms, sans-serif">Fazlul Huq</font></div><div><font face="comic sans ms, sans-serif">Graduate Research Assistant</font></div><div><font face="comic sans ms, sans-serif">Department of Nuclear, Plasma & Radiological Engineering (NPRE)</font></div><div><font face="comic sans ms, sans-serif">University of Illinois at Urbana-Champaign (UIUC)</font></div><div><font face="comic sans ms, sans-serif">E-mail: <a href="mailto:huq2090@gmail.com" target="_blank">huq2090@gmail.com</a></font></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>