<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>On Aug 5, 2011, at 11:47 AM, Barry Smith wrote:</div><div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On Aug 5, 2011, at 10:43 AM, Ataollah Mesgarnejad wrote:<br><br><blockquote type="cite">Dear all,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I use KSPSetInitialGuessNonzero for my KSP solver and it works perfectly. But when I restart my computations (I read petsc binaries and set up my fields) the first KSP solve takes forever. I guess my question is: is there a way to set the initial guess for KSP back to where it was before termination (i.e. write the KSP out) or set it to be a predefined vector?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Thanks,<br></blockquote><blockquote type="cite">Ata<br></blockquote><br> There isn't a way automatically with the KSP. But why not save the last solution to the binary file and read it in at restart and put it into x before your first new KSPSolve?<br><font class="Apple-style-span" face="'Helvetica Neue'"><br></font></div></blockquote></div><div><blockquote type="cite"><div> Barry<br><br></div></blockquote></div><div><br></div><font class="Apple-style-span" face="'Helvetica Neue'">Ok so if I get it correctly I need to pass ierr = KSPSolve(ksp,x ,u);CHKERRQ</font><font class="Apple-style-span" face="'Helvetica Neue'">(ierr); and set <font class="Apple-style-span" color="#ff1e18">"x"</font> to be the last thing I had for <font class="Apple-style-span" color="#ff1e18">"u"</font>?</font><div><font class="Apple-style-span" face="'Helvetica Neue'"><br></font><div>Thanks,</div><div>Ata</div></div></body></html>