On Mon, Feb 20, 2012 at 2:05 PM, Max Rudolph <span dir="ltr">&lt;<a href="mailto:rudolph@berkeley.edu">rudolph@berkeley.edu</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Hi Dave,<div><span style="white-space:pre-wrap">        </span>Thanks for your help. </div><div><br></div><div>Max<br><div><div class="im"><div><br></div><blockquote type="cite"><span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium">Hey Max,<br>
<br>Without knowing anything about the specific application related to<br>your Stokes problem, or information about the mesh you are using, I<br>have a couple of questions and suggestions which might help.<br></span></blockquote>
<div><br></div></div><div>The test case that I am working with is isoviscous convection, benchmark case 1a from Blankenbach 1989.</div><div class="im"><br><blockquote type="cite"><span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium">1) If  A, is your stokes operator A = ( K,B ; B^T, 0 ), what is your<br>
precondition operator?<br>Specifically, what is in the (2,2) slot in the precondioner? - i.e.<br>what matrix are you you applying -stokes_fieldsplit_1_pc_type jacobi<br>-stokes_fieldsplit_1_ksp_type preonly to?<br>Is it the identity as in the SpeedUp notes?<br>
</span></blockquote><div><br></div></div><div>I think that this is the problem. The (2,2) slot in the LHS matrix is all zero (pressure does not appear in the continuity equation), so I think that the preconditioner is meaningless. I am still confused as to why this choice of preconditioner was suggested in the tutorial, and what is a better choice of preconditioner for this block? Should I be using one of the Schur complement methods instead of the additive or multiplicative field split?</div>
</div></div></div></blockquote><div><br></div><div>Its not suggested, it is demonstrated. Its the first logical choice, since Jacobi gives the identity for a 0 block (see <a href="http://www.jstor.org/pss/2158202">http://www.jstor.org/pss/2158202</a>). Its</div>
<div>not meaningless. All the better preconditioners involve either a Schur complement (also shown in the tutorial), or an auxiliary operator which is more</div><div>difficult to setup and thus not shown.</div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><div class="im"><blockquote type="cite"><span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium">2) This choice<br>
-stokes_fieldsplit_0_pc_type ml -stokes_fieldsplit_0_ksp_type preonly<br>may simply not be a very effective and degrade the performance of the<br>outer solver.<br>I&#39;d make the solver for the operator in the (1,1) slot much stronger,<br>
for example<br> -stokes_fieldsplit_0_ksp_type gmres<br> -stokes_fieldsplit_0_ksp_rtol 1.0e-4<br> -stokes_fieldsplit_0_mg_levels_ksp_type gmres<br> -stokes_fieldsplit_0_mg_levels_pc_type bjacobi<br> -stokes_fieldsplit_0_mg_levels_ksp_max_it 4<br>
<br>Add a monitor on this solver (-stokes_fieldsplit_0_ksp_XXX) to see how<br>ML is doing.<br><br>3) Using -stokes_pc_fieldsplit_type MULTIPLICATIVE should reduce the<br>number of outer iterations by a factor of two, but it will use more<br>
memory.</span></blockquote><blockquote type="cite"><span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium">4) You should use a flexible Krylov method on the outer most solve<br>
(-stokes_ksp_XXX) as the preconditioner is varying between each outer<br>iteration. Use -stokes_ksp_type fgmres or -stokes_ksp_type gcr<br></span></blockquote><div><br></div></div><div>Thanks for pointing this out. I made that change.</div>
<div class="im"><br><blockquote type="cite"><span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium">5) Depending on how the physical problem is scaled<br>
(non-dimensionalised), the size of the residuals associated with the<br>momentum and continuity equation make be quite different. You are<br>currently use the entire residual from (u,p) to determine when to stop<br>iterating. You might want to consider writing a monitor which examines<br>
the these residuals independently.<br></span></blockquote><div><br></div></div><div>I think that I have scaled the problem correctly. I (slowly) obtain a sufficiently accurate solution using as options only:</div><div>-stokes_ksp_atol 1e-5 -stokes_ksp_rtol 1e-5 -stokes_ksp_monitor_true_residual -stokes_ksp_norm_type UNPRECONDITIONED</div>
</div></div></div></blockquote><div><br></div><div>How do you know the problem is scaled correctly? Have you looked at norms of the residuals for the two systems?</div><div><br></div><div>  Thanks,</div><div><br></div><div>
     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><blockquote type="cite">Cheers,<br> Dave</blockquote>
</div><br></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <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>