changed name and return type. added signature to capi.h. TODO error handling in tally.cpp

This commit is contained in:
lewisgross1296 2022-08-11 13:45:28 -05:00
parent 3730496018
commit 30b1ae92cb
2 changed files with 3 additions and 1 deletions

View file

@ -118,6 +118,7 @@ int openmc_regular_mesh_get_params(
int openmc_regular_mesh_set_dimension(int32_t index, int n, const int* dims);
int openmc_regular_mesh_set_params(int32_t index, int n, const double* ll,
const double* ur, const double* width);
int openmc_remove_tally(int32_t id);
int openmc_reset();
int openmc_reset_timers();
int openmc_run();

View file

@ -1273,12 +1273,13 @@ extern "C" size_t tallies_size()
}
// given a tally ID, remove it from the tallies vector
extern "C" void openmc_remove_tally_from_tallies(int32_t id)
extern "C" int openmc_remove_tally(int32_t id)
{
// query map for index corersponding to the given id
int32_t index = model::tally_map[id];
// delete the tally via iterator pointing to correct position
model::tallies.erase(model::tallies.begin() + index);
return 0;
}
} // namespace openmc