[petsc-users] Matrix free GMRES seems to ignore my initial guess

Jan Izak Cornelius Vermaak janicvermaak at gmail.com
Mon May 27 23:33:52 CDT 2019


Hi all,

So I am faced with this debacle. I have a neutron transport solver with a
sweep code that can compute the action of the matrix on a vector.

I use a matrix shell to set up the action of the matrix. The method works
but only if I can get the solution converged before GMRES restarts. It gets
the right answer. Now my first problem is (and I only saw this when I hit
the first restart) is that it looks like the solver completely resets after
the GMRES-restart. Below is an iteration log with restart interval set to
10. At first I thought it wasn't updating the initial guess but it became
clear that it initial guess always had no effect. I do set
KSPSetInitialGuessNonZero but it has no effect.

Is the matrix-free business defaulting my initial guess to zero everytime?
What can I do to actually supply an initial guess? I've used PETSc for
diffusion many times and the initial guess always works, just not now.

[0]  Computing b

[0]  Iteration 0 Residual 169.302

[0]  Iteration 1 Residual 47.582

[0]  Iteration 2 Residual 13.2614

[0]  Iteration 3 Residual 4.46795

[0]  Iteration 4 Residual 1.03038

[0]  Iteration 5 Residual 0.246807

[0]  Iteration 6 Residual 0.0828341

[0]  Iteration 7 Residual 0.0410627

[0]  Iteration 8 Residual 0.0243749

[0]  Iteration 9 Residual 0.0136067

[0]  Iteration 10 Residual 169.302

[0]  Iteration 11 Residual 47.582

[0]  Iteration 12 Residual 13.2614

[0]  Iteration 13 Residual 4.46795

[0]  Iteration 14 Residual 1.03038

[0]  Iteration 15 Residual 0.246807

[0]  Iteration 16 Residual 0.0828341

[0]  Iteration 17 Residual 0.0410627

[0]  Iteration 18 Residual 0.0243749

[0]  Iteration 19 Residual 0.0136067

[0]  Iteration 20 Residual 169.302

-- 
Jan Izak Cornelius Vermaak
(M.Eng Nuclear)
Email: janicvermaak at gmail.com
Cell:    +1-979-739-0789
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190527/fa854aed/attachment.html>


More information about the petsc-users mailing list