unofficial mcnp input file generator.
from mcnp_input_generator import load
_inp = {
"title": "test",
"cells": [
{
"_name": "outside world",
"snames": ["+world"],
"matname": "void",
},
{
"snames": ["-world", "+mycylinder"],
"matname": "water"
},
{
"snames": ["-mycylinder"],
"matname": "iron",
}
],
"surfaces": [
{
"name": "world",
"shape": "RPP",
"data": [-100, 100, -100, 100, -100, 100]
},
{
"name": "mycylinder",
"shape": "cylinder",
"data": [0, 0, 0, 0, 0, 10, 5]
}
],
"data": {
"mode": "p",
"materials": [
{
"matname": "iron",
"_mass_fractions": {
"28000": 1,
},
"density": 7.8,
"color": "gray"
},
{
"matname": "water",
"_atomic_fractions": {
"1000": 2,
"16000": 1,
},
"density": 0.988,
"color": "blue",
},
]
}
}
mig = load(_inp)
mig.openscad("test_generator.scad")
# => visualized with openscad, see below links
mig.to_inp("inp")
# => mcnp input
$ git clone https://github.com/ikarino/mcnp_input_generator
$ cd mcnp_input_generator
$ pip install .
this generator would not be possible without these great projects:
- geometry visulaization: OpenSCAD and SolidPython
- inputs deserialization: marshmallow