On Wed, 7 Dec 2011, Xiangdong Liang wrote:

> I think I did have 10 zeros entries. In my script, I have inserted
> zeros by MatSetValue(A,i, (i+1)%N, 0.0, ADD_VALUES); Why doesn't that
> option matter in my case? That option prevents PETSc from inserting
> zeros, doesn't it? Thank you.

MatSetValue is a macro - perhaps its not processing the above properly.

Try:

PetscScalar zero=0.0
MatSetValue(A,i, (i+1)%N, zero, ADD_VALUES)

And if its still not inzerting these zeros - check in a debugger.

Satish

Reply via email to