[petsc-users] SNES and ghosted vector of unknowns

Dominik Szczerba dominik at itis.ethz.ch
Sat Apr 21 12:01:34 CDT 2012


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.


More information about the petsc-users mailing list