Converts CAD files to a DAGMC h5m file
Project description
Testing package and running examples
Testing with Model Benchmark Zoo
A minimal package that uses CadQuery functionality to convert CAD geometry to DAGMC h5m files
This particular method of producing DAGMC compatible h5m files from CAD geometry is intended to convert STP files or CadQuery objects to a DAGMC compatible h5m file.
The resulting DAGMC geometry can then be used for simulations in OpenMC or other supported codes.
This package is tested with pytest tests and also the DAGMC geometry made with this package is compared to simulation carried out with native constructive solid geometry, see Model Benchmark Zoo for more details.
Also checkout these other packages that also create DAGMC geometry CAD-to-OpenMC, Stellarmesh
Installation prerequisite
In principle, any Conda/Mamba distribution will work. A few Conda/Mamba options are:
Install using Mamba and pip
This example assumes you have installed the MambaForge option or separately
installed Mamba with conda install -c conda-forge mamba -y
Create a new conda environment, I've chosen Python 3.9 here but new versions are also supported.
mamba create --name new_env python=3.9 -y
Activate the environment
mamba activate new_env
Install the dependencies
mamba install -c cadquery -c conda-forge moab gmsh python-gmsh cadquery=master -y
Then you can install the cad_to_dagmc package with pip
pip install cad_to_dagmc
You may also want to install OpenMC with DAGMC to make use of the h5m geometry files produced in simulations. However you could also use other supported particle transport codes such as MCNP, FLUKA and others link to DAGMC documentation.You can run conda install -c conda-forge openmc
however this more specific command makes sure the latest version of OpenMC which contains DAGMC is chosen by conda / mamba
mamba install -c conda-forge -y "openmc=0.13.3=dagmc*nompi*"
Install using Conda and pip
This example uses Conda to install some dependencies that are not available via PyPi.
Create a new conda environment
conda create --name new_env python=3.9 -y
Activate the environment
conda activate new_env
Install the dependencies
conda install -c cadquery -c conda-forge moab gmsh python-gmsh cadquery=master -y
Then you can install the cad_to_dagmc package with pip
pip install cad_to_dagmc
You may also want to install OpenMC with DAGMC to make use of the h5m geometry files produced in simulations. However you could also use other supported particle transport codes such as MCNP, FLUKA and others link to DAGMC documentation.You can run conda install -c conda-forge openmc
however this more specific command makes sure the latest version of OpenMC which contains DAGMC is chosen by conda / mamba
conda install -c conda-forge -y "openmc=0.13.3=dagmc*nompi*"
Usage - creation of DAGMC h5m files
For examples see the examples folder
Usage - simulation with transport code
For examples see the CAD tasks in the neutronics-workshop
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cad_to_dagmc-0.5.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f15652f157cd7a214c7966b18071903467dbf10fead39386855b9f866ff884b0 |
|
MD5 | 67b89f2421699df732bab3325143307e |
|
BLAKE2b-256 | 19ce72d01cb2e4a2a695660675d9c8182d1722c6b24e4df98126f8e778794351 |