openmc
openmc copied to clipboard
Add extern function to delete a tally by its ID
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.