[petsc-users] Vec Set DM and Mat Set DM

Jed Brown jed at jedbrown.org
Sun Jun 22 00:27:58 CDT 2014


"Sun, Hui" <hus003 at ucsd.edu> writes:

> Sorry, maybe I see some difference. I'm reading line 1253 from 
> http://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex48.c.html
>
> MatSetValuesBlockedStencil(B,8,rc,8,rc,&Ke[0][0],ADD_VALUES);
>
> The Ke is 16 by 16, but rc is of length 8, so that means a 2 by 2
> block is written into each stencil point of B. Is that correct? Now,
> why the compiler necessarily knows that Ke is of size 16 by 16?

Ke is declared that way in this example, but MatSetValuesBlockedStencil
just interprets the array passed as an m*bs by n*bs array in row-major
ordering.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140622/36d377bc/attachment.pgp>


More information about the petsc-users mailing list