[petsc-users] On the usage of MatSetValuesBlocked

Edoardo alinovi edoardo.alinovi at gmail.com
Thu Nov 3 16:56:36 CDT 2022


Barry,

Can you please provide me with an example on how to use
MatSetValuesBlocked?

To play it easy, let's say that I want to insert a 3x3 block matrix b into
the matrix A, rows 0-2, columns 0-2. Up to what I've understood (very few
apparently XD ), I would do like this:

b(3,3) = 11.0
call MatSetValuesBlocked(A, 3, 0, 3, 0, b, INSERT_VALUES, ierr).

This does not work at all, I get this result that does not make any sense 😫

[image: image.png]

It places 6 values instead of 9 and it they are in odd locations (0 1 2 9
10 11).

Also I noted that I am getting  different results if in place of  the zero
in red I use a fortran integer 😥

Super thanks for the help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20221103/79b33f91/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 14274 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20221103/79b33f91/attachment.png>


More information about the petsc-users mailing list