[petsc-dev] A small bug

Adam Rose arose at txcorp.com
Thu Jul 19 12:59:01 CDT 2012


To whom it may concern,

I believe that I've found a small error in some example code located in $PETSC_DIR/src/ksp/ksp/examples/tutorials/ex45.c, and I just wanted to bring it to your attention.  It's a Laplace equation equation example with Dirichlet boundary conditions u=1 on the square [0,1]x[0,1], but on running the program I noticed that the boundary condition wasn't consistent with the solution.  This seems due to line 119 which sets the diagonal values of our discretization matrix in the case of boundary points.  It currently reads "v[0] = 2.0*(HxHydHz + HxHzdHy + HyHzdHx);" which is the same as the diagonal away from the boundary, but a quick change to "v[0] = Hx*Hy*Hz;" produces the desired result.

Thanks for reading,
Adam Rose (Intern, Tech-X Corporation)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120719/d657eaf8/attachment.html>


More information about the petsc-dev mailing list