From 9c4c9faabf23df311b6e36904a26c00cc03c7d1f Mon Sep 17 00:00:00 2001 From: RonRahaman Date: Mon, 12 Aug 2019 10:01:46 -0500 Subject: [PATCH] Removed OpenmcDriver::index_filter_, replaced with local variable --- include/enrico/openmc_driver.h | 1 - src/openmc_driver.cpp | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/enrico/openmc_driver.h b/include/enrico/openmc_driver.h index 7c0ca3f6..ccc760f3 100644 --- a/include/enrico/openmc_driver.h +++ b/include/enrico/openmc_driver.h @@ -47,7 +47,6 @@ class OpenmcDriver : public NeutronicsDriver { // Data openmc::Tally* tally_; //!< Fission energy deposition tally - int32_t index_filter_; //!< Index in filters arrays for material filter std::vector cells_; //!< Array of cell instances int n_fissionable_cells_; //!< Number of fissionable cells in model }; diff --git a/src/openmc_driver.cpp b/src/openmc_driver.cpp index ce96a06b..0a65bf23 100644 --- a/src/openmc_driver.cpp +++ b/src/openmc_driver.cpp @@ -51,16 +51,16 @@ OpenmcDriver::OpenmcDriver(MPI_Comm comm) void OpenmcDriver::create_tallies(gsl::span materials) { // Determine maximum tally/filter ID used so far - int32_t filter_id, tally_id; + int32_t index_filter, filter_id, tally_id; openmc_get_filter_next_id(&filter_id); openmc_get_tally_next_id(&tally_id); - err_chk(openmc_new_filter("material", &index_filter_)); - err_chk(openmc_filter_set_id(index_filter_, filter_id)); + err_chk(openmc_new_filter("material", &index_filter)); + err_chk(openmc_filter_set_id(index_filter, filter_id)); // Set bins for filter err_chk( - openmc_material_filter_set_bins(index_filter_, materials.size(), materials.data())); + openmc_material_filter_set_bins(index_filter, materials.size(), materials.data())); // Create tally and assign scores/filters int32_t index_tally; @@ -69,7 +69,7 @@ void OpenmcDriver::create_tallies(gsl::span materials) std::vector scores{"kappa-fission"}; tally_ = openmc::model::tallies[index_tally].get(); tally_->set_scores(scores); - tally_->set_filters(&index_filter_, 1); + tally_->set_filters(&index_filter, 1); } xt::xtensor OpenmcDriver::heat_source(double power) const