[petsc-dev] Changing Mat block size?
Matthew Knepley
knepley at gmail.com
Fri Feb 14 03:06:52 CST 2014
On Feb 14, 2014 12:11 AM, "Jed Brown" <jed at jedbrown.org> wrote:
>
> 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);
I think you need this or we need to change MatCreateShell
Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20140214/2edc7049/attachment.html>
More information about the petsc-dev
mailing list