add continue feature for depletion #3272
Open
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.
Description
This PR closes #2871. To summarize the motivation, I'd like depletion restarts to be a bit easier for users. If you set up a depletion simulation that doesn't end up getting run all the way (think hitting max wall time on an HPC or some other interrupt), the burden then falls to the user to correctly determine what time steps were not run and to create a new script that picks up where the other one left off. In my own experience, it is easy to make a mistake and re-run a simulation that is not what I desired.
All we do here is add a
continue_timesteps
flag (default toFalse
) that adds a new logic block to theIntegrator
class. It would be useful in the above case and requires users to provide theIntegrator
with a set oftimesteps
and one ofpower
/power_density
/source_rate
that matches what already exists in aprev_results
passed to theOpperator
.With this flag, the depletion restart python script can now be exactly the same as the initial script, just with a
continue_timesteps = True
flag and aprev_results
object loaded from adepletion_statepoint.h5
passed to theOperator
. It could contain more timesteps at the end too, but the only requirement is that the data matches what is in theOperator
provided to theIntegrator
for all the existing steps in the results.This PR does not eliminate any of the existing capability of the depletion API, so all the old use cases/syntax for restarts remain. The flag is optional and defaults to
False
so no one will need to update past scripts with this change.Checklist
I have run clang-format (version 15) on any C++ source files (if applicable)