<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Nov 13, 2014 at 5:39 AM, Massimiliano Leoni <span dir="ltr"><<a href="mailto:leoni.massimiliano1@gmail.com" target="_blank">leoni.massimiliano1@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi petsc-users,<br>
  I am relatively new to PETSc and so a few things that you'd call obvious<br>
still puzzle me. I hope someone can help me clarify this.<br>
<br>
Consider the system Ax = b and<br>
        KSPSetOperators(ksp,A,A,...);<br>
<br>
now, please correct me wherever I'm wrong:<br>
[1] if I set -ksp_type preonly, -pc_type lu   it solves Ax = b with direct LU<br>
<br>
[2] if I set -ksp_type preonly, -pc_type hypre   it solves Px = b where P is<br>
        the AMG preconditioner of A build by HYPRE<br>
        § Question: how does PETSc solve this?<br></blockquote><div><br></div><div>We call Hypre directly to apply P^{-1}.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
[3] if I set -ksp_type gmres, -pc_type hypre   it solves Ax = b as<br>
        P^{-1}Ax = P^{-1}b with gmres, where P is again the AMG prec build by<br>
        HYPRE.<br>
<br>
[4] suppose I have the classic Stokes matrix A = [[C,B^T],[B,O]] and want to<br>
        use the block preconditioner P = [[C,O],[O,Mp/nu]]. What I'm doing now is<br>
        KSPSetOperators(ksp,A,P,...);<br>
        set ksp_type gmres, pc_type fieldsplit, inner ksps gmres and inner pcs<br>
        hypre, so I expect PETSc to solve Pz = r by blocks,<br>
        C z_u = r_u first, as in [3]<br>
        Mp/nu z_p = r_p later, again as in [3]<br>
        Is this what is actually happening?<br></blockquote><div><br></div><div>It should be. Send -ksp_view and we can verify. You should use</div><div><br></div><div>  -pc_fieldsplit_schur_factorization_type diag</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[5] what happens instead if I set, in the same situation,<br>
        ksp_type preonly, pc_type fieldsplit, inner ksps gmres and inner pcs ?<br>
        I expect PETSc to solve Px = b with a block method as before. [This<br>
        doesn't actually solve Stokes].<br></blockquote><div><br></div><div>Yes.</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">
I'm sorry for the many questions, I am trying to go through the User Manual<br>
and will be glad if anyone points me to further resources.<br>
<br>
Thanks in advance for any help,<br>
Massimiliano<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">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</div>
</div></div>