address PR comments

This commit is contained in:
Gavin Ridley 2021-04-29 16:23:54 -04:00
parent f0e1110e01
commit 061156e79a
35 changed files with 110 additions and 114 deletions

View file

@ -16,15 +16,15 @@ namespace openmc {
namespace simulation {
vector<ParticleBank> source_bank;
vector<SourceSite> source_bank;
SharedArray<ParticleBank> surf_source_bank;
SharedArray<SourceSite> surf_source_bank;
// The fission bank is allocated as a SharedArray, rather than a vector, as it will
// be shared by all threads in the simulation. It will be allocated to a fixed
// maximum capacity in the init_fission_bank() function. Then, Elements will be
// added to it by using SharedArray's special thread_safe_append() function.
SharedArray<ParticleBank> fission_bank;
SharedArray<SourceSite> fission_bank;
// Each entry in this vector corresponds to the number of progeny produced
// this generation for the particle located at that index. This vector is
@ -80,8 +80,8 @@ void sort_fission_bank()
// We need a scratch vector to make permutation of the fission bank into
// sorted order easy. Under normal usage conditions, the fission bank is
// over provisioned, so we can use that as scratch space.
ParticleBank* sorted_bank;
vector<ParticleBank> sorted_bank_holder;
SourceSite* sorted_bank;
vector<SourceSite> sorted_bank_holder;
// If there is not enough space, allocate a temporary vector and point to it
if (simulation::fission_bank.size() > simulation::fission_bank.capacity() / 2) {