[petsc-users] Changing the diagonal of a matrix via a vector

2011-04-27 Thread Jed Brown
On Wed, Apr 27, 2011 at 18:41, Xiangdong Liang wrote: > Thanks a lot, Jed. I am using Petsc's built-in function, VecCreate and > MatCreate. they are supposed to return PetscErrorCode. However, I still get > "warning: return makes pointer from integer without a cast" for these > built-in functions

[petsc-users] Changing the diagonal of a matrix via a vector

2011-04-27 Thread Jed Brown
On Wed, Apr 27, 2011 at 17:57, Xiangdong Liang wrote: > I am a novice to Petsc and parallel computing. I have created a mpi sparse > matrix A (size n-by-n) and a parallel vector b (size n-by-1). Now I want to > modify the diagonal of A by adding the values of vector b. Namely, A(i,i) = > A(i,i) +

[petsc-users] Changing the diagonal of a matrix via a vector

2011-04-27 Thread Xiangdong Liang
On Wed, Apr 27, 2011 at 12:03 PM, Jed Brown wrote: > On Wed, Apr 27, 2011 at 17:57, Xiangdong Liang wrote: > >> I am a novice to Petsc and parallel computing. I have created a mpi sparse >> matrix A (size n-by-n) and a parallel vector b (size n-by-1). Now I want to >> modify the diagonal of A by

[petsc-users] Changing the diagonal of a matrix via a vector

2011-04-27 Thread Xiangdong Liang
Hello everyone, I am a novice to Petsc and parallel computing. I have created a mpi sparse matrix A (size n-by-n) and a parallel vector b (size n-by-1). Now I want to modify the diagonal of A by adding the values of vector b. Namely, A(i,i) = A(i,i) + b(i) and all the off-diagonal elements remains