[petsc-users] Modifying the solution vector at each TS and/or SNES step

Matthew Knepley knepley at gmail.com
Tue Jan 17 14:03:27 CST 2017


On Tue, Jan 17, 2017 at 1:32 PM, Mark W. Lohry <mlohry at princeton.edu> wrote:

> I have an algorithm where I'd like to slightly modify the solution vector
> at certain stages (specifically applying a filtering operation), for
> example at the conclusion of each TS or SNES step.
>

This is called at the beginning:


http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESSetUpdate.html

but I used to put my modifications for Newton here


http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESLineSearchSetPostCheck.html#SNESLineSearchSetPostCheck

For TS, there is


http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSSetPostStep.html

    Matt


> When TSMonitor is called, the solution vector is locked read-only. I'd
> also be concerned about modifying it there -- any kind of computation of
> the time derivative should be done with my altered solution vector, and
> similar for SNES although it's probably less critical there.
>
> Are there any hooks available to let me modify a solution vector at
> particular points like that?
>
> Thanks,
> Mark Lohry
>



-- 
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/20170117/7743fc17/attachment.html>


More information about the petsc-users mailing list