Statepoint file loading refactor and CAPI function (#2886)

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Patrick Shriwise 2024-04-24 17:09:56 -05:00 committed by GitHub
parent 3370ce1978
commit f543c007a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 104 additions and 24 deletions

View file

@ -54,8 +54,14 @@ int openmc_run()
openmc::simulation::time_total.start();
openmc_simulation_init();
int err = 0;
// Ensure that a batch isn't executed in the case that the maximum number of
// batches has already been run in a restart statepoint file
int status = 0;
if (openmc::simulation::current_batch >= openmc::settings::n_max_batches) {
status = openmc::STATUS_EXIT_MAX_BATCH;
}
int err = 0;
while (status == 0 && err == 0) {
err = openmc_next_batch(&status);
}