[petsc-users] TSSetEventHandler and TSSetPostEventIntervalStep

Blondel, Sophie sblondel at utk.edu
Tue Oct 27 14:09:23 CDT 2020


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 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20201027/d8c05ea5/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ex40.c
Type: text/x-csrc
Size: 12871 bytes
Desc: ex40.c
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20201027/d8c05ea5/attachment-0001.bin>


More information about the petsc-users mailing list