mit-crpg/openmc — pull request #249 by nelsonag (2014-03-07 19:56:16+00:00)
Title: Fixed p_valid sampling of energy distributions.

While looking at a similar block of code in my research code, I found that the p_valid sampling inside of sample_energy was incorrect. Specifically, the code checked to see if p_valid % n_regions was greater than - before trying to sample in to the next nested energy distribution. This initial check is unnecessary since p_valid % n_regions has nothing to do with whether or not the probability of law validity is or is not 1.0.

I specifically ran in to this issue with Hf-174 in the .71c library (72174.71c) distributed with MCNP, both N_2N and N_NC reaction channels have nested edists.

I am using a pull request for this change vice a direct commit because I would like someone to double check my reasoning. I think I am right, but the original author of this section probably knows something I dont.