[petsc-users] How to define blocks for PCFIELDSPLIT?

Barry Smith bsmith at mcs.anl.gov
Wed Mar 1 13:26:34 CST 2017


> On Mar 1, 2017, at 12:59 PM, Lucas Clemente Vella <lvella at gmail.com> wrote:
> 
> I have a parallel AIJ matrix and I know exactly which element belongs to each one of the 4 submatrices blocks I want to use to solve the linear system. The blocks are not strided, because they have different number of elements.
> 
> I understand that I must use PCFieldSplitSetIS(), since PCFieldSplitSetFields() is only for strided blocks. What I don't understand is how to create the IS structure I must pass to it.
> 
> Each matrix coefficient is identified by a pair (i, j), but on IS creation functions, like ISCreateGeneral() and ISCreateBlock(), I am supposed to provide a one dimension set of indices. How does these indices relates to the matrix coefficients?

   PCFieldSplitSetIS() always indicates SQUARE blocks along the diagonal of the original matrix. Hence you need only one IS to define a block, you don't need one for the columns and one for the rows.  The IS is telling what rows AND columns you want in the block.


> Also, ISCreateGeneral() seems to create a single block, and ISCreateBlock() seems to create multiple blocks of the same size.

    ISCreateBlock() does not create multi blocks, it creates a single IS that has "block structure", for example 0,1, 3, 4, 6, 7, 9,10, ....
> How to create multiple blocks with different sizes?

   ISCreateGeneral(). 


> 
> Thanks.
> 
> -- 
> Lucas Clemente Vella
> lvella at gmail.com



More information about the petsc-users mailing list