Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling mandatory callbacks for specific methods #494

Open
LasNikas opened this issue Apr 3, 2024 · 6 comments
Open

Handling mandatory callbacks for specific methods #494

LasNikas opened this issue Apr 3, 2024 · 6 comments

Comments

@LasNikas
Copy link
Collaborator

LasNikas commented Apr 3, 2024

For some methods such as TVF and OpenBC an update each full time step is necessary. That makes the update callback in #440 mandatory for a simulation.

We can't just check , e.g. in the Semidiscretization, whether the update callback is in the callbackset or not since the callbackset is directly passed to solve.

@efaulhaber @svchb any thoughts on that?

@efaulhaber
Copy link
Member

I can't think of anything. @sloede ?

@LasNikas
Copy link
Collaborator Author

LasNikas commented Apr 4, 2024

A possible workaround might be TrixiParticlesCallbackSet(semi, callbacks...)
I have no better idea...

@efaulhaber
Copy link
Member

Solved in #442, right?
The methods requiring callbacks have a flag callback_used, which is updated in the initialization of the callback. If not, an error will be thrown.

@LasNikas
Copy link
Collaborator Author

yes, exactly.

@LasNikas
Copy link
Collaborator Author

However, the problem is - as discussed in #442 - :

one can run one proper simulation with a system and then reuse this system for simulations without UpdateCallback.

@efaulhaber
Copy link
Member

Our solution for this now is to reset the flag callback_used to false in semidiscretize and in restart_with!. This still doesn't prevent users from solving the same ODEProblem again without the callback, but this really is an edge case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants