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

Fix timestep control #261

Merged
merged 3 commits into from
Jun 30, 2013
Merged

Fix timestep control #261

merged 3 commits into from
Jun 30, 2013

Conversation

ketch
Copy link
Member

@ketch ketch commented May 27, 2013

This fixes a bug in which very small timesteps were forced to be larger. Now we check the step size relative to the overall simulation time.

ketch added 3 commits May 5, 2013 11:23
* 'master' of git://github.com/clawpack/pyclaw:
  minor updates for the custom BCs and fix typo (probably) in setting BCs
@ahmadia
Copy link
Member

ahmadia commented May 27, 2013

David, do you have a fix for #258 in this pull request here as well?

Your updated logic seems fine to me. This seems reasonable when the time steps are very small (which is where I guess you were seeing incorrect behavior), but may allow time steps that the user does not want. Perhaps in the future it would make sense to allow the user to specify a set of tolerances for relative and absolute minimum step sizes that can be checked at this stage.

@mandli
Copy link
Member

mandli commented May 27, 2013

Right now you are multiplying by the time in solution rather than the overall simulation time which for large solution.t would break this check. Maybe multiplying by solver.dt or tend - solution.t would be better?

In response to @ahmadia's comment, I think those were probably leftover from when we were debugging the WENO routines. Those changed I don't think actually fix issue #258.

@ketch
Copy link
Member Author

ketch commented Jun 30, 2013

@mandli I believe that the reason for this check in the first place is to avoid an infinite loop if solver.dt/solution.t is on the order of machine epsilon (so adding dt doesn't change solution.t at all). Thus I think this scaling is precisely what's necessary. Do you agree?

@mandli
Copy link
Member

mandli commented Jun 30, 2013

I see what your saying, it's the relative size of solution.t and solver.dt that matters here. I think I was confused by the use of solution.t as an indication of the overall solution time where solution.t - t0, where t0 is the beginning of the simulation, is the overall length of time for the simulation.

ketch added a commit that referenced this pull request Jun 30, 2013
@ketch ketch merged commit ea584e3 into clawpack:master Jun 30, 2013
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 8ddc35a on ketch:fix_timestep_control into * on clawpack:master*.

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

Successfully merging this pull request may close these issues.

None yet

4 participants