A different kind of lagged preconditioner
bsmith at mcs.anl.gov
Mon Mar 23 19:39:18 CDT 2009
Just use VecCopy() for the times you skip the application of the
preconditioner; if you do nothing for those times, it will fail as it
As Matt says, you need to use KSPFGMRES if you use a different
preconditioner on different iterations.
BTW: your plan will suck.
On Mar 23, 2009, at 6:41 PM, Rafael Santos Coelho wrote:
> Well, let me explain myself again. I've implemented a serial matrix-
> free uniparametric LU-SGS preconditioner for non-linear problems
> using the PETSc PCSHELL module. It's matrix-free in the sense that
> whenever the jacobian matrix (and by that I mean the L, D and U
> factors of the jacobian matrix) is required within the linear solver
> in the form of a matrix-vector product, I resort to a finite-
> difference formula in order to approximate the jacobian entries. So
> the jacobian matrix is never actually formed. To use my
> preconditioner, I just have to set the "-user_precond" command-line
> option along with "-snes_mf".
> Now, the cost to apply that preconditioner obviously grows according
> to the problem dimensions, so it is built and applied within the
> linear solver to form the vectors of the Krylov subspace basis in
> each linear iteration. I want to change that, and only have it
> applied every "p" linear iterations to make it less costlier.
More information about the petsc-users