This PR should help streamline lost particle debugging by enabling a track file write with the following workflow:
# run produces lost particle files
openmc
# restart with a particle file and produce a `tracks.h5` file with the resulting track for debugging
openmc -r <particle_file> -t
or in Python
# produces a `RuntimeError`
model.run()
# apply a particle file and produce the track
model.run(restart_file=particle_filepath, tracks=True)
This just involved opening and closing a track file for the run_particle_restart function. Those calls are typically made in openmc_simulation_init but that function isn't called for a particle restart run. I've added a test to ensure the above workflow is possible going forward.
Fixes #2956
Checklist
[x] I have performed a self-review of my own code
[x] I have run clang-format (version 15) on any C++ source files (if applicable)
[x] I have followed the style guidelines for Python source files (if applicable)
[x] I have made corresponding changes to the documentation (if applicable)
[x] I have added tests that prove my fix is effective or that my feature works (if applicable)
Description
This PR should help streamline lost particle debugging by enabling a track file write with the following workflow:
or in Python
This just involved opening and closing a track file for the
run_particle_restart
function. Those calls are typically made inopenmc_simulation_init
but that function isn't called for a particle restart run. I've added a test to ensure the above workflow is possible going forward.Fixes #2956
Checklist