Converts CAD files to a DAGMC h5m file using Cubit
Project description
This is a minimal Python package that provides both command line and API interfaces for converting multiple CAD files (STP and SAT format) into a DAGMC h5m file using the Cubit Python API.
This is useful for creating the DAGMC geometry for use in compatible neutronics codes such as OpenMC, FLUKA and MCNP.
The geometry is tagged wih material names, optional imprinted and merging during the process which can speed up particle transport.
Python API usage
Creating a h5m file from a single STP file called part1.stp
and applying
a material tag to the volume.
from cad_to_h5m import cad_to_h5m
cad_to_h5m(
files_with_tags={'filename':'part1.stp', 'material_tags':'m1'},
output='dagmc.h5m',
tags='mat:1',
cubit_path='/opt/Coreform-Cubit-2020.2/bin/python3/'
)
Creating a h5m file from two STP files called part1.stp
and part2.stp
.
Both parts have distinct material tag applied to them and the result is output
as a h5m file.
from cad_to_h5m import cad_to_h5m
cad_to_h5m(
files_with_tags={
'filename':'part1.stp', 'material_tags':'m1'
'filename':'part2.stp', 'material_tags':'m2'
},
output='dagmc.h5m',
tags=['mat:1', 'mat:2'],
cubit_path='/opt/Coreform-Cubit-2020.2/bin/python3/'
)
Creating a h5m file from a single SAT is a similar process. Note the .sat file extension.
from cad_to_h5m import cad_to_h5m
cad_to_h5m(
files_with_tags={'filename':'part1.sat', 'material_tags':'m1'},,
output='dagmc.h5m',
tags='mat:1',
cubit_path='/opt/Coreform-Cubit-2020.2/bin/python3/'
)
Installation
The package is available via the PyPi package manager and the recommended method of installing is via pip.
pip install cad_to_h5m
Some Python dependencies (such as Numpy) are installed during the pip install cad_to_h5m
process, however Cubit needs
to be installed seperatly to make full use of this package.
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_h5m-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25e104399792f796fd32c1534c90a220001ae0ffaa9ca1a6cf1ee40f8c19b354 |
|
MD5 | ff8adf040685644539ae14f6b1ded687 |
|
BLAKE2b-256 | 6d0e7b006073c2455a7789008025c2adf800e3c43cdf0aeeb46ecf643a37b4e5 |