<div dir="ltr"><div dir="ltr">On Thu, Apr 3, 2025 at 12:11 AM Sanjay Govindjee via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:</div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>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?</div><div><br></div><div>I presume this will take programming as opposed to just setting command line options.</div></div></blockquote><div><br></div><div>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.</div><div><br></div><div>1. Low level</div><div><br></div><div>You can explicitly makes lists of the dofs in each field, as an IS, and call <a href="https://urldefense.us/v3/__https://petsc.org/main/manualpages/PC/PCFieldSplitSetIS/__;!!G_uCfscf7eWS!aMROjbrPD3RYXMpO8mIii7q8eXZX1uN-6F6-g_jcNLLXGCgYPt2JEDkIIQCHs_vNBhhxsiwQJaz57ydxKyWe$">https://petsc.org/main/manualpages/PC/PCFieldSplitSetIS/</a> for each field. This is not very flexible, but the easiest to understand.</div><div><br></div><div>2. Intermediate level</div><div><br></div><div>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.</div><div><br></div><div>3. High level</div><div><br></div><div>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.</div><div><br></div><div>  Thanks,</div><div><br></div><div>      Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>-sanjay</div><div><div dir="ltr" class="gmail_signature"><br></div></div></div>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!aMROjbrPD3RYXMpO8mIii7q8eXZX1uN-6F6-g_jcNLLXGCgYPt2JEDkIIQCHs_vNBhhxsiwQJaz57-FUThx2$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>