Hi Barry, <div>Since the ex32.c has been brought up to make comparison with ex29.c. Can I just get a confirm that, in ex29.c, the instance with Neumann B.C.s is the case where one has cell centered unknown for the u, with vertex centered f.</div>
<div><br></div><div>Feel free to criticize this comment please, and this is where I get very confused.</div><div><br></div><div>Thanks,</div><div><br></div><div>Yan</div><div><br></div><div><br><br><div class="gmail_quote">
On Sat, Dec 12, 2009 at 2:57 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On Dec 12, 2009, at 12:31 PM, Tahar Amari wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
SOrry. I took this very interesting discussion a bit late, but one of my major problem is to understand if all this is valid for node centered<br>
variables for u or cell centered.<br>
Usually the best way of solving Neuwman BC for this equation is having cell centered unknowns to have derivatives<br>
given on the domain boundary.<br>
This then have some impact on handling ghost values transfer between subdomains with MPI.Is all this transparent for<br>
us and PETSC handle it . I guess no, right ?<br>
</blockquote>
<br></div>
If you have only cell centered unknowns the ghost point updates are the same. See src/ksp/ksp/examples/tutorials/ex32.c Having some Neuman and some Dirichlet boundary conditions is then trickery with cell centered.<br>
<br>
If you have some cell-centered and some vertex centered unknowns (staggered grid), DA does not handle this well, you have to "cheat" to match up variables on the cells and vertices.<br><font color="#888888">
<br>
<br>
Barry</font><div><div></div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Tahar<br>
<br>
<br>
Le 12 déc. 09 à 02:28, Barry Smith a écrit :<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On Dec 11, 2009, at 7:18 PM, Ryan Yan wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Matt,<br>
Thank you very much for the reply. Now, I got the Neumann part. But I am still a bit confused about the Dirichlet part. Please see the following quote.<br>
<br>
Yan<br>
<br>
<br>
For the Dirichlet B.C.s, I did not understand the coefficients given below. Isn't correct to set the v[0]=Hx*Hy here?<br>
if (i==0 || j==0 || i==mx-1 || j==my-1) {<br>
if (user->bcType == DIRICHLET) {<br>
v[0] = 2.0*rho*(HxdHy + HydHx);<br>
}<br>
}<br>
<br>
This is the proper scaling.<br>
<br>
the Dirichlet B.C.s:<br>
Which scaling do you think is proper, "v[0]=Hx*Hy" or 2.0*rho*(HxdHy + HydHx)?<br>
If it is 2.0*rho*(HxdHy + HydHx), can you say a little bit more about why is this one? I only see a factor of Hx*Hy when we set up the RHS. Did I miss something?<br>
<br>
</blockquote>
Ryan,<br>
<br>
You can scale the equations for Dirichlet boundary conditions anyway you want; you could multiply them by 1,000,000 if you want. The answer in exact precision with direct solvers will be the same. The reason we use the given scaling is to make the scaling work well with multigrid. If you use a different scaling the Dirichlet boundary conditions on the coarser grid matrices would have a different scaling then the interior equations and this would slow down MG's convergence rate. For toy problems people usually eliminate the Dirichlet boundary conditions, then there is no scaling issue for multigrid.<br>
<br>
<br>
Barry<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Matt<br>
<br>
<br>
<br>
<br>
<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>
<br>
</blockquote></blockquote>
<br>
--------------------------------------------<br>
T. Amari<br>
Centre de Physique Theorique<br>
Ecole Polytechnique<br>
91128 Palaiseau Cedex France<br>
tel : 33 1 69 33 42 52<br>
fax: 33 1 69 33 49 49<br>
email: <mailto:<a href="mailto:amari@cpht.polytechnique.fr" target="_blank">amari@cpht.polytechnique.fr</a>><br>
URL : <a href="http://www.cpht.polytechnique.fr/cpht/amari" target="_blank">http://www.cpht.polytechnique.fr/cpht/amari</a><br>
<br>
<br>
<br>
<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br></div>