[petsc-users] fieldsplit question
Matthew Knepley
knepley at gmail.com
Thu Apr 3 07:56:07 CDT 2025
On Thu, Apr 3, 2025 at 12:11 AM Sanjay Govindjee via petsc-users <
petsc-users at mcs.anl.gov> wrote:
> We would like to solve an FEA problem (unstructured grid) where the nodes
> on the elements have different dofs. For example the corner nodes have
> only dof 0 and then mid-side nodes have dofs 0,1,2 (think 8 node
> serendipity element). This is a multi-physics problem so we are looking to
> use the fieldsplit features to pre-condition and solve. Is there a simple
> example of this type of usage in the src that we can try to mimic?
>
> I presume this will take programming as opposed to just setting command
> line options.
>
It will take a little programming, but not much. Here is the idea.
FieldSplit needs to know what dofs belong to what field. There are a couple
of ways to do this, at different levels of abstraction.
1. Low level
You can explicitly makes lists of the dofs in each field, as an IS, and
call https://urldefense.us/v3/__https://petsc.org/main/manualpages/PC/PCFieldSplitSetIS/__;!!G_uCfscf7eWS!aMROjbrPD3RYXMpO8mIii7q8eXZX1uN-6F6-g_jcNLLXGCgYPt2JEDkIIQCHs_vNBhhxsiwQJaz57ydxKyWe$ for each
field. This is not very flexible, but the easiest to understand.
2. Intermediate level
You can make a DMShell, and then make a PetscSection, that gives the number
of dofs on each vertex and edge. Then call KSPSetDM() or SNESSetDM(), and
you can do nested fieldsplits from the command line. This also retains a
connection between the topology and the data layout, but you have to deal
with that pesky DM object.
3. High level
You can use a DMPlex to represent your grid and a PetscFE to represent the
discretization, and then layout is done automatically, and nested
fieldsplits can be done from the command line. I am not 100% sure PetscFE
can represent what you want, but you can always call DMPlexCreateSection()
by hand to make the PetscSection.
Thanks,
Matt
> -sanjay
>
>
--
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://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!aMROjbrPD3RYXMpO8mIii7q8eXZX1uN-6F6-g_jcNLLXGCgYPt2JEDkIIQCHs_vNBhhxsiwQJaz579za_RM4$ <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!aMROjbrPD3RYXMpO8mIii7q8eXZX1uN-6F6-g_jcNLLXGCgYPt2JEDkIIQCHs_vNBhhxsiwQJaz57-FUThx2$ >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250403/b25b639a/attachment.html>
More information about the petsc-users
mailing list