[petsc-users] SNES and ghosted vector of unknowns

Barry Smith bsmith at mcs.anl.gov
Sat Apr 21 12:10:37 CDT 2012


   Domink,

     Sounds like you want to do a "Picard" iteration. You should use http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESSetPicard.html  in petsc-dev 
     Note with this you never compute f(x) = A(x)x - b(x)   you provide a function to compute b(x) and A(x). 

     Please let us know if this new functionality doesn't serve your purpose. 

      You would do the ghost point update in the function that computes b().


    Barry


On Apr 21, 2012, at 12:01 PM, Dominik Szczerba wrote:

> 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