2024-11-20 14:15:41 -06:00
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
from openmc.examples import random_ray_three_region_cube
|
|
|
|
|
|
|
|
|
|
from tests.testing_harness import TolerantPyAPITestHarness
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MGXSTestHarness(TolerantPyAPITestHarness):
|
|
|
|
|
def _cleanup(self):
|
|
|
|
|
super()._cleanup()
|
|
|
|
|
f = 'mgxs.h5'
|
|
|
|
|
if os.path.exists(f):
|
|
|
|
|
os.remove(f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_random_ray_adjoint_fixed_source():
|
|
|
|
|
model = random_ray_three_region_cube()
|
|
|
|
|
model.settings.random_ray['adjoint'] = True
|
2025-02-25 10:34:28 -06:00
|
|
|
model.settings.random_ray['volume_estimator'] = 'naive'
|
|
|
|
|
model.settings.particles = 500
|
2024-11-20 14:15:41 -06:00
|
|
|
harness = MGXSTestHarness('statepoint.10.h5', model)
|
|
|
|
|
harness.main()
|