openmc icon indicating copy to clipboard operation
openmc copied to clipboard

Add extern function to delete a tally by its ID

Open lewisgross1296 opened this issue 3 years ago • 0 comments

Closes #2155. This PR adds a new function to openmc/src/tallies/tally.cpp with the signature extern "C" void openmc_remove_tally_from_tallies(int32_t id) that can delete a tally from the tally vector via its ID. This will be useful in adaptive mesh refinement problems where a tally will need to be deleted and re-added to the problem every time the mesh, and thus the bins, change. Additionally, this function is added to the C++ API so it can be called, and it is tested in via a unit test in openmc/tests/unit_tests/test_tallies.py.

lewisgross1296 avatar Aug 10 '22 22:08 lewisgross1296