[petsc-dev] How to get block size into a DM

Mark Adams mfadams at lbl.gov
Sun Sep 4 19:07:39 CDT 2016

On Sat, Sep 3, 2016 at 11:05 PM, Matthew Knepley <knepley at gmail.com> wrote:

> On Sat, Sep 3, 2016 at 11:12 AM, Mark Adams <mfadams at lbl.gov> wrote:
>> The DM in snes/ex56 does elasticity but the block size does not get into
>> vectors. It does something like this:
>> PetscFECreateDefault(dm, dim, dim, PETSC_FALSE, NULL, 3,
>> &fe);CHKERRQ(ierr); /* elasticity */
>> DMGetDS(dm, &prob);CHKERRQ(ierr);
>> PetscDSSetDiscretization(prob, 0, (PetscObject) fe);CHKERRQ(ierr);
>> DMCreateGlobalVector(dm,&xx);
>> The block size of xx is not 3. (dim==3). It is not clear to me how to
>> make this work.
> The DM determines the block size based on the Section. There could be a
> bug,

I suspect that I just found a hole in the combinatorics (finite!) that is
Plex. I use -mat_block_size 3, so I could see how Plex might not pick it up.

All I do is call DMCreateMatrix(dm, &Amat);

And Amat get its w/o and explicit setfromoptions.

but first did you apply
> a BC that would wreck the block size? Namely did you constrain just one or
> two unknowns at a point?


>   Matt
>> snes/ex56 does use -mat_block_size 3.
>> Mark
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20160904/74f3cdea/attachment.html>

More information about the petsc-dev mailing list