mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Tally 32-bit Overflow Fix (#3960)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
f01852411d
commit
24fdb84edc
9 changed files with 67 additions and 28 deletions
|
|
@ -51,10 +51,10 @@ inline void hash_combine(size_t& seed, const size_t v)
|
|||
// every iteration.
|
||||
struct TallyTask {
|
||||
int tally_idx;
|
||||
int filter_idx;
|
||||
int64_t filter_idx;
|
||||
int score_idx;
|
||||
int score_type;
|
||||
TallyTask(int tally_idx, int filter_idx, int score_idx, int score_type)
|
||||
TallyTask(int tally_idx, int64_t filter_idx, int score_idx, int score_type)
|
||||
: tally_idx(tally_idx), filter_idx(filter_idx), score_idx(score_idx),
|
||||
score_type(score_type)
|
||||
{}
|
||||
|
|
@ -690,7 +690,7 @@ private:
|
|||
// Private Methods
|
||||
|
||||
// Helper function for indexing
|
||||
inline int index(int64_t sr, int g) const { return sr * negroups_ + g; }
|
||||
inline int64_t index(int64_t sr, int g) const { return sr * negroups_ + g; }
|
||||
};
|
||||
|
||||
} // namespace openmc
|
||||
|
|
|
|||
|
|
@ -97,9 +97,9 @@ public:
|
|||
//! Given already-set filters, set the stride lengths
|
||||
void set_strides();
|
||||
|
||||
int32_t strides(int i) const { return strides_[i]; }
|
||||
int64_t strides(int i) const { return strides_[i]; }
|
||||
|
||||
int32_t n_filter_bins() const { return n_filter_bins_; }
|
||||
int64_t n_filter_bins() const { return n_filter_bins_; }
|
||||
|
||||
bool multiply_density() const { return multiply_density_; }
|
||||
|
||||
|
|
@ -184,9 +184,9 @@ private:
|
|||
vector<int32_t> filters_; //!< Filter indices in global filters array
|
||||
|
||||
//! Index strides assigned to each filter to support 1D indexing.
|
||||
vector<int32_t> strides_;
|
||||
vector<int64_t> strides_;
|
||||
|
||||
int32_t n_filter_bins_ {0};
|
||||
int64_t n_filter_bins_ {0};
|
||||
|
||||
//! Whether to multiply by atom density for reaction rates
|
||||
bool multiply_density_ {true};
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public:
|
|||
|
||||
FilterBinIter& operator++();
|
||||
|
||||
int index_ {1};
|
||||
int64_t index_ {1};
|
||||
double weight_ {1.};
|
||||
|
||||
vector<FilterMatch>& filter_matches_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue