Add a new bank type surf_src_bank for surface source banking

This commit is contained in:
YoungHui Park 2020-03-17 00:01:08 -05:00
parent cfed9cda8e
commit 209394082e
3 changed files with 8 additions and 0 deletions

View file

@ -18,6 +18,8 @@ namespace simulation {
extern std::vector<Particle::Bank> source_bank;
extern std::vector<Particle::Bank> surf_src_bank;
extern SharedArray<Particle::Bank> fission_bank;
extern std::vector<int64_t> progeny_per_particle;

View file

@ -17,6 +17,8 @@ namespace simulation {
std::vector<Particle::Bank> source_bank;
std::vector<Particle::Bank> surf_src_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
@ -37,6 +39,7 @@ std::vector<int64_t> progeny_per_particle;
void free_memory_bank()
{
simulation::source_bank.clear();
simulation::surf_src_bank.clear();
simulation::fission_bank.clear();
simulation::progeny_per_particle.clear();
}

View file

@ -283,8 +283,11 @@ void allocate_banks()
{
// Allocate source bank
simulation::source_bank.resize(simulation::work_per_rank);
// Allocate fission bank
init_fission_bank(3*simulation::work_per_rank);
simulation::surf_src_bank.resize(simulation::work_per_rank);
}
void initialize_batch()