[petsc-users] [petsc-maint] Fwd: DMPlex global to natural problem using DmPlexGetVertexNumbering or DMPlexGlobalToNatural
Matthew Knepley
knepley at gmail.com
Thu Nov 29 20:13:56 CST 2018
On Thu, Nov 29, 2018 at 7:40 PM Danyang Su via petsc-maint <
petsc-maint at mcs.anl.gov> wrote:
> Dear PETSc developers & users,
>
> Sorry to bother you again. I just encounter some difficulties in DMPlex
> global to natural order. This is not the very necessary function in my
> code. But it's best to have it in case someone wants to feed code with
> initial conditions or parameters from external file using natural ordering.
>
> First I tried to use DmPlexGetVertexNumbering which seems pretty
> straightforward, but I always get error saying "You need a ISO C
> conforming compiler to use the glibc headers". I use Gfortran on Linux.
>
> Then I switched to use Label to save global-natural order before
> distributing the mesh, everything works fine. The only problem is that
> it takes a very long time during mesh distribution when the size of mesh
> is very big.
>
> Finally I tried to use GlobalToNatural ordering. Set Natural order to
> TRUE before calling DMPlexDistribute and then call DMPlexSetMigrationSF.
> However, the function DMPlexGlobalToNaturalEnd seems doing nothing as
> the returned vector is always unchanged. I got some help from Josh who
> has done similar work before. But I still cannot figure out what is
> wrong in the code.
>
Can you run the example that Blaise recommended? Sometimes its easiest to
start
with an example and change it into your code.
Thanks,
Matt
> Attached is the code section with related functions included, together
> with a mesh and output of global vector and natural vector. If something
> is wrong in the code, it should be in these four functions. The related
> functions are called in the following order.
>
> call solver_dd_create_dmplex
>
> call solver_dd_mapping_set_dmplex
>
> call solver_dd_DMDACreate_flow
>
> !call solver_dd_DMDACreate_react Not used in current testing
>
> call solver_dd_mapping_global_natural
>
> I really appreciate your help.
>
> Regards,
>
> Danyang
>
>
--
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://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20181129/727b2d46/attachment.html>
More information about the petsc-users
mailing list