cad-to-dagmc


Namecad-to-dagmc JSON
Version 0.7.0 PyPI version JSON
download
home_pageNone
SummaryConverts CAD files to a DAGMC h5m file
upload_time2024-04-13 23:51:57
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords dagmc geometry plot slice
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
[![N|Python](https://www.python.org/static/community_logos/python-powered-w-100x40.png)](https://www.python.org)

[![CI with install](https://github.com/fusion-energy/cad_to_dagmc/actions/workflows/ci_with_install.yml/badge.svg?branch=main)](https://github.com/fusion-energy/cad_to_dagmc/actions/workflows/ci_with_install.yml) Testing package and running examples

[![CI with model benchmark zoo](https://github.com/fusion-energy/cad_to_dagmc/actions/workflows/ci_with_benchmarks.yml/badge.svg?branch=main)](https://github.com/fusion-energy/cad_to_dagmc/actions/workflows/ci_with_benchmarks.yml) Testing with [Model Benchmark Zoo](https://github.com/fusion-energy/model_benchmark_zoo)

[![Upload Python Package](https://github.com/fusion-energy/cad_to_dagmc/actions/workflows/python-publish.yml/badge.svg)](https://github.com/fusion-energy/cad_to_dagmc/actions/workflows/python-publish.yml)

[![PyPI](https://img.shields.io/pypi/v/cad_to_dagmc?color=brightgreen&label=pypi&logo=grebrightgreenen&logoColor=green)](https://pypi.org/project/cad_to_dagmc/)


A minimal package that converts CAD geometry to [DAGMC](https://github.com/svalinn/DAGMC/) h5m files

cad-to-dagmc can create:
- surface meshes / faceted geometry / triangular meshes
- unstructured mesh / tetrahedral meshes / volume meshes

cad-to-dagmc can convert:
- STEP files
- CadQuery objects (in memory)

cad-to-dagmc aims to produce DAGMC compatible h5m files from CAD geometry is intended to convert [STEP](http://www.steptools.com/stds/step/) files or [CadQuery](https://cadquery.readthedocs.io) objects to a [DAGMC](https://github.com/svalinn/DAGMC/) compatible h5m file.

The resulting DAGMC geometry can then be used for simulations in [OpenMC](https://github.com/openmc-dev/openmc/) or [other supported codes](https://svalinn.github.io/DAGMC/).

This package is tested with [pytest tests](https://github.com/fusion-energy/cad_to_dagmc/tree/main/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](https://github.com/fusion-energy/model_benchmark_zoo) for more details.

Also checkout these other software projects that also create DAGMC geometry [CAD-to-OpenMC](https://github.com/openmsr/CAD_to_OpenMC), [Stellarmesh](https://github.com/Thea-Energy/stellarmesh) and [Coreform Cubit](https://coreform.com/products/coreform-cubit/)

# Installation options

- Install using Mamba
- Install using Conda
- Install using Mamba and pip
- Install using Conda and pip
- Install using pip and source compilations

## Install using Mamba

In principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:
- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)
- [Anaconda](https://www.anaconda.com/download)
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)

This example assumes you have installed the Miniforge option or separately have installed Mamba with ```conda install -c conda-forge mamba -y```

Create a new environment, I've chosen Python 3.10 here but newer versions are
also supported.
```bash
mamba create --name new_env python=3.10 -y
```

Activate the environment
```bash
mamba activate new_env
```

Then you can install the cad_to_dagmc package
```bash
mamba install -y -c conda-forge cad_to_dagmc
```

## Install using Conda

In principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:
- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)
- [Anaconda](https://www.anaconda.com/download)
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)

Create a new environment, I've chosen Python 3.10 here but newer versions are
also supported.
```bash
conda create --name new_env python=3.10 -y
```

Activate the environment
```bash
conda activate new_env
```

Then you can install the cad_to_dagmc package
```bash
conda install -y -c conda-forge cad_to_dagmc
```

## Install using Mamba and pip

In principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:
- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)
- [Anaconda](https://www.anaconda.com/download)
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)

This example assumes you have installed the Miniforge option or separately have installed Mamba with ```conda install -c conda-forge mamba -y```

Create a new environment, I've chosen Python 3.10 here but newer versions are
also supported.
```bash
mamba create --name new_env python=3.10 -y
```

Activate the environment
```bash
mamba activate new_env
```

Install the dependencies
```bash
mamba install -y -c conda-forge "moab>=5.3.0" gmsh python-gmsh
```

Then you can install the cad_to_dagmc package
```bash
pip install cad_to_dagmc
```


## Install using Conda and pip

In principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:
- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)
- [Anaconda](https://www.anaconda.com/download)
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)

This example uses Conda to install some dependencies that are not available via PyPi.

Create a new environment
```bash
conda create --name new_env python=3.10 -y
```

Activate the environment
```bash
conda activate new_env
```

Install the dependencies
```bash
conda install -y -c conda-forge "moab>=5.3.0" gmsh python-gmsh
```

Then you can install the cad_to_dagmc package
```bash
pip install cad_to_dagmc
```

## Install using pip and source compilations

It should possible to avoid the use of conda and installing using pip and compiling from source.

First compile MOAB (and install Pymoab) from source

Then install gmsh from source (installing from pip appears to cause conflicts with the open cascade used in ocp and cadquery)

Then you can install the cad_to_dagmc package with ```pip```

```bash
pip install cad_to_dagmc
```

## Install with OpenMC or other particle transport codes

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](https://svalinn.github.io/DAGMC/).

To install OpenMC you can run ```mamba 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
```bash
mamba install -c conda-forge -y "openmc=0.14.0=dagmc*nompi*"
```

It might not be possible to install OpenMC and cad-to-dagmc in the same conda/mamba python environment so you may have to create a new conda/mamba environment and install OpenMC there.

Another option would be to [install OpenMC from source](https://docs.openmc.org/en/stable/quickinstall.html) which would also need compiling with MOAB and DAGMC options.


# Known incompatibilities

The package requires newer versions of Linux. For example the package does not work on Ubuntu 18.04 or older.

The package requires newer versions of pip. It is recommended to ensure that your version of pip is up to date. This can be done with ```python -m pip install --upgrade pip```

Installing one of the package dependancies (gmsh) with pip appears to result in occational errors when passing cad objects between cadquery / ocp and gmsh. The conda install gmsh appears to work fine.


# Usage - creation of DAGMC h5m files

For examples see the [examples folder](https://github.com/fusion-energy/cad_to_dagmc/tree/main/examples)

# Usage - simulation with transport code

For examples see the [examples folder](https://github.com/fusion-energy/cad_to_dagmc/tree/main/examples)

For more examples see the CAD tasks in the [neutronics-workshop](https://github.com/fusion-energy/neutronics-workshop) and [model benchmark zoo](https://github.com/fusion-energy/model_benchmark_zoo)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cad-to-dagmc",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "dagmc, geometry, plot, slice",
    "author": null,
    "author_email": "Jonathan Shimwell <mail@jshimwell.com>",
    "download_url": "https://files.pythonhosted.org/packages/eb/d8/6217cadcaaf4aab280299a8891d854bb604fde5d3db1579fc54b77ca48ef/cad_to_dagmc-0.7.0.tar.gz",
    "platform": null,
    "description": "\n[![N|Python](https://www.python.org/static/community_logos/python-powered-w-100x40.png)](https://www.python.org)\n\n[![CI with install](https://github.com/fusion-energy/cad_to_dagmc/actions/workflows/ci_with_install.yml/badge.svg?branch=main)](https://github.com/fusion-energy/cad_to_dagmc/actions/workflows/ci_with_install.yml) Testing package and running examples\n\n[![CI with model benchmark zoo](https://github.com/fusion-energy/cad_to_dagmc/actions/workflows/ci_with_benchmarks.yml/badge.svg?branch=main)](https://github.com/fusion-energy/cad_to_dagmc/actions/workflows/ci_with_benchmarks.yml) Testing with [Model Benchmark Zoo](https://github.com/fusion-energy/model_benchmark_zoo)\n\n[![Upload Python Package](https://github.com/fusion-energy/cad_to_dagmc/actions/workflows/python-publish.yml/badge.svg)](https://github.com/fusion-energy/cad_to_dagmc/actions/workflows/python-publish.yml)\n\n[![PyPI](https://img.shields.io/pypi/v/cad_to_dagmc?color=brightgreen&label=pypi&logo=grebrightgreenen&logoColor=green)](https://pypi.org/project/cad_to_dagmc/)\n\n\nA minimal package that converts CAD geometry to [DAGMC](https://github.com/svalinn/DAGMC/) h5m files\n\ncad-to-dagmc can create:\n- surface meshes / faceted geometry / triangular meshes\n- unstructured mesh / tetrahedral meshes / volume meshes\n\ncad-to-dagmc can convert:\n- STEP files\n- CadQuery objects (in memory)\n\ncad-to-dagmc aims to produce DAGMC compatible h5m files from CAD geometry is intended to convert [STEP](http://www.steptools.com/stds/step/) files or [CadQuery](https://cadquery.readthedocs.io) objects to a [DAGMC](https://github.com/svalinn/DAGMC/) compatible h5m file.\n\nThe resulting DAGMC geometry can then be used for simulations in [OpenMC](https://github.com/openmc-dev/openmc/) or [other supported codes](https://svalinn.github.io/DAGMC/).\n\nThis package is tested with [pytest tests](https://github.com/fusion-energy/cad_to_dagmc/tree/main/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](https://github.com/fusion-energy/model_benchmark_zoo) for more details.\n\nAlso checkout these other software projects that also create DAGMC geometry [CAD-to-OpenMC](https://github.com/openmsr/CAD_to_OpenMC), [Stellarmesh](https://github.com/Thea-Energy/stellarmesh) and [Coreform Cubit](https://coreform.com/products/coreform-cubit/)\n\n# Installation options\n\n- Install using Mamba\n- Install using Conda\n- Install using Mamba and pip\n- Install using Conda and pip\n- Install using pip and source compilations\n\n## Install using Mamba\n\nIn principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:\n- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)\n- [Anaconda](https://www.anaconda.com/download)\n- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)\n\nThis example assumes you have installed the Miniforge option or separately have installed Mamba with ```conda install -c conda-forge mamba -y```\n\nCreate a new environment, I've chosen Python 3.10 here but newer versions are\nalso supported.\n```bash\nmamba create --name new_env python=3.10 -y\n```\n\nActivate the environment\n```bash\nmamba activate new_env\n```\n\nThen you can install the cad_to_dagmc package\n```bash\nmamba install -y -c conda-forge cad_to_dagmc\n```\n\n## Install using Conda\n\nIn principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:\n- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)\n- [Anaconda](https://www.anaconda.com/download)\n- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)\n\nCreate a new environment, I've chosen Python 3.10 here but newer versions are\nalso supported.\n```bash\nconda create --name new_env python=3.10 -y\n```\n\nActivate the environment\n```bash\nconda activate new_env\n```\n\nThen you can install the cad_to_dagmc package\n```bash\nconda install -y -c conda-forge cad_to_dagmc\n```\n\n## Install using Mamba and pip\n\nIn principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:\n- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)\n- [Anaconda](https://www.anaconda.com/download)\n- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)\n\nThis example assumes you have installed the Miniforge option or separately have installed Mamba with ```conda install -c conda-forge mamba -y```\n\nCreate a new environment, I've chosen Python 3.10 here but newer versions are\nalso supported.\n```bash\nmamba create --name new_env python=3.10 -y\n```\n\nActivate the environment\n```bash\nmamba activate new_env\n```\n\nInstall the dependencies\n```bash\nmamba install -y -c conda-forge \"moab>=5.3.0\" gmsh python-gmsh\n```\n\nThen you can install the cad_to_dagmc package\n```bash\npip install cad_to_dagmc\n```\n\n\n## Install using Conda and pip\n\nIn principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:\n- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)\n- [Anaconda](https://www.anaconda.com/download)\n- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)\n\nThis example uses Conda to install some dependencies that are not available via PyPi.\n\nCreate a new environment\n```bash\nconda create --name new_env python=3.10 -y\n```\n\nActivate the environment\n```bash\nconda activate new_env\n```\n\nInstall the dependencies\n```bash\nconda install -y -c conda-forge \"moab>=5.3.0\" gmsh python-gmsh\n```\n\nThen you can install the cad_to_dagmc package\n```bash\npip install cad_to_dagmc\n```\n\n## Install using pip and source compilations\n\nIt should possible to avoid the use of conda and installing using pip and compiling from source.\n\nFirst compile MOAB (and install Pymoab) from source\n\nThen install gmsh from source (installing from pip appears to cause conflicts with the open cascade used in ocp and cadquery)\n\nThen you can install the cad_to_dagmc package with ```pip```\n\n```bash\npip install cad_to_dagmc\n```\n\n## Install with OpenMC or other particle transport codes\n\nYou 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](https://svalinn.github.io/DAGMC/).\n\nTo install OpenMC you can run ```mamba 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\n```bash\nmamba install -c conda-forge -y \"openmc=0.14.0=dagmc*nompi*\"\n```\n\nIt might not be possible to install OpenMC and cad-to-dagmc in the same conda/mamba python environment so you may have to create a new conda/mamba environment and install OpenMC there.\n\nAnother option would be to [install OpenMC from source](https://docs.openmc.org/en/stable/quickinstall.html) which would also need compiling with MOAB and DAGMC options.\n\n\n# Known incompatibilities\n\nThe package requires newer versions of Linux. For example the package does not work on Ubuntu 18.04 or older.\n\nThe package requires newer versions of pip. It is recommended to ensure that your version of pip is up to date. This can be done with ```python -m pip install --upgrade pip```\n\nInstalling one of the package dependancies (gmsh) with pip appears to result in occational errors when passing cad objects between cadquery / ocp and gmsh. The conda install gmsh appears to work fine.\n\n\n# Usage - creation of DAGMC h5m files\n\nFor examples see the [examples folder](https://github.com/fusion-energy/cad_to_dagmc/tree/main/examples)\n\n# Usage - simulation with transport code\n\nFor examples see the [examples folder](https://github.com/fusion-energy/cad_to_dagmc/tree/main/examples)\n\nFor more examples see the CAD tasks in the [neutronics-workshop](https://github.com/fusion-energy/neutronics-workshop) and [model benchmark zoo](https://github.com/fusion-energy/model_benchmark_zoo)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Converts CAD files to a DAGMC h5m file",
    "version": "0.7.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/fusion-energy/cad_to_dagmc/issues",
        "Homepage": "https://github.com/fusion-energy/cad_to_dagmc"
    },
    "split_keywords": [
        "dagmc",
        " geometry",
        " plot",
        " slice"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9c5ea554585b47519d96f53274658fcdc1e415c54bd069f0a4fc20d147eef1f5",
                "md5": "47c30ad2f13e9ec4286ad8697fcfb7ef",
                "sha256": "7b359bb2aa35e28b75f23f35fb4751dcfaa6a8170990fe8ea303ab54fb4ae2ea"
            },
            "downloads": -1,
            "filename": "cad_to_dagmc-0.7.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "47c30ad2f13e9ec4286ad8697fcfb7ef",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 10026,
            "upload_time": "2024-04-13T23:51:55",
            "upload_time_iso_8601": "2024-04-13T23:51:55.538899Z",
            "url": "https://files.pythonhosted.org/packages/9c/5e/a554585b47519d96f53274658fcdc1e415c54bd069f0a4fc20d147eef1f5/cad_to_dagmc-0.7.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ebd86217cadcaaf4aab280299a8891d854bb604fde5d3db1579fc54b77ca48ef",
                "md5": "6c8264169332efba141668ea0c9e409b",
                "sha256": "b843c6b856f9ef1b5d47e952429c788527e035cfbd6ddf7da27746d7864909d6"
            },
            "downloads": -1,
            "filename": "cad_to_dagmc-0.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6c8264169332efba141668ea0c9e409b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1026302,
            "upload_time": "2024-04-13T23:51:57",
            "upload_time_iso_8601": "2024-04-13T23:51:57.494079Z",
            "url": "https://files.pythonhosted.org/packages/eb/d8/6217cadcaaf4aab280299a8891d854bb604fde5d3db1579fc54b77ca48ef/cad_to_dagmc-0.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-13 23:51:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fusion-energy",
    "github_project": "cad_to_dagmc",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cad-to-dagmc"
}
        
Elapsed time: 0.22369s