[petsc-dev] DMPlex with vertical numbering?
Matthew Knepley
knepley at gmail.com
Fri Nov 8 08:40:42 CST 2013
On Thu, Nov 7, 2013 at 11:30 AM, Michael Lange <michael.lange at imperial.ac.uk
> wrote:
> Hi,
>
> I am trying to integrate an application code with DMPlex and I'm hitting
> the following problem: The application code requires owned and ghost DoFs
> to be numbered contiguously, whereas DMPlex numbers them by entity class,
> so that the vertex dofs and edge dofs are disjoint. In order to get around
> this problem I am trying to re-order the DMPlex object vertically by using
> DMPlexPermute() with a custom mapping such that the closure of cells is
> numbered contiguously (except for repeated sieve points). This, however,
> causes DMPlexCreateSection() to create wrong sections, because the
> depth/height strata are not contiguous anymore; although I can create the
> appropriate section from the original DMPlex and permute it with the same
> mapping to get the correct section. From this I am now trying to extract
> the appropriate information for my halo exchange via the DefaultSF and the
> LocalToGlobalMap, and what I was wondering is:
>
> 1) Is there an easy way to re-create the appropriate DefaultSF and
> LocalToGlobalMap after the permutation, since these are ignored in
> DMPlexPermute()?
>
> 2) Is it possible to use DMLabelGetStratumIS with the "depth" label
> instead of DMPlexGetDepthStratum in DMPlexCreateSection() in order to make
> this work with a vertically numbered DMPlex?
>
There is a misunderstanding here. You are confusing point numbering, which
is what is in DMPlex and what is modified by
DMPlexPermute, and dof numbering, which is handled by PetscSection. The
point numbering was originally arbitrary, which
made the code complex and slow. I don't think that the stratified scheme
will change.
However, I think all you need to interface with your legacy code is to
change the PetscSection ordering. This is fairly simple.
Right now, you set sizes and PetscSectionSetUp() calculated offsets, but
nothing in the code assumes that the offsets are
strictly ordered. Thus, you can just recalculate the offsets traversing
along your permuted ordering and calling PetscSectionSetOffset().
Does this make sense?
Thanks,
Matt
> Kind regards,
>
> Michael Lange
>
--
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20131108/47ddfb89/attachment.html>
More information about the petsc-dev
mailing list