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">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><br><br>For the Dirichlet B.C.s, I did not understand the coefficients <a href="http://www.physicsforums.com/showthread.php?t=51412" class="l" onmousedown="return rwt(this,'','','res','1','AFQjCNFzOds6gizwCqxa-6u77HVz_Rq4ZQ','&sig2=BHFLEqQkJW-OyQ65i9A6zA','0CAsQFjAA')"><em></em></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><br>Also, for Nueman B.C.s, are we solving for du/dx+du/dy=0?<br>
<br>Sorry for so many detail questions, and thank you very much for any suggestions.<br><br>Yan<br>