Re: [petsc-users] Problem in MatSetValues

2019-03-11 Thread Eda Oktay via petsc-users
Dear Matt, I understood that you are right. I changed sizeof(values) with ncols, it gives matrix correctly. However, now I get an error in EPSGetEigenpair: 0]PETSC ERROR: - Error Message -- [0]PETSC ERROR: Argument o

Re: [petsc-users] Problem in MatSetValues

2019-03-11 Thread Eda Oktay via petsc-users
Dear Matt, I printed in wrong state, ncols gives right solution. But I still can't understand the first problem. Eda Eda Oktay , 11 Mar 2019 Pzt, 16:05 tarihinde şunu yazdı: > Dear Matt, > > Thank you for answering. First of all, sizeof(vals) returns to number of > entries, I checked. Secondly

Re: [petsc-users] Problem in MatSetValues

2019-03-11 Thread Eda Oktay via petsc-users
Dear Matt, Thank you for answering. First of all, sizeof(vals) returns to number of entries, I checked. Secondly, I found a problem: ncols gives me 6.95328e-310. However, I checked the matrix L, it was computed properly. Why can ncols give such a value? Thanks, Eda Matthew Knepley , 11 Mar 20

Re: [petsc-users] Problem in MatSetValues

2019-03-11 Thread Matthew Knepley via petsc-users
On Mon, Mar 11, 2019 at 8:27 AM Eda Oktay via petsc-users < petsc-users@mcs.anl.gov> wrote: > Hello, > > I have a following part of a code which tries to change the nonzero values > of matrix L with -1. However in MatSetValues line, something happens and > some of the values in matrix turns into 1

[petsc-users] Problem in MatSetValues

2019-03-11 Thread Eda Oktay via petsc-users
Hello, I have a following part of a code which tries to change the nonzero values of matrix L with -1. However in MatSetValues line, something happens and some of the values in matrix turns into 1.99665e-314 instead of -1. Type of arr is defined as PetscScalar and arr is produced correctly. What c