[petsc-users] Dropping single entries in matrix insertion for block matrices

Jed Brown jed at jedbrown.org
Mon Dec 10 19:58:20 CST 2018


"Smith, Barry F. via petsc-users" <petsc-users at mcs.anl.gov> writes:

>    Well the thing is the indices you pass in are currently always
>    "blocked base", they work automatically for both blocked and non
>    blocked versions of MatSetValuesLocal(). 

What do you mean?  You pass block indices to MatSetValuesBlocked and
scalar indices to MatSetValues.  In MatSetValues_SeqBAIJ, for example

  for (k=0; k<m; k++) { /* loop over added rows */
    row  = im[k];
    brow = row/bs;

>    To support what you want you need to be able to pass in nonblock
>    based version of the indices and (as you noted) keep track of
>    whether you pass in the blocked or non blocked indices so you can
>    apply the scaling or not.
>
>    Ok, give it a try, it does change the interface a bit but I suppose
>    is worth it since it introduces more functionality.

How would the interface change?


More information about the petsc-users mailing list