Hi, Thank you for your reply. Yeah, as you suspected, I printed these numbers after that statement. Now it gives the expected values.
Regards, Maahi Talukder On Mon, Jan 14, 2019 at 9:33 PM Mark Adams <mfad...@lbl.gov> wrote: > This code puts the error in x: > > call VecAXPY(x,neg_one,u,ierr) > > I suspect you printed these numbers after this statement. > > On Mon, Jan 14, 2019 at 8:10 PM Maahi Talukder via petsc-users < > petsc-users@mcs.anl.gov> wrote: > >> Hello all, >> >> I complied and run the example *ex2f.F90* located in >> */home/maahi/petsc/src/ksp/ksp/examples/tutorials. >> *As in the code the right hand side vector, b, was computed assuming an >> exact solution of a vector with all elements of 1.0, all the values of >> vector 'x' should have been 1.0. But after running the code as it was >> provided, the values of vector x that I get are the followings - >> 2.72322e-07 >> 3.81437e-07 >> 1.58922e-07 >> 3.81437e-07 >> 2.38878e-07 >> -6.65645e-07 >> 1.58922e-07 >> -6.65645e-07 >> -2.51219e-07 >> >> I am wondering what went wrong? Could you please help me with some >> insight into this? >> >> Regards, >> Maahi Talukder >> Clarkson University >> >