Skip to content

Latest commit

 

History

History
88 lines (78 loc) · 2.13 KB

README.md

File metadata and controls

88 lines (78 loc) · 2.13 KB

MCNP Input Generator

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

Get It Now

$ git clone https://github.com/ikarino/mcnp_input_generator
$ cd mcnp_input_generator
$ pip install .

Thanks

this generator would not be possible without these great projects:

useful links

日本語情報

参考にしたWebページ