<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, May 29, 2015 at 5:09 AM, Elias Karabelas <span dir="ltr"><<a href="mailto:karabelaselias@gmail.com" target="_blank">karabelaselias@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear Matt,<br>
<br>
I tried out what you said. I used the following example I found with google<br>
<br>
<a href="https://raw.githubusercontent.com/petsc/petsc/5edff71f342f05166073de0ae93226f0997d7fe9/src/snes/examples/tutorials/ex70.c" target="_blank">https://raw.githubusercontent.com/petsc/petsc/5edff71f342f05166073de0ae93226f0997d7fe9/src/snes/examples/tutorials/ex70.c</a></div></blockquote><div><br></div><div>Please do not start with this one. It exhibits the manual approach, which is necessary sometimes, but</div><div>definitely less elegant than the command line.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
So now I have some questions concerning that<br>
<br>
<br>
a) When I use pc_fieldsplit_precondition_schur selfp I get slower
convergence than with the user-provided Schur-Complement approximation
in this example code. However from what I saw this should coincide in
this case?<br></div></blockquote><div><br></div><div>For the Stokes Equation selfp gives a Schur preconditioner that is not spectrally equivalent:</div><div><br></div><div> B^T diag(A)^{-1} B \approx \Delta whereas S \approx I</div><div><br></div><div>so we generally use something that looks like that mass matrix. I think that is what is in the code.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
b) I get a little confused with the settings of the inner and outer
solvers in fieldsplit. So if I understood it correctly
"-pc_fieldsplit_schur_fact_type upper" uses<br>
<br>
K -B^T<br>
0 S <br></div></blockquote><div><br></div><div>Yes.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
as preconditioner. Where K and S are inverted with the help of a KSP. So
what I don't get is how to tweak the inner solvers correctly. For
Example, In my own Implementation of preconditioned GMRES I also use the
same structure as above as preconditioner and I take K^-1 to be
approximated by the application of an AMG (in my case BoomerAMG) .
Further I take S = B diag(K)^-1 B^T and again use an AMG to invert S.
This results in my case in a good preconditioner. <br>
<br>
I tried now the same with this example and used<br>
<br>
-fieldsplit_0_ksp_type preonly -fieldsplit_0_pc_type hypre -fieldsplit_1_ksp_type preonly -fieldsplit_1_pc_type hypre<br></div></blockquote><div><br></div><div>1) Always start with 'lu' so that you can see what is responsible for deterioration in convergence. I always start</div><div> with the full Schur Complement factorization and accurate solves so that it converges in 1 iterate. Then I</div><div> back off some of it.</div><div><br></div><div>2) That preconditioner is definitely not optimal</div><div><br></div><div>3) For questions about convergence, always send</div><div><br></div><div> -ksp_view -ksp_monitor_true_residual -ksp_converged_reason</div><div><br></div><div>and in this case turn on the monitors for the interior solves, e.g.</div><div><br></div><div> -fieldsplit_1_ksp_monitor_true_residual</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 dir="ltr">
However I get really slow convergence of the outer GMRES method. <br>
<br>
Can someone give me some insight into this?<br>
<br>
Best regards<div><div class="h5"><br>
Elias<br>
<br>
<br>
<div>On 28.05.2015 18:02, Matthew Knepley wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, May 28, 2015 at 10:47 AM, Elias Karabelas <span dir="ltr"><<a href="mailto:elias.karabelas@medunigraz.at" target="_blank">elias.karabelas@medunigraz.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Dear Members,<br>
<br>
I want to solve a Block System arising from the Discretization of a stabilized Finite Element Formulation of the Stokes System.<br>
<br>
I have the following Block Structure<br>
<br>
A -B^T<br>
B C<br>
<br>
The Preconditioner I intend to use is a block preconditioner of the Form<br>
<br>
A -B^T<br>
S<br>
<br>
where S is an approximation of the Schur Complement. For applying the
inverse of the schur complement I want to use a Stabilized Least Squares
Commutator in the form<br>
<br>
S^-1 = (B diag(Q)^-1 B^T + C_1)^-1 (B diag(Q)^-1 A diag(Q)^-1 B^T + C_2) (B diag(Q)^-1 B^T + C_1)^-1<br>
<br>
where Q is the mass matrix and C_1 and C_2 are some additional stabilization matrices.<br>
<br>
I got from the Manual, that I can use the PCFieldSplit preconditioner
for generating the general Block preconditioner as indicated above. And I
also found that I can define some arbitrary PC with PCSHELL. My
question is, if it is possible to use PCSHELL to define the action of
S^-1 as indicated above.<br></blockquote><div><br></div><div>1) Use FieldSplit is the right PC to start with. Make sure you can do something simple like </div><div><br></div><div> A -B^T</div><div> C + B diag(A)^{-1} B^T</div><div><br></div><div>with it before we do the more complicated thing.</div><div><br></div><div>2) You will want to implement a PC for the (1,1) block. You can use a PCSHELL, which is simpler to setup, but</div><div> that means you will have to manually pull out the FieldSplit KSP and set it. If instead you define your own</div><div> PC implementation, its more boilerplate code, but you could specify this PC from the command line without</div><div> any FieldSplit specific code in your application.</div><div><br></div><div>3) Your PC will get two matrices, the MatSchurComplement, and the preconditioning matrix. If you set Q as the</div><div> preconditioning matrix, or really if you set</div><div><br></div><div> A 0</div><div> 0 Q</div><div> </div><div>as the global preconditioning matrix, then the subsolve for (1,1) will get the Schur Complement and Q, and I think</div><div>that is enough to build your Stabilized LSC PC.</div><div><br></div><div>Let me know if this makes sense to you.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Kind Regards<span><font color="#888888"><br>
Elias Karabelas<br>
<br>
-- <br>
Elias Karabelas, Ph.D.<br>
<br>
Medical University of Graz<br>
Institute of Biophysics<br>
Harrachgasse 21/IV<br>
8010 Graz, Austria<br>
<br>
Phone: <a href="tel:%2B43%20316%20380%207759" value="+433163807759" target="_blank">+43 316 380 7759</a><br>
Email: <a href="mailto:elias.karabelas@medunigraz.at" target="_blank">elias.karabelas@medunigraz.at</a><br>
Web : <a href="http://forschung.medunigraz.at/fodok/staff?name=EliasKarabelas" target="_blank">http://forschung.medunigraz.at/fodok/staff?name=EliasKarabelas</a><br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>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>
</blockquote></div></div></div>
</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>