On 18-11-29 06:13 PM, Matthew Knepley wrote:
On Thu, Nov 29, 2018 at 7:40 PM Danyang Su via petsc-maint <petsc-ma...@mcs.anl.gov <mailto:petsc-ma...@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.
I cannot compile ex26 due to missing exodusII.h file. Error information is
make ex26
/home/dsu/Soft/PETSc/petsc-3.10.2/linux-gnu-dbg/bin/mpicc -o ex26.o -c -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -fstack-protector -fvisibility=hidden -g3 -I/home/dsu/Soft/PETSc/petsc-3.10.2/include -I/home/dsu/Soft/PETSc/petsc-3.10.2/linux-gnu-dbg/include `pwd`/ex26.c /home/dsu/Soft/PETSc/petsc-3.10.2/src/dm/impls/plex/examples/tests/ex26.c:10:22: fatal error: exodusII.h: No such file or directory
compilation terminated.
/home/dsu/Soft/PETSc/petsc-3.10.2/lib/petsc/conf/rules:359: recipe for target 'ex26.o' failed

Anyway, I will look at this example to get familiar with GlobalToNatural related functions.

Thanks,

Danyang


  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/%7Eknepley/>

Reply via email to