Write all tracks to a single file

This commit is contained in:
Paul Romano 2022-05-17 07:33:55 -04:00
parent 2e9560a72c
commit 365aa0b0eb
6 changed files with 130 additions and 62 deletions

View file

@ -82,6 +82,11 @@ int openmc_simulation_init()
// Allocate source, fission and surface source banks.
allocate_banks();
// Create track file if needed
if (!settings::track_identifiers.empty() || settings::write_all_tracks) {
open_track_file();
}
// If doing an event-based simulation, intialize the particle buffer
// and event queues
if (settings::event_based) {
@ -152,6 +157,11 @@ int openmc_simulation_finalize()
mat->mat_nuclide_index_.clear();
}
// Close track file if open
if (!settings::track_identifiers.empty() || settings::write_all_tracks) {
close_track_file();
}
// Increment total number of generations
simulation::total_gen += simulation::current_batch * settings::gen_per_batch;