On Aug 5, 2011, at 11:47 AM, Barry Smith wrote:

> 
> On Aug 5, 2011, at 10:43 AM, Ataollah Mesgarnejad wrote:
> 
>> Dear all,
>> 
>> 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?
>> 
>> Thanks,
>> Ata
> 
>   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?
> 

>   Barry
> 


Ok so if I get it correctly I need to pass  ierr = KSPSolve(ksp,x 
,u);CHKERRQ(ierr); and set "x" to be the last thing I had for "u"?

Thanks,
Ata
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110805/010158ed/attachment.htm>

Reply via email to