Preallocate space for k_generation and entropy from C++

This commit is contained in:
Paul Romano 2018-10-16 21:55:34 -05:00
parent acfc352e1b
commit b35e570645
3 changed files with 5 additions and 11 deletions

View file

@ -12,6 +12,7 @@
#include "openmc/distribution.h"
#include "openmc/distribution_multi.h"
#include "openmc/distribution_spatial.h"
#include "openmc/eigenvalue.h"
#include "openmc/error.h"
#include "openmc/file_utils.h"
#include "openmc/mesh.h"
@ -141,7 +142,10 @@ void get_run_parameters(pugi::xml_node node_base)
gen_per_batch = std::stoi(get_node_value(node_base, "generations_per_batch"));
}
// TODO: Preallocate space for keff and entropy by generation
// Preallocate space for keff and entropy by generation
int m = settings::n_max_batches * settings::gen_per_batch;
simulation::k_generation.reserve(m);
entropy.reserve(m);
// Get the trigger information for keff
if (check_for_node(node_base, "keff_trigger")) {