Thanks, Matt. I thought there is a ghosted grid around Dirichlet and Neumann BC's. ^_^<div><br></div><div>best,</div><div>Alan<br><br><div class="gmail_quote">On Fri, Sep 2, 2011 at 7:14 AM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com">knepley@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 class="im">On Thu, Sep 1, 2011 at 9:47 PM, Alan Wei <span dir="ltr"><<a href="mailto:zhenglun.wei@gmail.com" target="_blank">zhenglun.wei@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear All,
<div> I hope you're having a nice day. </div><div> I'm still working on this Poisson solver example, and I still have a little confusion on the boundary condition. I wonder if I have a 17*17 grid. (index i = 0~16 and j = 0~16, solving for variable 'u')</div>
<div>1) If a Dirichlet BC applied on the left boundary, i.e. u= 1, is that all values with u[i= 0][] = 1 or with u[i= -1][] = 1 (where, u[i=-1][] are ghost grids left next to grid of u[i= 0][]).</div></blockquote><div>
<br></div></div><div>Unless you define the boundary as PERIODIC or GHOSTED, the -1 does not exist. I set Dirichlet conditions at 0 and M-1.</div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div>2) If a Neumann BC applied on the right boundary, i.e. du/dx = 0, is that (u[i=16][]-u[i=15][])/dx= or (u[i=17][]-u[i=16][])/dx = 0 (where u[i =17][] are ghost grids right next to grid of u[i = 16][]).</div>
<div> Thank you so much.</div></div></blockquote><div><br></div></div><div>Same answer.</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><div>best,</div><div>Alan</div><div><br></div></div>
</blockquote></div><font color="#888888"><br><br clear="all"><div><br></div>-- <br>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<br>
</font></blockquote></div><br></div>