Re: [petsc-users] MatMult for block matrix

2017-09-11 Thread Barry Smith
This is either a bug in PETSc or some misunderstanding. You certainly should not have to call VecSet() on y first. Can you send (or point to) us a code that demonstrates the problem so we can debug? Barry > On Sep 11, 2017, at 4:22 PM, Xiangdong wrote: > > Hello everyone, > > I have a b

[petsc-users] MatMult for block matrix

2017-09-11 Thread Xiangdong
Hello everyone, I have a block matrix B and vec x, and need to compute y=Bx many times. I found that each time before I call MatMult(B,x,y,ierr), I need to call VecSet(y,0.0,ierr). Otherwise, the result y is not correct (sometimes, but not always). I have this puzzle even if x and y are created by