mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
use base class to handle layout of particle data
This commit is contained in:
parent
5cf8482d9a
commit
2af4c9cd92
39 changed files with 834 additions and 795 deletions
10
src/bank.cpp
10
src/bank.cpp
|
|
@ -15,15 +15,15 @@ namespace openmc {
|
|||
|
||||
namespace simulation {
|
||||
|
||||
std::vector<Particle::Bank> source_bank;
|
||||
std::vector<ParticleBank> source_bank;
|
||||
|
||||
SharedArray<Particle::Bank> surf_source_bank;
|
||||
SharedArray<ParticleBank> 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<Particle::Bank> fission_bank;
|
||||
SharedArray<ParticleBank> 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
|
||||
|
|
@ -79,8 +79,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.
|
||||
Particle::Bank* sorted_bank;
|
||||
std::vector<Particle::Bank> sorted_bank_holder;
|
||||
ParticleBank* sorted_bank;
|
||||
std::vector<ParticleBank> 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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue