[petsc-users] PETSc turtorial example generating unexpected result

Mark Adams mfadams at lbl.gov
Mon Jan 14 20:33:23 CST 2019


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 at 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190114/d14b085d/attachment.html>


More information about the petsc-users mailing list