Skip to content

Commit 64c464b

Browse files
committed
Expand tests for fill transformations
1 parent 0b11ae4 commit 64c464b

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

src/openmc_mcnp_adapter/openmc_conversion.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ def get_openmc_universes(cells, surfaces, materials, data):
536536

537537
# Apply transformation to fill
538538
if 'fill' in c['parameters']:
539+
# TODO: Check for existing transformations on the fill
539540
fill = c['parameters']['fill']
540541
if use_degrees:
541542
c['parameters']['*fill'] = f'{fill} {trcl}'

tests/test_geometry.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,32 @@ def test_trcl(cell_card, surface_cards, points_inside, points_outside):
135135
assert point not in cell.region
136136

137137

138-
def test_trcl_fill():
139-
mcnp_str = dedent("""
138+
@mark.parametrize(
139+
"keywords",
140+
[
141+
"FILL=10 TRCL=(2.0 0.0 0.0)",
142+
"FILL=10(2.0 0.0 0.0)",
143+
"FILL=10 TRCL=(2.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0)",
144+
"FILL=10(2.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0)",
145+
"FILL=10 *TRCL=(2.0 0.0 0.0 0.0 90.0 90.0 90.0 0.0 90.0 90.0 90.0 0.0)",
146+
"*FILL=10(2.0 0.0 0.0 0.0 90.0 90.0 90.0 0.0 90.0 90.0 90.0 0.0)",
147+
"FILL=10(1)",
148+
"FILL=10(2)",
149+
]
150+
)
151+
def test_fill_transformation(keywords):
152+
mcnp_str = dedent(f"""
140153
title
141-
1 0 -1 FILL=10 TRCL=(2.0 0.0 0.0)
154+
1 0 -1 {keywords}
142155
2 0 -2 U=10
143156
3 0 +2 U=10
144157
145158
1 so 10.0
146159
2 so 1.0
147160
148-
m1 1001.80c 1.0
161+
m1 1001.80c 1.0
162+
tr1 2.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0
163+
*tr2 2.0 0.0 0.0 0.0 90.0 90.0 90.0 0.0 90.0 90.0 90.0 0.0
149164
""")
150165
model = mcnp_str_to_model(mcnp_str)
151166
geometry = model.geometry

0 commit comments

Comments
 (0)