Allow advance(dt)
with dt > time_window_size
#1932
Labels
enhancement
A new feature, a new functionality of preCICE (from user perspective)
Please describe the problem you are trying to solve.
Sometimes we run into a situation where the time step size defined in the config file does not exactly fit into the desired end time. Especially, if this is due to round-off errors this can lead to tricky situations.
Example: We want to reach T=5 with dt=0.01. This results in 500 time steps of roughly 0.01 and a 501st time step around 10e-14:
This last time step is problematic, because the solver might not be able to handle such a small time step. We already had some discussions about similar situations recently (e.g. in #1788). We also know some strategies that we can apply, if the last substep inside of a window becomes too small (i.e.
precice_dt > solver_dt
, butprecice_dt - solver_dt
is very small, see here). Now, the situation is different because we always use the actualdt = precice_dt = time_window_size
. But we would actually like to usedt = time_window_size + 10e-14
in the 500th time step to avoid having to perform a 501st timestep withdt = 10e-14
.Describe the solution you propose.
Currently, the adapter cannot perform a time step
dt > precice_dt
- even, if it knows about the future problem in the 501st time step.advance(dt)
prohibits this for good reasons. I think we need some additional logic such thatgetMaxTimeStepSize()
returnsprecice_dt = time_window_size + 10e-14
in the 500th time step.Describe alternatives you've considered
advance
could also accept adt > time_window_size
up to a certain margin. This, however, leads to a synchronization problem with the other adapters that might not know about one adapter performing a slightly larger time step.Additional context
This problem is relatively easy to reproduce with the solverdummy.
The text was updated successfully, but these errors were encountered: