File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -339,6 +339,11 @@ enum class RunMode {
339339
340340enum class GeometryType { CSG, DAG };
341341
342+ // ==============================================================================
343+ // Volume Calculation Constants
344+
345+ constexpr size_t SIZE_T_MAX {std::numeric_limits<size_t >::max ()};
346+
342347} // namespace openmc
343348
344349#endif // OPENMC_CONSTANTS_H
Original file line number Diff line number Diff line change @@ -225,6 +225,13 @@ vector<VolumeCalculation::Result> VolumeCalculation::execute() const
225225 iterations++;
226226 size_t total_samples = iterations * n_samples_;
227227
228+ // warn user if total sample size is greater than what the size_t type can
229+ // represent
230+ if (total_samples > SIZE_T_MAX) {
231+ warning (" The number of samples has exceeded the size_t type. Volume "
232+ " results may be inaccurate." );
233+ }
234+
228235 // reset
229236 double trigger_val = -INFTY;
230237
You can’t perform that action at this time.
0 commit comments