<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
On 18-02-16 10:13 AM, Matthew Knepley wrote:<br>
<blockquote type="cite"
cite="mid:CAMYG4GmrwyrU7CHiLCDP2QgOesUEV2_ZDK6BHkkDKiQMm0ofyw@mail.gmail.com">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Fri, Feb 16, 2018 at 11:36 AM,
Danyang Su <span dir="ltr"><<a
href="mailto:danyang.su@gmail.com" target="_blank"
moz-do-not-send="true">danyang.su@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p>On 18-02-15 05:57 PM, Matthew Knepley wrote:<br>
</p>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Thu, Feb 15, 2018 at
7:40 PM, Danyang Su <span dir="ltr"><<a
href="mailto:danyang.su@gmail.com"
target="_blank" moz-do-not-send="true">danyang.su@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0
0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">Hi Matt,<br>
<br>
I have a question on DMPlexCreateFromCellList
and DMPlexCreateFromFile. When use
DMPlexCreateFromFile with Gmsh file input, it
works fine and each processor gets its own
part. However, when use
DMPlexCreateFromCellList, all the processors
have the same global mesh. To my understand, I
should put the global mesh as input, right?</blockquote>
<div><br>
</div>
<div>No. Each process should get part of the
mesh in CreateFromCellList(), but the most
common thing to do is to</div>
<div>feed the whole mesh in on proc 0, and
nothing in on the other procs.</div>
</div>
</div>
</div>
</blockquote>
Thanks for the explanation. It works now.<br>
</div>
</blockquote>
<div><br>
</div>
<div>Great. Also feel free to suggest improvements,
examples, or better documentation.</div>
</div>
</div>
</div>
</blockquote>
Thanks, I will bother you a lot recently while porting the code from
structured grid version to unstructured grid version. Thanks in
advance.<br>
Danyang<br>
<blockquote type="cite"
cite="mid:CAMYG4GmrwyrU7CHiLCDP2QgOesUEV2_ZDK6BHkkDKiQMm0ofyw@mail.gmail.com">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<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">
<div text="#000000" bgcolor="#FFFFFF"> Danyang<br>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<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"> Otherwise, I should
use DMPlexCreateFromCellListParall<wbr>el
instead if the input is local mesh.<br>
<br>
Below is the test code I use, results from
method 1 is wrong and that from method 2 is
correct. Would you please help to check if I
did anything wrong with
DMPlexCreateFromCellList input?<br>
<br>
!test with 4 processor, global num_cells =
8268, global num_nodes = 4250<br>
<br>
!correct results<br>
<br>
check rank 2 istart 2034
iend 3116<br>
check rank 3 istart 2148
iend 3293<br>
check rank 1 istart 2044
iend 3133<br>
check rank 0 istart 2042
iend 3131<br>
<br>
!wrong results<br>
<br>
check rank 0 istart
8268 iend 12518<br>
check rank 1 istart
8268 iend 12518<br>
check rank 2 istart
8268 iend 12518<br>
check rank 3 istart
8268 iend 12518<br>
<br>
<br>
!c ************* test part
*********************<br>
!c method 1: create DMPlex from cell
list, same duplicated global meshes over all
processors<br>
!c the input parameters num_cells,
num_nodes, dmplex_cells, dmplex_verts are all
global parameters (global mesh data)<br>
call DMPlexCreateFromCellList(Petsc<wbr>_Comm_World,ndim,num_cells,
&<br>
num_nodes,num_nodes_per_cell, <wbr> &<br>
Petsc_True,dmplex_cells,ndim, <wbr> &<br>
dmplex_verts,dmda_flow%da,ierr<wbr>)<br>
CHKERRQ(ierr)<br>
<br>
<br>
!c method 2: create DMPlex from Gmsh
file, for test purpose, this works fine, each
processor gets its own part<br>
call DMPlexCreateFromFile(Petsc_Com<wbr>m_World,
&<br>
prefix(:l_prfx)//'.msh',0, <wbr>
&<br>
<wbr>
dmda_flow%da,ierr)<br>
CHKERRQ(ierr)<br>
<br>
!c *************end of test
part*********************<br>
<br>
<br>
distributedMesh = PETSC_NULL_OBJECT<br>
<br>
!c distribute mesh over processes<br>
call DMPlexDistribute(dmda_flow%da,<wbr>0,PETSC_NULL_OBJECT,
&<br>
distributedMesh,ierr)<br>
CHKERRQ(ierr)<br>
<br>
!c destroy original global mesh after
distribution<br>
if (distributedMesh /=
PETSC_NULL_OBJECT) then<br>
call DMDestroy(dmda_flow%da,ierr)<br>
CHKERRQ(ierr)<br>
!c set the global mesh as distributed
mesh<br>
dmda_flow%da = distributedMesh<br>
end if<br>
<br>
!c get coordinates<br>
call DMGetCoordinatesLocal(dmda_flo<wbr>w%da,gc,ierr)<br>
CHKERRQ(ierr)<br>
<br>
call DMGetCoordinateDM(dmda_flow%da<wbr>,cda,ierr)<br>
CHKERRQ(ierr)<br>
<br>
call DMGetDefaultSection(cda,cs,ier<wbr>r)<br>
CHKERRQ(ierr)<br>
<br>
call PetscSectionGetChart(cs,istart<wbr>,iend,ierr)<br>
CHKERRQ(ierr)<br>
<br>
#ifdef DEBUG<br>
if(info_debug > 0) then<br>
write(*,*) "check rank ",rank,"
istart ",istart," iend ",iend<br>
end if<br>
#endif<br>
<br>
<br>
Thanks and regards,<br>
<br>
Danyang<br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<span class="HOEnZb"><font color="#888888">
<div><br>
</div>
-- <br>
<div
class="m_8969951643934544237gmail_signature"
data-smartmail="gmail_signature">
<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.caam.rice.edu/%7Emk51/"
target="_blank"
moz-do-not-send="true">https://www.cse.buffalo.edu/~<wbr>knepley/</a><br>
</div>
</div>
</div>
</div>
</div>
</font></span></div>
</div>
</blockquote>
<br>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature" data-smartmail="gmail_signature">
<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.caam.rice.edu/%7Emk51/"
target="_blank" moz-do-not-send="true">https://www.cse.buffalo.edu/~knepley/</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>