[petsc-users] MatSetValuesStencil correct usage

Jed Brown jedbrown at mcs.anl.gov
Wed Nov 13 14:24:46 CST 2013


"iwaddington ." <iwaddington at gmail.com> writes:

>   Hi everyone, I am having trouble understanding the usage of
> MatSetValuesStencil. My doubt is in the roles played by the arguments idxm
> and idxn, which are passed as arguments according to the function
> documentation. For example, as I was reading example file
> "src/ksp/ksp/examples/tutorials/ex32.c.html<http://www.mcs.anl.gov/petsc/petsc-3.4/src/ksp/ksp/examples/tutorials/ex32.c.html>"
> line 191 I was wondering, ok, we want to insert a 1x5 submatrix inside our
> global matrix, and we somehow have to pass the grid coordinates of the
> points we want to insert, so why is the "row" variable needed, the "col"
> vector seems to contain all the grid coordinates of all the 5 points we are
> inserting.

It is assembling a matrix: the action at a point (row) depends on the
values at several other points (col[]).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131113/eeabb6b2/attachment.pgp>


More information about the petsc-users mailing list