openmc
openmc copied to clipboard
Feature request: deplete.export_to_materials to support individual material export
Hi all,
Could the deplete.export_to_materials be modified to allow the exporting of a single material instead of all materials in the model.
This could be done with the addition of another argument that identifies material ids to loop through. Currently we loop through all the materials
This could save some processing time for user that just want to extract one material
Would this be a welcome feature or is it unnecessary.
Currently I'm indexing the returned materials to get the one I am interested in. So I have a work around and this is perhaps not necessary.
results = openmc.deplete.Results.from_hdf5("depletion_results.h5")
material = results.export_to_materials(step)[0] # <--- [0] as I'm interested in just the first material
Could be useful, espec when doing results analysis.
We now have get_material in the StepResult class that mainly solves this feature request.
https://github.com/openmc-dev/openmc/blob/46045588f50c1dac0106942d3851a772497c2fa1/openmc/deplete/stepresult.py#L202
So I think this is good to close. Feel free to reopen if anyone feels this needs further work.