<div dir="ltr"><div dir="ltr">On Fri, Mar 19, 2021 at 7:30 AM Lawrence Mitchell <<a href="mailto:wence@gmx.li">wence@gmx.li</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> On 19 Mar 2021, at 03:51, Jed Brown <<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>> wrote:<br>
> <br>
> It's a notable weakness of DMPlex that it does not apply such an ordering of dofs and I've complained to Matt about it many times over the years, but any blame rests solely with me for not carving out time to implement it here.<br>
<br>
I think there is a way to do this with plex (at least we do it), like so:<br>
<br>
DMPlexGetOrdering(dm, MATORDERINGRCM, NULL, &isperm);<br>
<br>
you might need to then invert this ordering.<br>
<br>
Now when you make a section you either say<br>
<br>
PetscSectionSetPermutation(section, isperm);<br></blockquote><div><br></div><div>You can do that if you only want to permute the dofs, but usually I want to reorder everything so that any Section comes out right</div><div><br></div><div>  DMPlexPermute()</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">
before PetscSectionSetup(section);<br>
<br>
or, if you're using DMPlexCreateSection, pass in the isperm<br>
<br>
This gives RCM-based ordering for the dof numbering of the section.<br>
<br>
Cheers,<br>
<br>
Lawrence</blockquote></div><br clear="all"><div><br></div>-- <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="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>