[petsc-users] initial guess

UK paulhuaizhang at uky.edu
Sun Nov 30 11:33:09 CST 2014


Hello,

I am using KSPFGMRES as my linear solver for Ax=b system. I was wondering
how the initial guess will influence the computation efficiency. Does PETSc
always starts with xo=0 or some value else? If I use my previous solution
as the initial guess for current computation  is it going to take less
effort for PETSc to solve the system? (my configuration attached)

Thanks,
Paul

        MatCreateMPIAIJ(
                        PETSC_COMM_WORLD,
                        grid[gid].cellCount*nVars,
                        grid[gid].cellCount*nVars,
                        grid[gid].globalCellCount*nVars,
                        grid[gid].globalCellCount*nVars,
                        0,&diagonal_nonzeros[0],
                        0,&off_diagonal_nonzeros[0],
                        &impOP);

        KSPSetOperators(ksp,impOP,impOP,SAME_NONZERO_PATTERN);
        KSPSetTolerances(ksp,rtol,abstol,1.e15,maxits);
        KSPSetInitialGuessKnoll(ksp,PETSC_TRUE);
        KSPSetType(ksp,KSPFGMRES);



Huaibao (Paul) Zhang
*Gas Surface Interactions Lab*
Department of Mechanical Engineering
University of Kentucky,
Lexington,
KY, 40506-0503
*Office*: 216 Ralph G. Anderson Building
*Web*:gsil.engineering.uky.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20141130/9079a6ab/attachment-0001.html>


More information about the petsc-users mailing list