mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
used placeholders namespace and added comment about variables initialized
This commit is contained in:
parent
2c5a845897
commit
c38ed4d875
2 changed files with 6 additions and 3 deletions
|
|
@ -46,6 +46,8 @@ vector<unique_ptr<PhotonInteraction>> elements;
|
|||
|
||||
PhotonInteraction::PhotonInteraction(hid_t group)
|
||||
{
|
||||
using namespace xt::placeholders;
|
||||
|
||||
// Set index of element in global vector
|
||||
index_ = data::elements.size();
|
||||
|
||||
|
|
@ -164,8 +166,8 @@ PhotonInteraction::PhotonInteraction(hid_t group)
|
|||
close_dataset(dset);
|
||||
read_dataset(tgroup, "xs", xs);
|
||||
|
||||
auto cross_section = xt::view(
|
||||
cross_sections_, xt::range(shell.threshold, xt::placeholders::_), i);
|
||||
auto cross_section =
|
||||
xt::view(cross_sections_, xt::range(shell.threshold, _), i);
|
||||
cross_section = xt::where(xs > 0, xt::log(xs), 0);
|
||||
|
||||
if (object_exists(tgroup, "transitions")) {
|
||||
|
|
|
|||
|
|
@ -347,7 +347,8 @@ void sample_photon_reaction(Particle& p)
|
|||
double prob_after = prob + micro.photoelectric;
|
||||
|
||||
if (prob_after > cutoff) {
|
||||
|
||||
// Get grid index, interpolation factor, and bounding subshell
|
||||
// cross sections
|
||||
int i_grid = micro.index_grid;
|
||||
double f = micro.interp_factor;
|
||||
const auto& xs_lower = xt::row(element.cross_sections_, i_grid);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue