mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Moved seed accessor functions into header. Changed python rotate_angle default seed generation technique.
This commit is contained in:
parent
163d16f091
commit
c84fc282a5
3 changed files with 4 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue