[petsc-users] Neumann BC in src/ksp/ksp/example/tutorial/ex29.c

Alan Wei zhenglun.wei at gmail.com
Thu Sep 1 16:47:21 CDT 2011


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][]).
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.

best,
Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110901/adbeecac/attachment.htm>


More information about the petsc-users mailing list