Code Monkey home page Code Monkey logo

geouned's Introduction

GEOUNED

A tool to convert from CAD to CSG & CSG to CAD for Monte Carlo transport codes (MCNP & OpenMC). This repository contains the implementation of the algorithm presented in the paper GEOUNED: A new conversion tool from CAD to Monte Carlo geometry.

Installation

Install directly from the repository (for python versions > 3.7 => FreeCAD >= 0.19 ):

pip install git+https://github.com/GEOUNED-code/GEOUNED.git

Otherwise, the source code included in the ~src/ folder can be directly downloaded and properly reached by path variable as follows:

import sys
GEO_path='the path in your local computer'
sys.path.append('GEO_path')

the same should be made for FreeCAD libraries. You can also define appropriately the PYTHONPATH variable for both modules.

If you are using FreeCAD in windows there is included a python distribution within FreeCAD distribution (by default located in C:\Program Files\FreeCAD 0.XX\bin). In that case you can install directly de module using:

C:\Program Files\FreeCAD 0.XX\bin\python.exe -m pip install git+https://github.com/GEOUNED-code/GEOUNED.git

using this option you have directly access to both FreeCAD and GEOUNED python modules. Furthermore, using this python compabilities problems between different versions of python are avoided (some dynamic libraries of FreeCAD depends on the version of python used during the built process).

How to use

The code is used via python scripting.

The first step is to call the python modules of both FreeCAD and GEOUNED (this can be avoided if you have installed GEOUNED as commented in the previous section and using the python distributed with FreeCAD).

import sys
GEO_path='the path in your local computer, the complete or relative path to the ~src/ folder'
FreeCAD_path='path of FreeCAD python modules'
sys.path.append(GEO_path)
sys.path.append(FreeCAD_path)

The second step is to call or GEOUNED for CAD to CSG conversion or GEOReverse for CSG to CAD.

From CAD to CSG:

import GEOUNED
inifile='Name of config file for forward conversion'
GEO = GEOUNED.GEOUNED(inifile)
GEO.SetOptions()
GEO.Start()

From CSG to CAD (so far only for MCNP):

from GEOReverse.reverse import reverse
inifile='Name of config file for reverse conversion'
reverse(inifile)

In the ~scripts/ folder you can find a script (geouned for linux or geouned.py for windows) to call both modules directly by command line as follows:

windows (forward and reverse):

/~>python geouned.py file_config_name
/~>python geouned.py -r file_config_name

linux (forward and reverse):

/~>geouned file_config_name
/~>geouned -r file_config_name

Detailed descriptions of all options of the config files (forward and reverse) are given in the manual located in ~docs/ folder.

Citation

@article{CATALAN2024,
  author = {J.P. Catalán and P. Sauvan and J. García and J. Alguacil and F. Ogando and J. Sanz},
  title = {GEOUNED: A new conversion tool from CAD to Monte Carlo geometry},
  journal = {Nuclear Engineering and Technology},
  year = {2024},
  issn = {1738-5733},
  doi = {https://doi.org/10.1016/j.net.2024.01.052}
}

geouned's People

Contributors

psauvan avatar jpcatalanuned avatar mxmws avatar vwbus1967 avatar alexvalentine94 avatar py1sl avatar ecasglez avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.