FitsGeo: Python 3 package for PHITS geometry development and visualization

3 minute read

Published:

The idea of FitsGeo development came to me after some time of work with PHITS. PHITS is a Monte Carlo (MC) transport code similar to MCNP and certainly has some advantages comparing to other codes such as FLUKA. However, one main disadvantage related to convenience of use is visualization of geometry of input files. By that I mean that you don’t have a full control on your geometry while preparing your input file as it does Flair, which is advanced UI for FLUKA.

The part of the work related to geometry setting is usually the most time-consuming and painstaking when working in such MC transport codes.

Also, if you can’t just rotate your geometry and look on that from various angles may result in some mistakes which later may cost a lot of time to debug and to rerun these corrupted input files with bad geometries if you noticed these problems with geometry only on a final stage while performing calculations.

All these highlighted problems suggests that some tool to create 3D visualization of geometry from PHITS input files are in need.

You may say, that, actually, PHITS is already have such options for visualization: ANGEL code and recent PHIG-3D feature. Yes, you will be right, this helps, but here I am talking about more CAD-like visualization where you have the ability to manually put your objects, drag them, size them and so on, see what Flair does in this regard for example. This is a really powerful tool which I want to see for PHITS as well, because I worked some time with FLUKA+Flair and that was an amazing experience.

All these speculations stuck in my mind, and I wanted to create something for my self to handle geometry with PHITS in easier way. Surely, FitsGeo is also not the pure CAD system, it is just allows to reproduce all the defined via python coding geometry and view it using VPython. Still, this approach has some interesting features including OOP paradigm, due to use of Python and some additional features like using databases with predefined materials.

The visualization capability of FitsGeo now a bit outdated because of the new PHIG-3D tool announced by PHITS team. However, at the time of FitsGeo development there wasn’t a tool to view your geometry interactively in 3D.

Current status

I wanted to improve FitsGeo in future to be able to fully write input files and export all PHITS sections to files, but currently, FitsGeo is suspended, because I am lazy and lack of enthusiasm, that was just a side project for me which helped a lot in improvement of my skills in documentation and programming (however, I want to say sorry for native English-speaking persons and more skilled programmers 🙃).

The full code is available on the GitHub project page, also, I’ve published a preprint with the description of this package and detailed docs are available here.

If you are interested in this project somehow, feel free to fork it from GitHub or contact me for any suggestions!

Leave a Comment