<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div><span>Jed,</span></div><div><span></span> </div><div><span>Thanks a lot for the useful info!</span></div><div><span></span> </div><div><span>Qin</span></div><div style="display: block;" class="yahoo_quoted"> <br> <br> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> On Thursday, February 13, 2014 3:29 PM, Jed Brown <jed@jedbrown.org> wrote:<br> </font> </div>  <div class="y_msg_container">Qin Lu <<a href="mailto:lu_qin_2000@yahoo.com" shape="rect" ymailto="mailto:lu_qin_2000@yahoo.com">lu_qin_2000@yahoo.com</a>> writes:<br
 clear="none"><br clear="none">> It seems there is a deflated GMRES solver in PETSc (KSPDGMRES), <br clear="none"><br clear="none">This uses approximate eigen-functions as deflation vectors.  There are<br clear="none">many other ways to choose deflation spaces.<br clear="none"><br clear="none">> but PETSc manual does not give any details how to use it. <br clear="none"><br clear="none">Unfortunately, the person that contributed KSPDGMRES did not write man<br clear="none">pages or explain in the users manual.<br clear="none"><br clear="none">> A doc I found online is "parallel implementation of the deflated GMRES<br clear="none">> in the PETSc package", which mentioned to set number of eigenvalues to<br clear="none">> deflate by --ksp_dgmres_eigen, etc. Can I set these parameters by<br clear="none">> function calls (rather than using .petscrc)?<br clear="none"><br clear="none">The relevant functions are listed by -help.<br
 clear="none"><br clear="none">$ ./ex2 -ksp_type dgmres -help | grep ksp_dgmres<br clear="none">  -ksp_dgmres_eigen <1>: Number of smallest eigenvalues to extract at each restart (KSPDGMRESSetEigen)<br clear="none">  -ksp_dgmres_max_eigen <9>: Maximum Number of smallest eigenvalues to extract  (KSPDGMRESSetMaxEigen)<br clear="none">  -ksp_dgmres_ratio <1>: Relaxation parameter for the smaller number of matrix-vectors product allowed (KSPDGMRESSetRatio)<br clear="none">  -ksp_dgmres_improve: <FALSE> Improve the computation of eigenvalues by solving a new generalized eigenvalue problem (experimental - not stable at this time) (None)<br clear="none">  -ksp_dgmres_force: <FALSE> Sets DGMRES always at restart active, i.e do not use the adaptive strategy (KSPDGMRESForce)<div id="yqtfd53128" class="yqt0365350001"><br clear="none"><br clear="none">> Suppose the number of unknowns is 10,000, what
 would be the good<br clear="none">> number of number of eigenvalues to deflate? Or I may just use the<br clear="none">> default values (if they exist) for this solver?</div><br clear="none"><br clear="none">There is no way to guess; just try it.<br><br></div>  </div> </div>  </div> </div></body></html>