OpenMC/tests/regression_tests/stride/test.py
ahman24 239f7fed5e
Implement user-configurable random number stride (#3067)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
2025-03-04 17:26:38 -06:00

29 lines
745 B
Python

import pytest
import openmc
from tests.testing_harness import PyAPITestHarness
@pytest.fixture
def model():
u = openmc.Material()
u.add_nuclide('U235', 1.0)
u.set_density('g/cm3', 4.5)
sph = openmc.Sphere(r=10.0, boundary_type='vacuum')
cell = openmc.Cell(fill=u, region=-sph)
model = openmc.Model()
model.geometry = openmc.Geometry([cell])
model.settings.batches = 10
model.settings.inactive = 5
model.settings.particles = 1000
model.settings.stride = 1_529_170
model.settings.source = openmc.IndependentSource(
space=openmc.stats.Box([-4, -4, -4], [4, 4, 4])
)
return model
def test_seed(model):
harness = PyAPITestHarness('statepoint.10.h5', model)
harness.main()