[petsc-dev] Changing Mat block size?

Jed Brown jed at jedbrown.org
Fri Feb 14 00:10:14 CST 2014


I'm confronted with code that looks like this:

  MatCreateShell(...,&B);
  MatSetBlockSize(B,3);

This used to work, but then we made block sizes stricter and since
MatCreate_Shell calls PetscLayoutSetUp, we can't change the block size
later.  Is there a sane way to fix this (perhaps leaving [rc]map->bs=-1
and collapsing it to 1 the first time it is actually used), or must we
replace that code with the following?

  MatCreate(comm,&B);
  MatSetBlockSize(B,3);
  MatSetSizes(B,m,n,M,N);
  MatSetType(B,MATSHELL);
  MatShellSetContext(B,ctx);
  MatSetUp(B);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20140213/ffe9b894/attachment.sig>


More information about the petsc-dev mailing list