[petsc-users] DMPlex assemble submatrices with overlapping dofs

Matthew Knepley knepley at gmail.com
Wed Apr 1 11:47:08 CDT 2020


On Wed, Apr 1, 2020 at 10:58 AM Fabian Jakub <
Fabian.Jakub at physik.uni-muenchen.de> wrote:

> Dear Matt, dear PETSc Devs,
>
>
> I have a dmplex mesh with wedge type cells (2d triangle mesh extruded in
> the vertical, i.e. prism cells).
>
> Let me call the faces with 3 edges "top/bot" faces and the faces with 4
> edges "side" faces
>
> The mesh can be subdivided into two regions.
>
> The upper part where a petsc section has only dofs on the "top/bot"
> faces and a lower part where i have dofs on the "side" faces as well.
>
> At the moment I take care of this layout when I assemble the matrices.
>
> I was wondering if I could assemble a submatrix for each part, then
> create a combined matrix from the two regions.
>

Would it be good enough to just get a custom ordering for the dofs, so that
your combined matrix
could look like you want?

If so, you can give the PetscSection object for your DM a permutation that
orders the points the way you want,
first points on the top, then on the bottom, then in between.

  Thanks,

     Matt


> What I tried so far was to
>
> clone the dm twice (topdm and botdm)
>
> generate a section with the corresponding layouts
>
> e.g. now
>
> topdm has 2 cells with dofs on 3 faces
>
> botdm has 1 cell with dofs on 5 faces
>
> DMCompositeCreate()
>
> DMCompositeAddDM(topdm and botdm)
>
>
> Now, looking at the matrix generated on the composite DM
>
> or calling DMCompositeGetGlobalISs
>
> I see that the dofs on the face between the two sub meshes are not shared.
>
> My question is:
>
> Is this generally the way to go about it or do you suggest a completely
> different approach
>
> i.e. instead of "sharing" the dofs on the interfacing faces I could
> "couple" the meshes with matrix entries in the composite Mat
>
> Does that sound more practical?
>
> Or how should I go about telling the composite DM about the shared dofs?
>
> Many Thanks!
>
> Fabian
>
>
>

-- 
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/20200401/40164fee/attachment.html>


More information about the petsc-users mailing list