mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Resolve conflict with weight windows and global russian roulette (#3751)
Co-authored-by: Patrick Shriwise <pshriwise@gmail.com>
This commit is contained in:
parent
5a85bd92f2
commit
c0427dd40a
13 changed files with 748 additions and 154 deletions
|
|
@ -13,5 +13,9 @@ namespace openmc {
|
|||
//! \param[in] weight_survive Weight assigned to particles that survive
|
||||
void russian_roulette(Particle& p, double weight_survive);
|
||||
|
||||
//! \brief Performs the global russian roulette operation on a particle
|
||||
//! \param[in,out] p Particle object
|
||||
void apply_russian_roulette(Particle& p);
|
||||
|
||||
} // namespace openmc
|
||||
#endif // OPENMC_PHYSICS_COMMON_H
|
||||
|
|
|
|||
|
|
@ -25,17 +25,6 @@ enum class WeightWindowUpdateMethod { MAGIC, FW_CADIS };
|
|||
|
||||
constexpr double DEFAULT_WEIGHT_CUTOFF {1.0e-38}; // default low weight cutoff
|
||||
|
||||
//==============================================================================
|
||||
// Non-member functions
|
||||
//==============================================================================
|
||||
|
||||
//! Apply weight windows to a particle
|
||||
//! \param[in] p Particle to apply weight windows to
|
||||
void apply_weight_windows(Particle& p);
|
||||
|
||||
//! Free memory associated with weight windows
|
||||
void free_memory_weight_windows();
|
||||
|
||||
//==============================================================================
|
||||
// Global variables
|
||||
//==============================================================================
|
||||
|
|
@ -137,7 +126,7 @@ public:
|
|||
|
||||
//! Retrieve the weight window for a particle
|
||||
//! \param[in] p Particle to get weight window for
|
||||
WeightWindow get_weight_window(const Particle& p) const;
|
||||
std::pair<bool, WeightWindow> get_weight_window(const Particle& p) const;
|
||||
|
||||
std::array<int, 2> bounds_size() const;
|
||||
|
||||
|
|
@ -236,6 +225,26 @@ public:
|
|||
double ratio_ {5.0}; //<! ratio of lower to upper weight window bounds
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
// Non-member functions
|
||||
//==============================================================================
|
||||
|
||||
//! Apply weight windows to a particle
|
||||
//! \param[in] p Particle to apply weight windows to
|
||||
void apply_weight_windows(Particle& p);
|
||||
|
||||
//! Apply weight window to a particle
|
||||
//! \param[in] p Particle to apply weight window to
|
||||
//! \param[in] weight_window WeightWindow to apply
|
||||
void apply_weight_window(Particle& p, WeightWindow weight_window);
|
||||
|
||||
//! Free memory associated with weight windows
|
||||
void free_memory_weight_windows();
|
||||
|
||||
//! Search weight window that apply to a particle
|
||||
//! \param[in] p Particle to search weight window for
|
||||
std::pair<bool, WeightWindow> search_weight_window(const Particle& p);
|
||||
|
||||
//! Finalize variance reduction objects after all inputs have been read
|
||||
void finalize_variance_reduction();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue