<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Jan 17, 2019 at 9:39 PM leejearl <<a href="mailto:leejearl@mail.nwpu.edu.cn">leejearl@mail.nwpu.edu.cn</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="text-align:left;direction:ltr"><div>Hi, Matt,</div><div>On Thu, 2019-01-17 at 21:20 -0500, Matthew Knepley wrote:<br></div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Jan 17, 2019 at 9:04 PM leejearl <<a href="mailto:leejearl@mail.nwpu.edu.cn" target="_blank">leejearl@mail.nwpu.edu.cn</a>> wrote:<br></div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div style="text-align:left;direction:ltr"><div>Hi Matt,</div><div>     Thanks for your reply.  We have got to a consensus. For such a problem, I have sought the mail list for helps and found a great </div><div>many misleading answers. I think some of answers may work for the DMDA. Now I have overcome this </div><div>by creating a PetscSF and PetscSFBcast, and the procedures are described as follow.</div><div><br></div><div><br></div><div>1. Using DMGLobaltoLocal to update the local vector(the ghost cell mighb get the wrong result)</div><div>2. Creating a PetscSF which matches the local ghost cell and the global donor cell across the processes</div><div>3. Using PetscSFBCast to update the local ghost cell</div><div><br></div><div>Now, my code can work. Can you give me a more scalable procedure?</div></div><br></blockquote><div><br></div><div>That is a scalable procedure. I do not do it that way because it requires more steps than just meshing the structure directly.</div></div></div></blockquote><div><br></div><div><div>You are right. You have said that the more efficient way is to meshing the structure directly. It means that we have better to generate </div><div>a mesh with periodic topology structure. Is it right?</div></div></div></blockquote><div><br></div><div>Just to be clear, your method is perfectly fine. Mine is not more efficient. I just think its easier.</div><div>You can see periodic meshes generated using DMPlexCreateBoxMesh().</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="text-align:left;direction:ltr"><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div>  Thanks,</div><div><br></div><div>    Matt</div><div> </div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div style="text-align:left;direction:ltr"><div>Thanks.</div><div><br></div><div>On Thu, 2019-01-17 at 06:43 -0500, Matthew Knepley wrote:</div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Jan 17, 2019 at 3:34 AM leejearl via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<br></div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex">Hi all Petscer,<br>
        I have ask helps for some questions. Thanks for the replies<br>
from developer. I have known more about the petsc. I have also sought<br>
helps in the mail lists, and I find that there are many subjects<br>
focused on such a problem. Some subjects are listed as follow<br>
<br>
<br>
<a href="https://lists.mcs.anl.gov/pipermail/petsc-users/2019-January/037425.html" rel="noreferrer" target="_blank">https://lists.mcs.anl.gov/pipermail/petsc-users/2019-January/037425.html</a><br>
,<br>
<br>
<br>
<a href="https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2015-January/024068.html" rel="noreferrer" target="_blank">https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2015-January/024068.html</a><br>
,<br>
<br>
<br>
<a href="https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2008-November/003633.html" rel="noreferrer" target="_blank">https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2008-November/003633.html</a><br>
,<br>
<br>
<br>
<a href="https://lists.mcs.anl.gov/pipermail/petsc-users/2019-January/037436.html" rel="noreferrer" target="_blank">https://lists.mcs.anl.gov/pipermail/petsc-users/2019-January/037436.html</a><br>
<br>
......<br>
<br>
The problem can be summarized as<br>
1. Getting the value of vector from other processor<br>
2. How to set the value of ghost cell, the value of the ghost cell<br>
might be as same as a very cell in other processor. <br>
<br>
I think the above problem is very popular. I suffer such a problem when<br>
I want to treat the periodic boundary for the FVM method.<br></blockquote><div><br></div><div>Ah, I think I am now seeing the problem. In DMPlex, we do not implement</div><div>periodicity of the mesh by putting in extra communication. We make a</div><div>periodic mesh directly. For example, in 1D what you describe would mesh</div><div>a line segment, and then communicate the values from one end to the other.</div><div>Instead, in Plex we just mesh a circle.</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt</div><div> </div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"> After the dm<br>
object is distributed, the donor cell of bound might be in other<br>
processor. Since the donor cell must be matched as a pair correctly,<br>
using the routines DMGlobaltoLocal and DMLocaltoGlobal can not get the<br>
expected results. <br>
<br>
In fact, such a problem is not very difficult for a mpi program. But we<br>
are coding with the petsc, we always think that whether we can<br>
implement more easily.<br>
<br>
Whether our developer can create a demo for us to following. I think<br>
such a demo is very useful for user.<br>
<br>
Thanks<br>
<br>
leejeal<br>
<br>
<br>
<br>
<br>
<br>
</blockquote></div><br clear="all"><div><br></div></div></blockquote><div><span><pre><br></pre></span></div></div>
</blockquote></div><br clear="all"><div><br></div></div></blockquote><div>Thanks</div><div>leejearl</div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="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>