Move variables in simulation.h into simulation namespace

This commit is contained in:
Paul Romano 2018-10-09 22:34:08 -05:00
parent fd12a55b73
commit 6f80abfe2b
13 changed files with 76 additions and 63 deletions

View file

@ -264,17 +264,17 @@ void initialize_source()
}
// Read in the source bank
read_source_bank(file_id, work_index.data(), source_bank);
read_source_bank(file_id, simulation::work_index.data(), source_bank);
// Close file
file_close(file_id);
} else {
// Generation source sites from specified distribution in user input
for (int64_t i = 0; i < openmc_work; ++i) {
for (int64_t i = 0; i < simulation::work; ++i) {
// initialize random number seed
int64_t id = openmc_total_gen*settings::n_particles +
work_index[openmc::mpi::rank] + i + 1;
int64_t id = simulation::total_gen*settings::n_particles +
simulation::work_index[mpi::rank] + i + 1;
set_particle_seed(id);
// sample external source distribution
@ -287,7 +287,7 @@ void initialize_source()
write_message("Writing out initial source...", 5);
std::string filename = settings::path_output + "initial_source.h5";
hid_t file_id = file_open(filename, 'w', true);
write_source_bank(file_id, work_index.data(), source_bank);
write_source_bank(file_id, simulation::work_index.data(), source_bank);
file_close(file_id);
}
}
@ -364,10 +364,10 @@ extern "C" void fill_source_bank_fixedsource()
int64_t n;
openmc_source_bank(&source_bank, &n);
for (int64_t i = 0; i < openmc_work; ++i) {
for (int64_t i = 0; i < simulation::work; ++i) {
// initialize random number seed
int64_t id = (openmc_total_gen + overall_generation()) *
settings::n_particles + work_index[openmc::mpi::rank] + i + 1;
int64_t id = (simulation::total_gen + overall_generation()) *
settings::n_particles + simulation::work_index[mpi::rank] + i + 1;
set_particle_seed(id);
// sample external source distribution