<div dir="ltr"><div dir="ltr">On Fri, Aug 12, 2022 at 9:27 AM David Scott <<a href="mailto:d.scott@epcc.ed.ac.uk">d.scott@epcc.ed.ac.uk</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><div>On 12/08/2022 11:26, Matthew Knepley wrote:<br>
</div>
<blockquote type="cite">
<div style="background-color:rgb(255,242,230);border:2px dotted rgb(255,136,77)"><span style="font-size:12pt;font-family:sans-serif;color:black;font-weight:bold;padding:0.2em">This email was sent to you by someone outside the University.</span>
<div style="font-size:10pt;font-family:sans-serif;font-style:normal;padding:0.2em">
You should only click on links or attachments if you are certain that the email is genuine and the content is safe.</div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">On Fri, Aug 12, 2022 at 2:21 AM Quynh Nguyen <<a href="mailto:nguyenquynh9537@gmail.com" target="_blank">nguyenquynh9537@gmail.com</a>> wrote:<br>
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">Dear petsc developers and users,
<div><br>
</div>
<div>I am a new petsc user ^_^.</div>
<div>I have some questions about using DMDA_BOUNDARY_GHOSTED.</div>
<div><br>
</div>
<div>1. I have 2D Poisson code with domain (nx, ny), and I used DMDA_BOUNDARY_NONE, then the size of the matrix is (nx*ny)X(nx*ny).
<b><i>what is the size of the matrix if I used DMDA_BOUNDARY_GHOSTED? is it the same size as DMDA_BOUNDARY_NONE</i></b>?</div>
</div>
</blockquote>
<div><br>
</div>
<div>Yes, the matrix should be the same size, but local vectors have extra ghost node slots.</div>
<div> <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 dir="ltr">
<div>
<div>2. if the matrix size of DMDA_BOUNDARY_GHOSTED isn't the same as DMDA_BOUNDARY_NONE,
<b><i>how i can view the matrix including ghost points</i></b>? I ask this one because I used MatView(P, PETSC_VIEWER_STDOUT_WORLD) to show the matrix but excluded ghost points.</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Ghost nodes are there so that stencil operations on local vectors work at boundaries. You fill in the slots with boundary information.</div>
<div><br>
</div>
</div>
</div>
</div>
</blockquote>
I can see how this works if you are writing your own solver but can it be used with a KSP? In the case of periodic boundary conditions the boundary values are "filled in" for you by PETSc. Is there any way for a user to supply boundary information to a PETSc
solver when using DMDA_BOUNDARY_GHOSTED?<br></div></blockquote><div><br></div><div>Right now, there is not. This is mainly due to the lack of consensus for boundary condition specification. Periodic conditions are simple in this respect.</div><div><br></div><div>For example, Plex has such a thing</div><div><br></div><div> <a href="https://petsc.org/main/docs/manualpages/DM/DMAddBoundary/">https://petsc.org/main/docs/manualpages/DM/DMAddBoundary/</a></div><div><br></div><div>that can be used to fill in these constrained spots</div><div><br></div><div> <a href="https://petsc.org/main/docs/manualpages/DMPLEX/DMPlexInsertBoundaryValues/">https://petsc.org/main/docs/manualpages/DMPLEX/DMPlexInsertBoundaryValues/</a></div><div><br></div><div>But there have been many complaints about this interface (and I suspect any interface we choose).</div><div><br></div><div>Maybe there is something that we could write that would make it easier for you with DMDA?</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>
Thanks,<br>
<br>
David<br>
<br>
<blockquote type="cite">
<div>
<div dir="ltr">
<div class="gmail_quote">
<div></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 dir="ltr">
<div>
<div>I hope someone can explain my wonder :)</div>
<div><br>
</div>
<div>P/S: maybe, those question is simple and a bit stupid ^_^. </div>
<div><br>
</div>
<div>Have a nice day,</div>
<div><br>
</div>
-- <br>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div><span>Quynh Nguyen</span><br>
</div>
<div><font face="times new roman,
serif" color="#3d85c6"><span style="font-size:12.8px">Graduate student, Ocean Engineering.</span></font></div>
<div><font face="times new roman,
serif" color="#3d85c6"><span style="font-size:12.8px">School of Naval Architecture and Ocean Engineering, University of Ulsan.</span></font></div>
<div>
<div><font face="times new roman,
serif" color="#3d85c6">-----------------------------------------------------------------------------------------</font></div>
<div><font face="times new roman,
serif" color="#3d85c6">Mobile: (+82) 010-9394-5595 </font></div>
<div><font face="times new roman,
serif" color="#3d85c6">Email:
<a href="mailto:nguyenquynh9537@gmail.com" target="_blank">
nguyenquynh9537@gmail.com</a>; <a href="mailto:nguyenthiquynhb_t58@hus.edu.vn" target="_blank">
nguyenthiquynhb_t58@hus.edu.vn</a></font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr">
<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>
</div>
</blockquote>
<br>
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. Is e buidheann carthannais a th’ ann an Oilthigh Dhùn Èideann, clàraichte an Alba, àireamh clàraidh SC005336.
</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>