<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 12, 2022, at 9:27 AM, David Scott <<a href="mailto:d.scott@epcc.ed.ac.uk" class="">d.scott@epcc.ed.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class="moz-cite-prefix" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">On 12/08/2022 11:26, Matthew Knepley wrote:<br class=""></div><blockquote type="cite" cite="mid:CAMYG4GkAywr933zE2XtMWd=0DqbjxH7BtmixijF1mp1AnBx-Pg@mail.gmail.com" style="font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div style="background-color: rgb(255, 242, 230); border: 2px dotted rgb(255, 136, 77);" class=""><span style="font-size: 12pt; font-family: sans-serif; font-weight: bold; padding: 0.2em;" class="">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;" class="">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 class=""><div dir="ltr" class=""><div dir="ltr" class="">On Fri, Aug 12, 2022 at 2:21 AM Quynh Nguyen <<a href="mailto:nguyenquynh9537@gmail.com" moz-do-not-send="true" class="moz-txt-link-freetext">nguyenquynh9537@gmail.com</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class="">Dear petsc developers and users,<div class=""><br class=""></div><div class="">I am a new petsc user ^_^.</div><div class="">I have some questions about using DMDA_BOUNDARY_GHOSTED.</div><div class=""><br class=""></div><div class="">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).<span class="Apple-converted-space"> </span><b class=""><i class="">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 class=""><br class=""></div><div class="">Yes, the matrix should be the same size, but local vectors have extra ghost node slots.</div><div class=""> <br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class=""><div class=""><div class="">2. if the matrix size of DMDA_BOUNDARY_GHOSTED isn't the same as DMDA_BOUNDARY_NONE,<span class="Apple-converted-space"> </span><b class=""><i class="">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 class=""><br class=""></div><div class="">Ghost nodes are there so that stencil operations on local vectors work at boundaries. You fill in the slots with boundary information.</div><div class=""><br class=""></div></div></div></div></blockquote><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">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?</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""></div></blockquote><div><br class=""></div> It is up to you to determine what values to put into those locations and put them in before you apply your "stencil" computation to evaluate the residual. You just stick values in those locations, likely after doing a DMDAVecGetArray().</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Thanks,</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">David</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" cite="mid:CAMYG4GkAywr933zE2XtMWd=0DqbjxH7BtmixijF1mp1AnBx-Pg@mail.gmail.com" style="font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div class=""></div><div class="">  Thanks,</div><div class=""><br class=""></div><div class="">     Matt</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class=""><div class=""><div class="">I hope someone can explain my wonder :)</div><div class=""><br class=""></div><div class="">P/S: maybe, those question is simple and a bit stupid ^_^. </div><div class=""><br class=""></div><div class="">Have a nice day,</div><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class=""><span style="color: rgb(61, 133, 198);" class="">Quynh Nguyen</span><br class=""></div><div class=""><font face="times new roman,
                                      serif" color="#3d85c6" class=""><span style="font-size: 12.8px;" class="">Graduate student, Ocean Engineering.</span></font></div><div class=""><font face="times new roman,
                                      serif" color="#3d85c6" class=""><span style="font-size: 12.8px;" class="">School of Naval Architecture and Ocean Engineering, University of Ulsan.</span></font></div><div class=""><div class=""><font face="times new roman,
                                        serif" color="#3d85c6" class="">-----------------------------------------------------------------------------------------</font></div><div class=""><font face="times new roman,
                                        serif" color="#3d85c6" class="">Mobile: (+82) 010-9394-5595 </font></div><div class=""><font face="times new roman,
                                        serif" color="#3d85c6" class="">Email:<span class="Apple-converted-space"> </span><a href="mailto:nguyenquynh9537@gmail.com" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">nguyenquynh9537@gmail.com</a>;<span class="Apple-converted-space"> </span><a href="mailto:nguyenthiquynhb_t58@hus.edu.vn" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">nguyenthiquynhb_t58@hus.edu.vn</a></font></div></div></div></div></div></div></div></div></div></div></div></div></blockquote></div><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div dir="ltr" class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div><div class=""><br class=""></div><div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" moz-do-not-send="true" class="">https://www.cse.buffalo.edu/~knepley/</a><br class=""></div></div></div></div></div></div></div></div></div></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">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.</span></div></blockquote></div><br class=""></body></html>