<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Nov 29, 2018 at 7:40 PM Danyang Su via petsc-maint <<a href="mailto:petsc-maint@mcs.anl.gov">petsc-maint@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear PETSc developers & users,<br>
<br>
Sorry to bother you again. I just encounter some difficulties in DMPlex <br>
global to natural order. This is not the very necessary function in my <br>
code. But it's best to have it in case someone wants to feed code with <br>
initial conditions or parameters from external file using natural ordering.<br>
<br>
First I tried to use DmPlexGetVertexNumbering which seems pretty <br>
straightforward, but I always get error saying "You need a ISO C <br>
conforming compiler to use the glibc headers". I use Gfortran on Linux.<br>
<br>
Then I switched to use Label to save global-natural order before <br>
distributing the mesh, everything works fine. The only problem is that <br>
it takes a very long time during mesh distribution when the size of mesh <br>
is very big.<br>
<br>
Finally I tried to use GlobalToNatural ordering. Set Natural order to <br>
TRUE before calling DMPlexDistribute and then call DMPlexSetMigrationSF. <br>
However, the function DMPlexGlobalToNaturalEnd seems doing nothing as <br>
the returned vector is always unchanged. I got some help from Josh who <br>
has done similar work before. But I still cannot figure out what is <br>
wrong in the code.<br></blockquote><div><br></div><div>Can you run the example that Blaise recommended? Sometimes its easiest to start</div><div>with an example and change it into your code.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Attached is the code section with related functions included, together <br>
with a mesh and output of global vector and natural vector. If something <br>
is wrong in the code, it should be in these four functions. The related <br>
functions are called in the following order.<br>
<br>
call solver_dd_create_dmplex<br>
<br>
call solver_dd_mapping_set_dmplex<br>
<br>
call solver_dd_DMDACreate_flow<br>
<br>
!call solver_dd_DMDACreate_react Not used in current testing<br>
<br>
call solver_dd_mapping_global_natural<br>
<br>
I really appreciate your help.<br>
<br>
Regards,<br>
<br>
Danyang<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="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>