-
Notifications
You must be signed in to change notification settings - Fork 114
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
Fix intern time integration method with fixed time step #1919
Fix intern time integration method with fixed time step #1919
Conversation
Review checklistThis checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging. Purpose and scope
Code quality
Documentation
Testing
Performance
Verification
Created with ❤️ by the Trixi.jl community. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1919 +/- ##
==========================================
+ Coverage 91.96% 96.10% +4.13%
==========================================
Files 451 451
Lines 36218 36241 +23
==========================================
+ Hits 33307 34826 +1519
+ Misses 2911 1415 -1496
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
You confirmed that one can now set the time step manually, right? |
Basically yes. The time step set was just ignored after #1677. |
Okay, feel free to notify me when you think this is ready! |
I'm a little bit lost right now. The first problem was that if we want to use a fixed time step (so with disabled stepsize callback), the time step is set to But now, if we are close to one of these
The timesteps are
@ranocha Do you have an idea how to fix this or how it is done in OrdinaryDiffEq (as I said, OrdinaryDiffEq uses the same version of EDIT: An idea would be to add a variable to the integrator which saves the set time step for the whole simulation and reset |
OrdinaryDiffEq.jl has a working implementation: julia> using OrdinaryDiffEq
julia> ode = ODEProblem((du, u, p, t) -> du .= u, [1.0], (0.0, 1.0))
ODEProblem with uType Vector{Float64} and tType Float64. In-place: true
timespan: (0.0, 1.0)
u0: 1-element Vector{Float64}:
1.0
julia> sol = solve(ode, Euler(); adaptive = false, dt = 0.11, tstops = (0.5))
retcode: Success
Interpolation: 3rd order Hermite
t: 11-element Vector{Float64}:
0.0
0.11
0.22
0.33
0.44
0.5
0.61
0.72
0.83
0.94
1.0
u: 11-element Vector{Vector{Float64}}:
[1.0]
[1.11]
[1.2321000000000002]
[1.3676310000000003]
[1.5180704100000002]
[1.6091546346000003]
[1.7861616444060002]
[1.9826394252906603]
[2.200729762072633]
[2.4428100359006226]
[2.58937863805466] |
Note the |
Oh yes. Thanks a lot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a test for this fix?
Save the manually set time step to allow simulations without a stepsize callback. Before it was overwritten within
modify_dt_for_tstops!
.