Fande Kong <[email protected]> writes: > (1) The snes can solve my nonlinear problem with a default Jacobian > provided in the Petsc using finite differences, but this method may cause > some new nonzero allocations for the preallocated matrix.
Why are there new nonzeros? This must mean preallocation was incorrect. > (2) A Matrix-free version of snes also works well for my nonlinear problem, > but it does not allow me to apply a preconditioner. What kind of > algorithms are used for the matrix-free snes? There are solvers like FAS that can be used as nonlinear solvers or nonlinear preconditioners (for accelerators like NGMRES). If matrix-based preconditioners work well for you, it would be common to assemble a simpler matrix for preconditioning and apply the accurate Jacobian matrix-free. In PETSc, you can do this by simply assembling your approximate Jacobian and running with -snes_mf_operator. There are several other ways for working with approximate Jacobians, but try this first.
pgpqNGx4XMe3G.pgp
Description: PGP signature
