[petsc-users] Example for MatInvertBlockDiagonal

Barry Smith bsmith at mcs.anl.gov
Mon Sep 19 10:18:04 CDT 2016


  Cyrill,

    This is very specialized for implementing point block Jacobi; I don't think it is something you would want to use directly. 

     If you do want to use it, it simply returns the inverses of the block diagonals in column major form. You can then call MatSetValues() with with each of those blocks into another PETSc matrix. values[i*bs*bs] is the starting point of each block in the array.

   Barry

> On Sep 19, 2016, at 4:55 AM, Cyrill Vonplanta <cyrill.von.planta at usi.ch> wrote:
> 
> Dear PETSc-Users,
> 
> I would like to use the inverted block diagonals of a a matrix. I have seen the function MatInvertBlockDiagonal() but I don’t know how to create a matrix out of them or an array of block matrizes.
> 
> Does anyone have an example on how to use  **values to create a PETSc matrix?
> 
> Thanks
> Cyrill



More information about the petsc-users mailing list