We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f73c3e0 commit 1289879Copy full SHA for 1289879
pyro/compressible/problems/convection.py
@@ -42,6 +42,9 @@ def init_data(my_data, rp):
42
ymom[:, :] = 0.0
43
dens[:, :] = dens_cutoff
44
45
+ # create a seeded random number generator
46
+ rng = np.random.default_rng(12345)
47
+
48
# set the density to be stratified in the y-direction
49
myg = my_data.grid
50
@@ -75,7 +78,7 @@ def init_data(my_data, rp):
75
78
ener[:, :] = p[:, :]/(gamma - 1.0)
76
79
77
80
# pairs of random numbers between [-1, 1]
- vel_pert = 2.0 * np.random.random_sample((myg.qx, myg.qy, 2)) - 1
81
+ vel_pert = 2.0 * rng.random(size=(myg.qx, myg.qy, 2)) - 1
82
83
cs = np.sqrt(gamma * p / dens)
84
0 commit comments