mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
ensure we allocate differential tally space up front in event mode
This commit is contained in:
parent
af6d182440
commit
959bec57ae
1 changed files with 5 additions and 2 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include "openmc/geometry.h"
|
||||
#include "openmc/nuclide.h"
|
||||
#include "openmc/photon.h"
|
||||
#include "openmc/settings.h"
|
||||
#include "openmc/tallies/derivative.h"
|
||||
#include "openmc/tallies/filter.h"
|
||||
#include "openmc/tallies/tally.h"
|
||||
|
|
@ -18,8 +19,10 @@ ParticleData::ParticleData()
|
|||
|
||||
zero_delayed_bank();
|
||||
|
||||
// Every particle starts with no accumulated flux derivative.
|
||||
if (!model::active_tallies.empty()) {
|
||||
// Every particle starts with no accumulated flux derivative. Note that in
|
||||
// event mode, we construct the particle once up front, so have to run this
|
||||
// even if the current batch is inactive.
|
||||
if (!model::active_tallies.empty() || settings::event_based) {
|
||||
flux_derivs_.resize(model::tally_derivs.size());
|
||||
zero_flux_derivs();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue