On Fri, Mar 19, 2021 at 7:30 AM Lawrence Mitchell <wence@gmx.li> wrote:
> On 19 Mar 2021, at 03:51, Jed Brown <jed@jedbrown.org> wrote:
>
> 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.

I think there is a way to do this with plex (at least we do it), like so:

DMPlexGetOrdering(dm, MATORDERINGRCM, NULL, &isperm);

you might need to then invert this ordering.

Now when you make a section you either say

PetscSectionSetPermutation(section, isperm);

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

  DMPlexPermute()

  Thanks,

     Matt
 
before PetscSectionSetup(section);

or, if you're using DMPlexCreateSection, pass in the isperm

This gives RCM-based ordering for the dof numbering of the section.

Cheers,

Lawrence


--
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