[petsc-dev] DMPlex sections with non-interleaved fields

Matthew Knepley knepley at gmail.com
Wed May 28 15:49:42 CDT 2014


On Wed, May 28, 2014 at 3:30 PM, Lawrence Mitchell <
lawrence.mitchell at imperial.ac.uk> wrote:
>
> So in this case, I would have a monolithic (interleaved) matrix which I
>> assemble into by doing MatGetLocalSubMatrix to get a block.  Rather than
>> having a Nest for which I do MatNestGetSubMat to get a block.  Is that
>> right?  So in this case I just need to arrange to create my monolithic
>> matrices and the ISes to pass to MatGetLocalSubMatrix (note I can't let
>> the DM create the Mat because in some cases I'm lying to it about the
>> connectivity so the sparsity pattern it would give is wrong, even if the
>> number of dofs and offsets are right).  However, is it intended that
>> this kind of setup ever work with DMSetMatType(..., MATNEST)?  If so, I
>> think I'll be back at square one with this approach.
>
>
> Yes, exactly. You would just use your ISes from the section to pull out the
> submatrix,
>
>
> Do I have to build these from the global section I've pulled from the dm
> by hand or is there a utility function to do so? If the former, I run over
> all the points in the chart, how do I determine which dofs belong to each
> field (it sort of feels like I'm recreating something that the dm just do
> already).
>

I sounds like you want
http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/DM/DMCreateSubDM.html


> and it should then function exactly as the one from MatNestGetSubMat().
> I don't think square one here, because the approach is more flexible.
>
>
> So with that part I was referring to matgetsubmatrix_nest only being able
> to pull out single blocks, which sort of defeats recursive fieldsplit,
> since you can't ask for a 2x2 block to split again. Perhaps, however this
> is a small smop.
>

This is another reason I am not a big fan of Nest, but since its just a
matrix implementation, I don't
think its a big deal. The code should be written to use the generic Mat
interface.

> If the IS
> matches the IS for a Nest block, then the submatrix can just be returned
> wholesale.
> If the Mat is not a Nest, or the IS is interleaved, then the interface is
> the same.
> I think this approach can do what you want.
>
>
> I'll have to do something similar with the vecs I build, since they're
> currently built separately and then shoved together with a vecscatter as
> needed, but I guess that's more similar index fiddling.
>

Yep, you can also set an l2g here.

  Matt


> Lawrence
>

-- 
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/20140528/de4a1335/attachment.html>


More information about the petsc-dev mailing list