Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed OpenmcDriver::index_filter_, replaced with local variable #64

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion include/enrico/openmc_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<CellInstance> cells_; //!< Array of cell instances
int n_fissionable_cells_; //!< Number of fissionable cells in model
};
Expand Down
10 changes: 5 additions & 5 deletions src/openmc_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ OpenmcDriver::OpenmcDriver(MPI_Comm comm)
void OpenmcDriver::create_tallies(gsl::span<int32_t> 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;
Expand All @@ -69,7 +69,7 @@ void OpenmcDriver::create_tallies(gsl::span<int32_t> materials)
std::vector<std::string> 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<double, 1> OpenmcDriver::heat_source(double power) const
Expand Down