[petsc-users] Modifying the computed TS step, TSSetPostStep vs TSSetPostEvaluate

Stefano Zampini stefano.zampini at gmail.com
Sun Jul 22 09:06:09 CDT 2018


If the filter is part got your residual evaluation (your R), then you should do it inside  your RHS function itself.

Instead, if the filter applies to y(t+dt), you should do it in PostEvaluate. Note that PostStep is equivalent to PostEvaluate if you don’t have TSEvents set.

> On Jul 22, 2018, at 11:13 AM, Mark Lohry <mlohry at gmail.com> wrote:
> 
> For the time iteration
> 
> y(t+dt) = y(t) + dt * R(y,t,...)
> 
> I need to apply a spectral filter to R prior to moving to the next step, e.g. so not use exactly the step computed by TS.
> 
> Where is the appropriate place to do this? SNES provides SNESLineSearchSetPostCheck where you can modify the newton step; is there a TS equivalent?
> 
> Or do I need to internally maintain a copy of y(t) to re-compute R and then call TSSetSolution with a modified vector?



More information about the petsc-users mailing list