OpenMC/tests/regression_tests/dagmc/uwuw/test.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
1.1 KiB
Python
Raw Permalink Normal View History

2018-12-03 21:44:25 -06:00
import openmc
2019-09-05 07:31:13 -05:00
import openmc.lib
2018-12-03 21:44:25 -06:00
from openmc.stats import Box
import pytest
from tests.testing_harness import PyAPITestHarness
pytestmark = pytest.mark.skipif(
2024-04-24 12:05:11 -04:00
not openmc.lib._uwuw_enabled(),
reason="UWUW is not enabled.")
2018-12-03 21:44:25 -06:00
class UWUWTest(PyAPITestHarness):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
2018-12-03 21:44:25 -06:00
# settings
self._model.settings.batches = 5
self._model.settings.inactive = 0
self._model.settings.particles = 100
2018-12-03 21:44:25 -06:00
source = openmc.IndependentSource(space=Box([-4, -4, -4],
[ 4, 4, 4]))
self._model.settings.source = source
2018-12-03 21:44:25 -06:00
# geometry
dag_univ = openmc.DAGMCUniverse("dagmc.h5m")
self._model.geometry = openmc.Geometry(root=dag_univ)
2018-12-03 21:44:25 -06:00
# tally
tally = openmc.Tally()
tally.scores = ['total']
tally.filters = [openmc.CellFilter(1)]
self._model.tallies = [tally]
2018-12-03 21:44:25 -06:00
2018-12-03 21:44:25 -06:00
def test_uwuw():
harness = UWUWTest('statepoint.5.h5', model=openmc.Model())
harness.main()