[petsc-users] Getting Different Solution from KSP with different resolution

Armelius Cameron armeliusc at gmail.com
Thu Jul 18 12:09:01 CDT 2013


Hello,
I am trying to work on getting to know PETSc by doing an example myself.
Basically, I am trying to solve Ax = b using KSP where A is 1D laplacian
operator (tri-diag banded matrix with {-1,2,-1} on the diagonal), and b is
the forcing term, so it's just basically a simple 1-D poisson equation.

The size of the matrix is n by n, and the vectors have size n. The issue I
am getting is that when I change n, I get different answer for the vector
x. When I plot the result x, the shape still looks like the shape of the
potential I expect, except it's scaled somehow, and the scale is related to
n, somehow.

I am at a loss in trying to figure out what would cause this, so any help
would be appreciated. I've attached the code (fortran) I have.
Thank you.

AC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130718/1a2b29eb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: petsc_poisson.F90
Type: application/octet-stream
Size: 2847 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130718/1a2b29eb/attachment.obj>


More information about the petsc-users mailing list