[petsc-users] On the usage of MatSetValuesBlocked

Barry Smith bsmith at petsc.dev
Thu Nov 3 13:13:11 CDT 2022



> On Nov 3, 2022, at 1:16 PM, Edoardo alinovi <edoardo.alinovi at gmail.com> wrote:
> 
> Ah, I was forgetting the most important thing... Are the size of idxm and idxn equal to one if I insert 1 block or should I specify all the rows and columns in the block?

  Yes, for a single block they are one.  The block size is set with MatSetBlockSize() or in the preallocation routines or automatically if you use DMCreateMatrix(), the block size is not passed in during MatSetValuesBlocked() the matrix uses its internal value.

 Barry

> 
> I am getting some memory issues with unallocated non zero values so I must have made some mistake here... :( 
> 
> Sorry for the ton of questions! 



More information about the petsc-users mailing list