mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Apply suggestions from code review
Co-Authored-By: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
c60a7e569f
commit
5066bfa42d
4 changed files with 10 additions and 13 deletions
|
|
@ -171,7 +171,7 @@ public:
|
|||
int delayed_group;
|
||||
Type particle;
|
||||
int64_t parent_id;
|
||||
bool operator < (const Bank & bank) const{ return (parent_id < bank.parent_id); }
|
||||
bool operator<(const Bank& bank) const { return (parent_id < bank.parent_id); }
|
||||
};
|
||||
|
||||
//! Saved ("banked") state of a particle, for nu-fission tallying
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ int64_t fission_bank_max;
|
|||
void free_memory_bank()
|
||||
{
|
||||
simulation::source_bank.clear();
|
||||
if( simulation::fission_bank != nullptr )
|
||||
if (simulation::fission_bank)
|
||||
delete[] simulation::fission_bank;
|
||||
simulation::fission_bank = nullptr;
|
||||
simulation::fission_bank_length = 0;
|
||||
|
|
|
|||
|
|
@ -182,13 +182,11 @@ create_fission_sites(Particle* p, int i_nuclide, const Reaction* rx)
|
|||
|
||||
for (int i = 0; i < nu; ++i) {
|
||||
Particle::Bank* site;
|
||||
if(use_fission_bank)
|
||||
{
|
||||
if (use_fission_bank) {
|
||||
int64_t idx;
|
||||
#pragma omp atomic capture
|
||||
idx = simulation::fission_bank_length++;
|
||||
if( idx >= simulation::fission_bank_max )
|
||||
{
|
||||
if (idx >= simulation::fission_bank_max) {
|
||||
warning("The shared fission bank is full. Additional fission sites created "
|
||||
"in this generation will not be banked.");
|
||||
#pragma omp atomic write
|
||||
|
|
@ -222,8 +220,7 @@ create_fission_sites(Particle* p, int i_nuclide, const Reaction* rx)
|
|||
}
|
||||
|
||||
// Write fission particles to nuBank
|
||||
if(use_fission_bank)
|
||||
{
|
||||
if (use_fission_bank) {
|
||||
Particle::NuBank* nu_bank_entry;
|
||||
p->nu_bank_.emplace_back();
|
||||
nu_bank_entry = &p->nu_bank_.back();
|
||||
|
|
@ -235,8 +232,7 @@ create_fission_sites(Particle* p, int i_nuclide, const Reaction* rx)
|
|||
|
||||
// If shared fission bank was full, and no fissions could be added,
|
||||
// set the particle fission flag to false.
|
||||
if( nu == skipped )
|
||||
{
|
||||
if (nu == skipped) {
|
||||
p->fission_ = false;
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -563,12 +563,13 @@ void transport_history_based_single_particle(Particle& p)
|
|||
while (true) {
|
||||
p.event_calculate_xs();
|
||||
p.event_advance();
|
||||
if( p.collision_distance_ > p.boundary_.distance )
|
||||
if (p.collision_distance_ > p.boundary_.distance) {
|
||||
p.event_cross_surface();
|
||||
else
|
||||
} else {
|
||||
p.event_collide();
|
||||
}
|
||||
p.event_revive_from_secondary();
|
||||
if(!p.alive_)
|
||||
if (!p.alive_)
|
||||
break;
|
||||
}
|
||||
p.event_death();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue