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

Improvements and fixes for the dynamic time stepper #1201

Merged
merged 3 commits into from
Jul 3, 2024

Conversation

Yuriyzabegaev
Copy link
Contributor

@Yuriyzabegaev Yuriyzabegaev commented Jun 27, 2024

Proposed changes

Fixed a bug of dynamic time stepping when a time step failed right before meeting the schedule. Also improved documentation a bit.

Update: This also addresses the issue with resetting the iterate values after an unsuccessful time step.

Types of changes

What types of changes does this PR introduce to PorePy?
Put an x in the boxes that apply.

  • Minor change (e.g., dependency bumps, broken links).
  • Bugfix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Testing (contribution related to testing of existing or new functionality).
  • Documentation (contribution related to adding, improving, or fixing documentation).
  • Maintenance (e.g., improve logic and performance, remove obsolete code).
  • Other:

Checklist

Put an x in the boxes that apply or explain briefly why the box is not relevant.

  • The documentation is up-to-date.
  • Static typing is included in the update.
  • This PR does not duplicate existing functionality.
  • The update is covered by the test suite (including tests added in the PR).
  • If new skipped tests have been introduced in this PR, pytest was run with the --run-skipped flag.

@Yuriyzabegaev
Copy link
Contributor Author

Yuriyzabegaev commented Jun 27, 2024

I had to change the behavior of the test_final_simulation_time. Previously, it expected None which signalized that simulation is over if the simulation reached the end time, even if we asked to recompute solution. This behavior is incorrect, because it leads to the bug I'm fixing: We did not accept the solution at the last time step and want to recompute it, but the time manager stops the simulation.

This opens another question: Should it return None if we ask to recompute the solution, and the simulation time for some reason exceeded the end time? Previously, it would stop the simulation. I believe that it's also not expected, so now it will recompute the solution if we ask for it, regardless of how close we are to the end time, or if we exceed it. This shouldn't happen in a real simulation anyway.

@Yuriyzabegaev
Copy link
Contributor Author

The last commit aims to fix #1205.

@Yuriyzabegaev Yuriyzabegaev changed the title MAINT: Fixed a bug of dynamic time stepping when a time step failed right before meeting the schedule Improvements and fixes for the dynamic time stepper Jul 2, 2024
@keileg keileg merged commit 8ac6527 into develop Jul 3, 2024
7 checks passed
@keileg keileg deleted the dynamic_time_stepping branch July 3, 2024 12:24
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.

2 participants