Thank a lot for the hints, but I still one little clarification. The FormFunction function has a signature
PetscErrorCode ScalarNonLinearSolver::FormFunction(SNES snes, Vec x, Vec f, void *ctx) where I am supposed to compute A(x), b(x) and then fill f with f(x) = A(x)x - b(x) The question is: should I call the ghost update on the passed argument x, or on my own x that I maintain in my application as a part of a KSP system? Or are they supposed to be actually the same? Thanks a lot Dominik On Fri, Apr 20, 2012 at 4:13 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote: > On Fri, Apr 20, 2012 at 07:08, Matthew Knepley <knepley at gmail.com> wrote: >> >> You can use >> >> >> ??http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESSetUpdate.html > > > Please don't do it this way, line searches and other methods will not work. > A ghosted vector is defined by the global entries, not the local form. > Update the local form when you want it to be current.
