[petsc-users] Mat indices

Feng Shi fshi at fit.edu
Sun Sep 21 10:35:59 CDT 2014


Hi all,

When setting the Mat indices, like the example: src/ts/examples/tutorials/ex10, I noticed that on line

508:     col[0] = i-1;
509:     col[1] = i;
510:     col[2] = i+1<info.mx ? i+1 : -1;
511:     MatSetValuesBlocked<http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatSetValuesBlocked.html#MatSetValuesBlocked>(B,1,&i,3,col,&K[0][0],INSERT_VALUES<http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/INSERT_VALUES.html#INSERT_VALUES>);

How about the case that when i=0, then col[0]=-1 and i=info.mx then col[2]=-1?
My question is, is the Mat default indices starting from -1?

Thank you in advance!

Best regards,

Feng


More information about the petsc-users mailing list