<div dir="ltr"><div class="gmail_extra">On Thu, Jan 3, 2013 at 10:17 AM, David Scott <span dir="ltr"><<a href="mailto:d.scott@ed.ac.uk" target="_blank">d.scott@ed.ac.uk</a>></span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div id=":25w">I wish to set boundary values in a structured grid. How do I do this if I am using DMDA_BOUNDARY_GHOSTED? I thought that I should set the boundary values in the function specified by a call to DMSetInitialGuess but it appears to be passed a global vector.<br>
</div></blockquote><div><br></div><div style>The local vector has that extra space. Scatter to the local vector as usual, then fill them up.</div><div style><br></div><div style>Alternatively, use a *SetFunctionLocal() so that you start out with a local vector.</div>
<div style><br></div><div style><a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/DMDASNESSetFunctionLocal.html">http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/DMDASNESSetFunctionLocal.html</a></div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div id=":25w">
<br>
I would prefer any example code to be in Fortran but that is not essential.</div></blockquote></div><br></div></div>