File tree Expand file tree Collapse file tree 2 files changed +14
-23
lines changed
tests/regression_tests/periodic_cyls Expand file tree Collapse file tree 2 files changed +14
-23
lines changed Original file line number Diff line number Diff line change @@ -191,21 +191,6 @@ RotationalPeriodicBC::RotationalPeriodicBC(
191191 // to the correct axis
192192 Direction norm1 = surf1.normal ({0 , 0 , 0 });
193193 Direction norm2 = surf2.normal ({0 , 0 , 0 });
194- if (std::abs (norm1[zero_axis_idx]) > FP_PRECISION) {
195- throw std::invalid_argument (fmt::format (
196- " Rotational periodic BCs are only "
197- " supported for rotations about the z-axis, but surface {} is not "
198- " perpendicular to the z-axis." ,
199- surf1.id_ ));
200- }
201- if (std::abs (norm2[zero_axis_idx]) > FP_PRECISION) {
202- throw std::invalid_argument (fmt::format (
203- " Rotational periodic BCs are only "
204- " supported for rotations about the z-axis, but surface {} is not "
205- " perpendicular to the z-axis." ,
206- surf2.id_ ));
207- }
208-
209194 // Make sure both surfaces intersect the origin
210195 if (std::abs (surf1.evaluate ({0 , 0 , 0 })) > FP_COINCIDENT) {
211196 throw std::invalid_argument (fmt::format (
Original file line number Diff line number Diff line change 11import openmc
2- import numpy
2+ import numpy as np
33import pytest
4-
4+ from openmc . utility_funcs import change_directory
55from tests .testing_harness import PyAPITestHarness
66
77
@@ -40,6 +40,7 @@ def xcyl_model():
4040 model .settings .source = openmc .IndependentSource (space = openmc .stats .Box (
4141 (0 , 0 , 0 ), (20 , 20 , 20 ))
4242 )
43+ return model
4344
4445@pytest .fixture
4546def ycyl_model ():
@@ -75,11 +76,16 @@ def ycyl_model():
7576 model .settings .source = openmc .IndependentSource (space = openmc .stats .Box (
7677 (0 , 0 , 0 ), (20 , 20 , 20 ))
7778 )
79+ return model
7880
79-
80- @pytest .mark .parametrize ('cyl_model' , ['xcyl_model' ,'ycyl_model' ])
81- def test_periodic (cyl_model ):
82- with change_directory (cyl_model ):
83- harness = PyAPITestHarness ('statepoint.4.h5' , cyl_model )
81+ def test_xcyl (xcyl_model ):
82+ with change_directory ("xcyl_model" ):
83+ openmc .reset_auto_ids ()
84+ harness = PyAPITestHarness ('statepoint.4.h5' , xcyl_model )
8485 harness .main ()
85- assert
86+
87+ def test_ycyl (ycyl_model ):
88+ with change_directory ("ycyl_model" ):
89+ openmc .reset_auto_ids ()
90+ harness = PyAPITestHarness ('statepoint.4.h5' , ycyl_model )
91+ harness .main ()
You can’t perform that action at this time.
0 commit comments