[petsc-users] mpi_aij MatGetSubMatrix with mat_block_size!=1

Lawrence Mitchell lawrence.mitchell at imperial.ac.uk
Mon Nov 30 10:18:20 CST 2015



On 30/11/15 16:14, Eric Chamberland wrote:
> Hi,
> 
> Using PETSc 3.5.3.
> 
> We have a "A" matrix, mpi_aij with block_size=3.
> 
> We create a IS with ISCreateStride, then extract A_00 with 
> MatGetSubMatrix(..., MAT_INITIAL_MATRIX,...).
> 
> We know that A_00 is block_size = 3 and mpi_aij, however the matrix 
> created by PETSc doesn't have the information...
> 
> How can I have the block_size=3 option into the extracted matrix so the 
> further PC we configure (gamg) can work with it?
> 
> I tried:
> 
> MatSetBlockSizes(A_00,3, 3);
> after the MatGetSubMatrix, but it doesn't change it...

The block size of the submatrix comes from the block size that lives
on the IS used to define it.  So set a block size on the IS you make
(ISSetBlockSize).

Cheers,

LAwrence

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20151130/5c53f059/attachment.pgp>


More information about the petsc-users mailing list