Skip to content

Commit 2f09263

Browse files
committed
pymcnp: rebuilt parsers
1 parent f5cb297 commit 2f09263

File tree

779 files changed

+56373
-41688
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

779 files changed

+56373
-41688
lines changed

examples/example_box.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import pymcnp
2+
3+
4+
RADIUS_AIR = 60
5+
RADIUS_SHIELD = 15
6+
RADIUS_LEAD = 1
7+
8+
BOX_AIR = pymcnp.inp.SurfaceOption_Rpp.from_mcnp(
9+
f'rpp {-RADIUS_AIR} {RADIUS_AIR} {-RADIUS_AIR} {RADIUS_AIR} {-RADIUS_AIR} {RADIUS_AIR}'
10+
)
11+
BOX_SHIELD = pymcnp.inp.SurfaceOption_Rpp.from_mcnp(
12+
f'rpp {-RADIUS_SHIELD} {RADIUS_SHIELD} {-RADIUS_SHIELD} {RADIUS_SHIELD} {-RADIUS_SHIELD} {RADIUS_SHIELD}'
13+
)
14+
BOX_LEAD = pymcnp.inp.SurfaceOption_Rpp.from_mcnp(
15+
f'rpp {-RADIUS_LEAD} {RADIUS_LEAD} {-RADIUS_LEAD} {RADIUS_LEAD} {-RADIUS_LEAD} {RADIUS_LEAD}'
16+
)
17+
18+
MATERIAL_AIR = pymcnp.inp.DataOption_M.from_formula(1, {'N2': 0.8, 'O2': 0.2})
19+
MATERIAL_SHIELD = pymcnp.inp.DataOption_M.from_formula(2, {'TiO2': 0.5, 'PbO': 0.5})
20+
MATERIAL_LEAD = pymcnp.inp.DataOption_M.from_formula(3, {'Pb': 1})
21+
22+
inp = pymcnp.inp.Inp.from_mcnp(
23+
f"""
24+
Box Example
25+
10 1 0.5 20
26+
11 2 0.5 21:20
27+
12 3 0.5 22:21
28+
13 0 23
29+
30+
20 {BOX_AIR}
31+
21 {BOX_SHIELD}
32+
22 {BOX_LEAD}
33+
23 SO {RADIUS_AIR + RADIUS_SHIELD + RADIUS_LEAD + 1}
34+
35+
SDEF X=0 Y=0 Z=0 ERG=2.2
36+
"""[1:-1]
37+
)
38+
39+
print(inp.data)

0 commit comments

Comments
 (0)