2020-12-09 02:49

Source Sampling Improvements

This PR provides a number of improvements to the source sampling module and the corresponding source.F90.

1) Improved void rejection. If a particle is sampled in void, it is now resampled within the selected mesh volume element until non-void is encountered or a user-specified limit is met. Before, it would resample the full history (not just the position) which is not statistically correct.

2) Uniform sampling is now uniform for position and analog in energy (as opposed to uniform in all of phase space). I believe this to be the more useful variance reduction scheme. In addition, this eliminates the zero-weight encountered in #528.

3) In the user-specified sampling mode, if the biased PDF only has 1 energy bin and the unbiased PDF has multiple energy bins spatial biasing is performed and energy is sampled in analog (before energy was sampled uniformly). This was done for the same reasons as 2).

Minor things:

1) The unit tests and sample calculations now use different values. It just so happens that for the values I originally chose were not particularly convenient for testing uniform sampling.

2) Sampling mode integer identifiers for the Fortran interface are now indexed from 0, rather than 1. I think 0 is just a better number to mean "analog".

After I made these changes I ran the FNG ITER benchmark problem in analog, uniform, and CADIS and got statistically equivalent results.


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • weixin_39760619 weixin_39760619 5月前

    I am happy with this, but someone else should read it too since there are edits to the theory manual

    点赞 评论 复制链接分享
  • weixin_39877581 weixin_39877581 5月前

    I was going to study the names on Tuesday's ballot, but read through this instead. I think I'll sleep well knowing that is doing fine work!

    One question: In tests/test_source_sampling.py line 296, why is there a print statement in the test? (and if you remove it, presumably toss the import from future print_function line as well) I could be out of the loop and/or forgetting something though. (obviously Nose will hide the print output by default...)

    点赞 评论 复制链接分享
  • weixin_39842617 weixin_39842617 5月前

    Thanks Eric! That print statement has no business being there! It was just there for debugging. I will remove it.

    点赞 评论 复制链接分享
  • weixin_39760619 weixin_39760619 5月前

    Given 's resounding approval, merged.

    点赞 评论 复制链接分享
  • weixin_39760619 weixin_39760619 5月前


    点赞 评论 复制链接分享