diff --git a/include/openmc/particle.h b/include/openmc/particle.h index 3888a847db..568c925e9c 100644 --- a/include/openmc/particle.h +++ b/include/openmc/particle.h @@ -219,8 +219,8 @@ public: void write_restart() const; //! Gets the pointer to the particle's current PRN seed - uint64_t* current_seed(); - const uint64_t* current_seed() const; + uint64_t* current_seed() {return seeds_ + stream_;} + const uint64_t* current_seed() const {return seeds_ + stream_;} //========================================================================== // Data members diff --git a/openmc/lib/math.py b/openmc/lib/math.py index 991df8f9cc..a2a7e0d9b0 100644 --- a/openmc/lib/math.py +++ b/openmc/lib/math.py @@ -5,7 +5,7 @@ from numpy.ctypeslib import ndpointer from . import _dll -from random import randint +from random import getrandbits _dll.t_percentile.restype = c_double @@ -210,7 +210,7 @@ def rotate_angle(uvw0, mu, phi, prn_seed=None): """ if prn_seed is None: - prn_seed = randint(0,10000000) + prn_seed = getrandbits(64) uvw0_arr = np.array(uvw0, dtype=np.float64) if phi is None: diff --git a/src/particle.cpp b/src/particle.cpp index f7bce7367b..5f6baaf571 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -678,7 +678,4 @@ Particle::write_restart() const } // #pragma omp critical } -uint64_t* Particle::current_seed() {return seeds_ + stream_;} -const uint64_t* Particle::current_seed() const {return seeds_ + stream_;} - } // namespace openmc