On Mon, Sep 24, 2018 at 9:02 PM Fazlul Huq <[email protected]> wrote:
> 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? > This checks that we get the norm we expect. PETSC_SMALL is a small difference we are willing to accept due to roundoff error. Matt > 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: [email protected] > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
