[petsc-users] zeros in sparse aij

Xiangdong Liang xdliang at gmail.com
Wed Dec 7 11:02:48 CST 2011


On Wed, Dec 7, 2011 at 11:53 AM, Satish Balay <balay at mcs.anl.gov> wrote:
> 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.

Actually, I want PETSc does not insert zero in this case. Is there a
way to do that? Thanks.


>
> Satish


More information about the petsc-users mailing list