From c38ed4d8759704e829454abfc12dfa2189dd4bf1 Mon Sep 17 00:00:00 2001 From: myerspat Date: Wed, 29 Jun 2022 09:37:18 -0500 Subject: [PATCH] used placeholders namespace and added comment about variables initialized --- src/photon.cpp | 6 ++++-- src/physics.cpp | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/photon.cpp b/src/photon.cpp index a127ac2fe..2f9bc5e3d 100644 --- a/src/photon.cpp +++ b/src/photon.cpp @@ -46,6 +46,8 @@ vector> 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")) { diff --git a/src/physics.cpp b/src/physics.cpp index cc712affd..bcdcf7ecf 100644 --- a/src/physics.cpp +++ b/src/physics.cpp @@ -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);