[petsc-users] clarification of SNES / FormFunction

Dominik Szczerba dominik at itis.ethz.ch
Tue May 8 06:23:33 CDT 2012


Hi, I do set my own KSP to SNES:


	ierr = SNESCreate(PETSC_COMM_WORLD, &snes); CHKERRQ(ierr);
	ierr = SNESSetKSP(snes, ksp); CHKERRQ(ierr);

I set the ksp solver type, tolerances etc. Then I register
FormFunction using SNESSetFunction, and implement it as;


PetscErrorCode FormFunction(SNES snes, Vec x, Vec f, void *ctx)

Now my question: is "x" in the signature above expected to be the same
as "x" obtained after a linear solve in the KSP object used in SNES
(that I pass inside ctx), or will "x" be generally differently-valued
due to e.g. the line search performed?

Thanks for any clarifications.

Dominik


More information about the petsc-users mailing list