<div dir="ltr">On Mon, Feb 4, 2013 at 1:45 PM, Tobin Isaac <span dir="ltr"><<a href="mailto:tisaac@ices.utexas.edu" target="_blank">tisaac@ices.utexas.edu</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<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"><div class=""><div class="h5">On Mon, Feb 04, 2013 at 12:30:39PM -0600, Dmitry Karpeev wrote:<br>
> Francesco,<br>
><br>
> Are you using any pressure stabilization scheme? If not, the 11-block in<br>
> your Jacobian<br>
> A = [A00 A01; A10 A11] would typically be zero, and preconditioning it with<br>
> jacobi wouldn't really work.<br>
><br>
> If A11 = 0, you ought to use the fieldsplit of type Schur, for example<br>
> (assuming petsc-3.3; prior versions use slightly different option names):<br>
> -pc_fieldsplit_type schur -pc_fieldsplit_schur_fact_type full<br>
> The question is then how you want to solve the Schur complement system.<br>
> Since the A11 block for you is zero, the easiest choice is to use S as the<br>
> preconditioning matrix:<br>
> -pc_fieldsplit_schur_precondition self<br>
><br>
> Preconditioning options for the Schur solver have prefix -fieldsplit_1_.<br>
> Since for Stokes the Schur complement is spectrally equivalent to the<br>
> pressure mass matrix, you can<br>
> hope that an unpreconditioned GMRES (default when using<br>
> -pc_fieldsplit_schur_precondition self) will solve it.<br>
><br>
><br>
> A better choice might be to use the Least Squares Commutator preconditioner<br>
> -fieldsplit_1_pc_type lsc<br>
> See<br>
> <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCLSC.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCLSC.html</a><br>
> and note the relevant references at the bottom of that manual page.<br>
> You might also find this useful:<br>
> <a href="http://www.icfd.rdg.ac.uk/ICFD25/Talks/AWathen.pdf" target="_blank">http://www.icfd.rdg.ac.uk/ICFD25/Talks/AWathen.pdf</a><br>
><br>
> PCLSC preconditions S = A10 inv(A00) A01 with inv(A10A01) A10 A00 A01<br>
> inv(A10A01)<br>
> The "Laplacian" (a true Laplacian in the case of incompressible Stokes) can<br>
> be preconditioned<br>
> using AMG:<br>
> -fieldsplit_1_lsc_pc_type ml<br>
> (assuming you have ML built, e.g., with --download-ml)<br>
> or<br>
> -fieldsplit_1_lsc_pc_type gamg<br>
> with some appropriate choice of gamg options:<br>
> <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCGAMG.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCGAMG.html</a><br>
><br>
> To start with I would use -pc_fieldsplit_type schur<br>
> -pc_fieldsplit_schur_fact_type full -pc_fieldsplit_schur_precondition self<br>
> -fieldsplit_1_pc_type lsc -fieldsplit_1_lsc_pc_type ml<br>
> gamg may also be very good in place of ml, but will require more option<br>
> setting.<br>
><br>
><br>
> You might find src/ksp/ksp/examples/tutorials/ex42.c and ex43.c useful,<br>
> albeit, possibly, a bit heavyweight for your needs.<br>
<br>
</div></div>Also, if your problem isn't stabilized then your vectors (hopefully)<br>
aren't layed out in strided form. A good example of how to setup a<br>
fieldsplit preconditioner in this more general setting is<br>
src/snes/examples/tutorials/ex70.c</blockquote><div><br></div><div style>Note that this is also done for unstructured mesh Stokes in SNES ex62, and you can see all the tests here:</div><div style><br></div><div style> <a href="https://bitbucket.org/petsc/petsc-dev/src/e273ef2c2517b1e5787fa19bd0738bf91d2229e2/config/builder.py?at=default#cl-301">https://bitbucket.org/petsc/petsc-dev/src/e273ef2c2517b1e5787fa19bd0738bf91d2229e2/config/builder.py?at=default#cl-301</a></div>
<div style><br></div><div style> Thanks,</div><div style><br></div><div style> Matt</div><div> </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">
<div class=""><div class="h5">
><br>
> A few more comments below:<br>
><br>
> On Mon, Feb 4, 2013 at 10:20 AM, John Peterson <<a href="mailto:jwpeterson@gmail.com">jwpeterson@gmail.com</a>> wrote:<br>
><br>
> > On Thu, Dec 27, 2012 at 4:31 AM, Francesco Ballarin<br>
> > <<a href="mailto:francesco.ballarin@mail.polimi.it">francesco.ballarin@mail.polimi.it</a>> wrote:<br>
> > > Dear libMesh users,<br>
> > > I am trying to solve a Stokes problem in a 3D domain, but I am currently<br>
> > > struggling with the choice of the preconditioner.<br>
> > > I have slightly modified systems_of_equations_ex1 to accommodate for the<br>
> > > third velocity component and boundary conditions of the problem at hand<br>
> > > (Dirichlet BCs on the inlet on the walls, enforced using a<br>
> > > DirichletBoundary object, and homogeneous Neumann BC on the outflow)<br>
> > ><br>
> > > I am trying to use PETSc block preconditioners as shown, e.g., in<br>
> > > <a href="http://acts.nersc.gov/events/Workshop2012/slides/PETSc.pdf" target="_blank">http://acts.nersc.gov/events/Workshop2012/slides/PETSc.pdf</a><br>
> > > section 4. I have tried most of the preconditioners discussed during the<br>
> > > talk, but I am not satisfied because I get either PETSc errors or a<br>
> > > performance that I hope can be increased.<br>
> > ><br>
> > > For example, with the following options:<br>
> > > *******<br>
> > > PetscOptionsSetValue("-ksp_type", "gmres");<br>
> > > PetscOptionsSetValue("-ksp_right_pc", PETSC_NULL);<br>
> > > PetscOptionsSetValue("-pc_type", "fieldsplit");<br>
> > > PetscOptionsSetValue("-pc_fieldsplit_detect_saddle_point", PETSC_NULL);<br>
> > > PetscOptionsSetValue("-pc_fieldsplit_type", "multiplicative");<br>
> > > PetscOptionsSetValue("-fieldsplit_0_ksp_type", "preonly");<br>
> > > PetscOptionsSetValue("-fieldsplit_0_pc_type", "ml");<br>
> > > PetscOptionsSetValue("-fieldsplit_1_ksp_type", "preonly");<br>
> > > PetscOptionsSetValue("-fieldsplit_1_pc_type", "jacobi");<br>
> ><br>
><br>
> You do not need to set options to PETSC_NULL, if you do not intend to use<br>
> them.<br>
> Also, how are you forming the splits?<br>
> -pc_fieldsplit_detect_saddle_point is actually rather useful here.<br>
><br>
> Further, there are programmatic ways to set most of these options, for<br>
> example:<br>
> <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCFieldSplitSetType.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCFieldSplitSetType.html</a><br>
><br>
> Even so, we typically recommend setting these on the command line whenever<br>
> possible:<br>
> this way you do not hardwire your solver choices and can quickly experiment<br>
> with different<br>
> solvers from the command-line without recompiling your code.<br>
><br>
><br>
> > > *******<br>
> > > I obtain a reasonable solution but after thousands of gmres iterations.<br>
> > Is<br>
> > > there any way to improve that?<br>
> > ><br>
> > > Or, if I try to embed the previous block preconditioner in mg:<br>
> > > *******<br>
> > > PetscOptionsSetValue("-pc_type", "mg");<br>
> > > PetscOptionsSetValue("-pc_mg_levels", "5");<br>
> > > PetscOptionsSetValue("-pc_mg_galerkin", PETSC_NULL);<br>
> > > PetscOptionsSetValue("-ksp_type", "gmres");<br>
> > > PetscOptionsSetValue("-mg_levels_pc_type", "fieldsplit");<br>
> > > PetscOptionsSetValue("-mg_levels_pc_fieldsplit_detect_saddle_point",<br>
> > > PETSC_NULL);<br>
> > > PetscOptionsSetValue("-mg_levels_pc_fieldsplit_type", "multiplicative");<br>
> > > PetscOptionsSetValue("-mg_levels_fieldsplit_0_ksp_type", "preonly");<br>
> > > PetscOptionsSetValue("-mg_levels_fieldsplit_0_pc_type", "gamg");<br>
> > > PetscOptionsSetValue("-mg_levels_fieldsplit_1_ksp_type", "preonly");<br>
> > > PetscOptionsSetValue("-mg_levels_fieldsplit_1_pc_type", "jacobi");<br>
> > > *******<br>
> > > I get the following error:<br>
> ><br>
> Always send the full stack trace, when reporting errors.<br>
><br>
> Finally, in the future you might want to post these questions to<br>
> <a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a><br>
><br>
> Dmitry.<br>
><br>
> > > *******<br>
> > > PETSC ERROR: Null argument, when expecting valid pointer!<br>
> > > PETSC ERROR: Null Object: Parameter # 2!<br>
> > > PETSC ERROR: MatPtAP() line 8237 in<br>
> > petsc-3.3-p4/src/mat/interface/matrix.c<br>
> > > *******<br>
> > ><br>
> > > Do you have any suggestion? What are you currently using as<br>
> > preconditioner<br>
> > > for saddle point problems?<br>
> ><br>
> > Apologies, it appears that this email fell through the cracks<br>
> > somewhere back around the holidays.<br>
> ><br>
> > Did you ever find a satisfactory answer to your question?<br>
> ><br>
> > Petsc developers may occasionally read this list, but for questions<br>
> > that are this advanced you would probably have better luck mailing the<br>
> > petsc developers list directly.<br>
> ><br>
> > And of course if you do find a good block preconditioning strategy for<br>
> > systems_of_equations_ex1, please feel free to report it here!<br>
> ><br>
> > --<br>
> > John<br>
> ><br>
> ><br>
> > ------------------------------------------------------------------------------<br>
> > Everyone hates slow websites. So do we.<br>
> > Make your web apps faster with AppDynamics<br>
> > Download AppDynamics Lite for free today:<br>
> > <a href="http://p.sf.net/sfu/appdyn_d2d_jan" target="_blank">http://p.sf.net/sfu/appdyn_d2d_jan</a><br>
> > _______________________________________________<br>
> > Libmesh-users mailing list<br>
> > <a href="mailto:Libmesh-users@lists.sourceforge.net">Libmesh-users@lists.sourceforge.net</a><br>
> > <a href="https://lists.sourceforge.net/lists/listinfo/libmesh-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/libmesh-users</a><br>
> ><br>
><br>
><br>
><br>
> --<br>
> Dmitry Karpeev, Ph.D.<br>
> Assistant Computational Mathematician<br>
> Mathematics and Computer Science<br>
> Argonne National Laboratory<br>
> Argonne, Illinois, USA<br>
> and<br>
> Fellow<br>
> Computation Institute<br>
> University of Chicago<br>
> 5735 S. Ellis Avenue<br>
> Chicago, IL 60637<br>
> -----------------------<br>
> Phone: <a href="tel:630-252-1229" value="+16302521229">630-252-1229</a><br>
> Fax: <a href="tel:630-252-5986" value="+16302525986">630-252-5986</a><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
</div></div>