mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Add warning of possible overflow.
This commit is contained in:
parent
b7cbd59a13
commit
2a802a11a4
2 changed files with 12 additions and 0 deletions
|
|
@ -225,6 +225,13 @@ vector<VolumeCalculation::Result> VolumeCalculation::execute() const
|
|||
iterations++;
|
||||
size_t total_samples = iterations * n_samples_;
|
||||
|
||||
// warn user if total sample size is greater than what the size_t type can
|
||||
// represent
|
||||
if (total_samples > SIZE_T_MAX) {
|
||||
warning("The number of samples has exceeded the size_t type. Volume "
|
||||
"results may be inaccurate.");
|
||||
}
|
||||
|
||||
// reset
|
||||
double trigger_val = -INFTY;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue