Skip to content

Commit

Permalink
Adding fixes to weight window generation and error message for filters
Browse files Browse the repository at this point in the history
  • Loading branch information
pshriwise committed Jun 23, 2023
1 parent 8ce5c73 commit 7bfbed7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/weight_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,16 +611,16 @@ void WeightWindows::update_magic(
// select all
auto group_view = xt::view(new_bounds, e);

double group_max = *std::max_element(group_view.begin(), group_view.end());
// normalize values in this energy group by the maximum value for this
// group
if (group_max > 0.0)
group_view /= group_max;

// divide by volume of mesh elements
for (int i = 0; i < group_view.size(); i++) {
group_view[i] /= mesh_vols[i];
}

double group_max = *std::max_element(group_view.begin(), group_view.end());
// normalize values in this energy group by the maximum value for this
// group
if (group_max > 0.0)
group_view /= 2.0 * group_max;
}

// make sure that values where the mean is zero are set s.t. the weight window
Expand Down Expand Up @@ -659,7 +659,7 @@ void WeightWindows::check_tally_update_compatibility(const Tally* tally)
if (allowed_filters.find(filter_pair.first) == allowed_filters.end()) {
fatal_error(fmt::format("Invalid filter type '{}' found on tally "
"used for weight window generation.",
model::tally_filters[filter_pair.second]->type_str()));
model::tally_filters[tally->filters(filter_pair.second)]->type_str()));
}
}

Expand Down

0 comments on commit 7bfbed7

Please sign in to comment.