BUG: Mark failed time steps when exporting#1471
Draft
pschultzendorff wants to merge 1 commit intodevelopfrom
Draft
Conversation
13 tasks
Contributor
|
Let's reconsider this once #1448 is merged. Converting to draft in the meantime. |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Attempt at fixing #1421.
The idea is to have
SolverStatisticskeep track of whether the current nonlinear loop has converged. When callingDataSavingMixin.save_data_time_step,SolverStatistics.savestores the convergence flag in the JSON file.DataSavingMixin.write_pvd_and_vtuthen prefixes exported files withfailed_in the case of non-convergence. Lastly, only the files corresponding to converged time steps are included in thedata.pvdfile for the full simulation.The code works, except for the last part. To track failed time steps, I added
Exporter._exported_timesteps_convergence, which masks non-converged steps before writingdata.pvd. However, whenDataSavingMixin.write_pvd_and_vtucallsExporter.write_pvd, it passesTimeManager.exported_timesfortimesandNoneforfile_extension. The latter parameter is then replaced byExporter._exported_timesteps. As far as I see, tracking exported time steps at two different places and coupling both inExporter.write_pvdis prone to bugs.Before I make this even more convoluted, we should discuss whether it is worth to clean this up and unify bookkeeping of exported time steps.
Also this is potentially a breaking change, as I removed
SolutionStrategy.converge_statusin favor ofSolverStatistics.nl_is_converged. The former wasn't used anywhere though.Types of changes
Checklist
pytestwas run with the--run-skippedflag.Tests run successfully, but exporting does not work correctly atm (2025-08-15)