Moved seed accessor functions into header. Changed python rotate_angle default seed generation technique.

This commit is contained in:
John Tramm 2019-12-06 14:56:42 +00:00
parent 163d16f091
commit c84fc282a5
3 changed files with 4 additions and 7 deletions

View file

@ -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

View file

@ -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:

View file

@ -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