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

Zou (Non-US), Ling ling.zou at inl.gov
Thu Jul 18 12:24:15 CDT 2013


I suppose you need at least one Dirichlet boundary condition for your problem?
i.e., you could not do this:
2T(1) - T(2) = 0
and
-T(N-1) + 2T(N) = 0
at the same time.

On Thu, Jul 18, 2013 at 11:09 AM, Armelius Cameron <armeliusc at gmail.com> wrote:
> 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


More information about the petsc-users mailing list