[petsc-users] SNESSetUpdate function
Bernardo Rocha
bernardomartinsrocha at gmail.com
Fri Jan 20 08:41:18 CST 2012
OK, thanks...
On Fri, Jan 20, 2012 at 12:33 PM, Matthew Knepley <knepley at gmail.com> wrote:
> On Fri, Jan 20, 2012 at 8:28 AM, Bernardo Rocha <
> bernardomartinsrocha at gmail.com> wrote:
>
>> Hi everyone,
>>
>> I'm using SNES but I would like to update my data after each successful
>> step computation within the nonlinear solver using a different function. I
>> mean, after the solution of each linear system I would like to get \Delta
>> x_k to update x_{k+1} which is stored somewhere in my application class
>> (C++ code). Looking at the documentation I found this function:
>>
>> PetscErrorCode SNESSetUpdate(SNES snes, PetscErrorCode (*func)(SNES,
>> PetscInt))
>>
>> but func does not take an application context "object" like void *ctx,
>> that I could use to get my data and finally update it. Is there another
>> function that would allow me to do this?
>>
>
> Can you use
> http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESGetApplicationContext.html
>
> Matt
>
>
>> Thanks in advance,
>> Best regards,
>> Bernardo M. Rocha
>>
>>
>>
>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120120/23b4c630/attachment.htm>
More information about the petsc-users
mailing list