From a4fa21eea54ca66879978a6a3cdfe5cb325772b6 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Wed, 5 May 2021 23:17:28 -0500 Subject: [PATCH] Fixing rotation test. --- tests/regression_tests/rotation/geometry.xml | 11 +++++ tests/regression_tests/rotation/materials.xml | 14 +++++++ tests/regression_tests/rotation/settings.xml | 15 +++++++ tests/regression_tests/rotation/test.py | 40 ++----------------- 4 files changed, 43 insertions(+), 37 deletions(-) create mode 100644 tests/regression_tests/rotation/geometry.xml create mode 100644 tests/regression_tests/rotation/materials.xml create mode 100644 tests/regression_tests/rotation/settings.xml diff --git a/tests/regression_tests/rotation/geometry.xml b/tests/regression_tests/rotation/geometry.xml new file mode 100644 index 0000000000..f324617065 --- /dev/null +++ b/tests/regression_tests/rotation/geometry.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/tests/regression_tests/rotation/materials.xml b/tests/regression_tests/rotation/materials.xml new file mode 100644 index 0000000000..160c9c6789 --- /dev/null +++ b/tests/regression_tests/rotation/materials.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/tests/regression_tests/rotation/settings.xml b/tests/regression_tests/rotation/settings.xml new file mode 100644 index 0000000000..70b4e802f8 --- /dev/null +++ b/tests/regression_tests/rotation/settings.xml @@ -0,0 +1,15 @@ + + + + eigenvalue + 10 + 5 + 1000 + + + + -4 -4 -4 4 4 4 + + + + diff --git a/tests/regression_tests/rotation/test.py b/tests/regression_tests/rotation/test.py index 6b68367b40..31c3d8d655 100644 --- a/tests/regression_tests/rotation/test.py +++ b/tests/regression_tests/rotation/test.py @@ -1,40 +1,6 @@ -import openmc -import pytest - -from tests.testing_harness import TestHarness, PyAPITestHarness - -@pytest.fixture -def model(): - model = openmc.model.Model() - - fuel = openmc.Material() - fuel.set_density('g/cc', 10.0) - fuel.add_nuclide('U235', 1.0) - - h1 = openmc.Material() - h1.set_density('g/cc', 0.1) - h1.add_nuclide('H1', 0.1) - - outer_sphere = openmc.Sphere(r=10.0, boundary_type='vacuum') - inner_sphere = openmc.Sphere(x0=1.0, r=5.0) - - fuel_cell = openmc.Cell(fill=fuel, region=-inner_sphere) - hydrogen_cell = openmc.Cell(fill=h1, region=+inner_sphere) - univ = openmc.Universe(cells=[fuel_cell, hydrogen_cell]) - outer_cell = openmc.Cell(fill=univ, region=-outer_sphere) - outer_cell.rotation = (10, 20, 30) - - model.geometry = openmc.Geometry(root=[outer_cell]) - - model.settings.particles = 1000 - model.settings.inactive = 5 - model.settings.batches = 10 - source_box = openmc.stats.Box((-4., -4., -4.), (4., 4., 4.)) - model.settings.source = openmc.Source(space=source_box) - - return model +from tests.testing_harness import TestHarness -def test_rotation(model): - harness = PyAPITestHarness('statepoint.10.h5', model) +def test_rotation(): + harness = TestHarness('statepoint.10.h5') harness.main()