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

Lawrence Mitchell lawrence.mitchell at imperial.ac.uk
Wed May 28 15:30:28 CDT 2014


>> 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).

> 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.

> 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.

Lawrence

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20140528/cb8ecc22/attachment.html>


More information about the petsc-dev mailing list