On Fri, Dec 11, 2009 at 3:40 PM, Ryan Yan <span dir="ltr"><<a href="mailto:vyan2000@gmail.com">vyan2000@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi All,<br>I am tring to understand the example in ksp tutorials ex29.c<br><a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/src/ksp/ksp/examples/tutorials/ex29.c.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/src/ksp/ksp/examples/tutorials/ex29.c.html</a><br>
<br>For the forcing terms of codes, <br><br>array[j][i] = PetscExpScalar(-((PetscReal)i*Hx)*((PetscReal)i*Hx)/user->nu)*PetscExpScalar(-((PetscReal)j*Hy)*((PetscReal)j*Hy)/user->nu)*Hx*Hy;<br><br>if ignoring the scaling, then it is actually calculating a forcing function: <br>
<br>f = e^{-( x)^2/\nu} e^{-( y)^2/\nu}, which is different with the one given in the comments of the code. Or did I miss somthing here?<br></blockquote><div><br>Yes, it appears the comment is in error.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
For the Dirichlet B.C.s, I did not understand the coefficients <a href="http://www.physicsforums.com/showthread.php?t=51412" target="_blank"><i></i></a>given below. Isn't correct to set the v[0]=Hx*Hy here?<br>
<pre width="80"><font size="4">if (i==0 || j==0 || i==mx-1 || j==my-1) {</font><br></pre>if (user->bcType == DIRICHLET) {<br> v[0] = 2.0*rho*(HxdHy + HydHx);<br> }<br>}<br></blockquote><div><br>This is the proper scaling.<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Also, for Nueman B.C.s, are we solving for du/dx+du/dy=0?<br></blockquote><div><br>Homogeneous Neumann conditions would be \hat n \cdot \nabla u = 0.<br>
<br> Matt<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Sorry for so many detail questions, and thank you very much for any suggestions.<br>
<font color="#888888"><br>Yan<br>
</font></blockquote></div><br><br clear="all"><br>-- <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>