[petsc-users] GlobalToLocal between DM and SubDM

Matthew Knepley knepley at gmail.com
Tue Apr 30 12:57:04 CDT 2019

On Tue, Apr 30, 2019 at 1:20 PM Josh L via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> Hi,
> I have a DM that that has 2 sections:
> section_0 has 2 dofs: u, v
> section_1 has 1 dofs: p
> and a SubDM created by DMCreateSubDM. SubDM only has section_1.
> There are a global vector created with DM, and a local vector created with
> SubDM
> Can I do GlobalToLocal between this 2 vectors?

No, the global and local vector have to have the same DM.

If yes, which DM should I use when calling GlobalToLocal.
> Basically, I want
> a global vec: [u1, v1, p1 u2, v2, p2, u3, v3, p3......]
> to
> local vec: [all dof p that belongs to this processor]

You will have to do it in two steps, either,

  1) Extract p in a subDM, and then do G2L on that


  2) Do G2L on the full DM, and then extract p from the local vec

1) sounds better to me, but I do not know what your code is doing.



> Thanks,
> Yu-Sheng

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

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190430/d1a2e35c/attachment.html>

More information about the petsc-users mailing list