ikarino / mcnp_input_generator

an unofficial MCNP input file generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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ページ

About

an unofficial MCNP input file generator

License:MIT License


Languages

Language:Python 96.5%Language:OpenSCAD 3.5%