Thanks, Matt. I thought there is a ghosted grid around Dirichlet and Neumann BC's. ^_^
best, Alan On Fri, Sep 2, 2011 at 7:14 AM, Matthew Knepley <knepley at gmail.com> wrote: > On Thu, Sep 1, 2011 at 9:47 PM, Alan Wei <zhenglun.wei at gmail.com> wrote: > >> Dear All, >> I hope you're having a nice day. >> 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') >> 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][]). >> > > Unless you define the boundary as PERIODIC or GHOSTED, the -1 does not > exist. I set Dirichlet conditions at 0 and M-1. > > >> 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][]). >> Thank you so much. >> > > Same answer. > > Matt > > >> best, >> Alan >> >> > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110902/bdf62f14/attachment.htm>
