[petsc-users] TSSetEventHandler and TSSetPostEventIntervalStep

Matthew Knepley knepley at gmail.com
Tue Oct 27 14:34:40 CDT 2020


On Tue, Oct 27, 2020 at 3:09 PM Blondel, Sophie via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> Hi,
>
> I am currently using TSSetEventHandler in my code to detect a random event
> where the solution vector gets modified during the event. Ideally, after
> the event happens I want the solver to use a much smaller timestep using
> TSSetPostEventIntervalStep. However, when I use TSSetPostEventIntervalStep
> the solver doesn't use the set value. I managed to reproduce the behavior
> by modifying ex40.c as attached.
>

 I stepped through ex40, and it does indeed change the timestep to 0.001.
Can you be more specific, perhaps with monitors, about what you think is
wrong?

  Thanks,

     Matt


> I think the issue is related to the fact that the fvalue is not
> technically "approaching" 0 with a random event, it is more of a step
> function instead. Do you have any recommendation on how to implement the
> behavior I'm looking for? Let me know if I can provide additional
> information.
>
> Best,
>
> Sophie
>


-- 
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

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20201027/09179472/attachment.html>


More information about the petsc-users mailing list