cad-to-dagmc 0.6.1__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cad-to-dagmc might be problematic. Click here for more details.
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/.github/workflows/black.yml +3 -3
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/.github/workflows/ci_with_install.yml +5 -2
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/.github/workflows/ci_with_pip_install.yml +13 -12
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/PKG-INFO +55 -22
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/README.md +54 -20
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/examples/surface_mesh/cadquery_assembly.py +3 -4
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/examples/surface_mesh/cadquery_compound.py +2 -2
- cad_to_dagmc-0.7.0/examples/surface_mesh/cadquery_object_and_stp_file.py +28 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/examples/surface_mesh/cadquery_text.py +8 -6
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/examples/surface_mesh/curved_cadquery_object_to_dagmc_surface_mesh.py +4 -2
- cad_to_dagmc-0.7.0/examples/surface_mesh/from_gmsh_mesh_file.py +55 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/examples/surface_mesh/multiple_cadquery_objects.py +3 -3
- cad_to_dagmc-0.7.0/examples/surface_mesh/multiple_stp_files.py +30 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/examples/surface_mesh/single_cadquery_object.py +2 -2
- cad_to_dagmc-0.7.0/examples/surface_mesh/single_stp_file.py +24 -0
- cad_to_dagmc-0.7.0/examples/surface_mesh/single_stp_file_multiple_volumes.py +16 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/examples/unstrucutred_volume_mesh/simulate_unstrucutred_volume_mesh_with_openmc.py +0 -2
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/pyproject.toml +0 -1
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/src/_version.py +2 -2
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/src/cad_to_dagmc/core.py +144 -52
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/src/cad_to_dagmc.egg-info/PKG-INFO +55 -22
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/src/cad_to_dagmc.egg-info/SOURCES.txt +1 -2
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/src/cad_to_dagmc.egg-info/requires.txt +0 -1
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/test_file_creation.py +29 -16
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/test_h5m_in_transport.py +19 -16
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/test_python_api.py +5 -10
- cad_to_dagmc-0.6.1/examples/surface_mesh/cadquery_object_and_stp_file.py +0 -16
- cad_to_dagmc-0.6.1/examples/surface_mesh/create_stp_files_for_examples.py +0 -90
- cad_to_dagmc-0.6.1/examples/surface_mesh/multiple_stp_files.py +0 -12
- cad_to_dagmc-0.6.1/examples/surface_mesh/single_stp_file.py +0 -5
- cad_to_dagmc-0.6.1/examples/surface_mesh/single_stp_file_multiple_volumes.py +0 -6
- cad_to_dagmc-0.6.1/tests/create_brep_file_for_testing.py +0 -56
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/.github/workflows/anaconda-publish.yml +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/.github/workflows/ci_with_benchmarks.yml +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/.github/workflows/python-publish.yml +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/.gitignore +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/LICENSE +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/examples/unstrucutred_volume_mesh/curved_cadquery_object_to_dagmc_volume_mesh.py +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/setup.cfg +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/src/cad_to_dagmc/__init__.py +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/src/cad_to_dagmc.egg-info/dependency_links.txt +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/src/cad_to_dagmc.egg-info/top_level.txt +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/ENDFB-7.1-NNDC_H1.h5 +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/ball_reactor.brep +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/curved_extrude.stp +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/extrude_rectangle.step +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/extrude_rectangle.stp +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/multi_volume_cylinders.stp +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/one_cube.brep +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/single_cube.step +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/single_cube.stp +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/single_volume_thin.stp +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/single_volume_thin.vtk +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/test_brep_file.brep +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/test_loading_from_file_vs_shape_object.py +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/test_two_joined_cubes.brep +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/test_two_sep_cubes.brep +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/test_version.py +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/two_connected_cubes.stp +0 -0
- {cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/tests/two_disconnected_cubes.stp +0 -0
|
@@ -13,11 +13,11 @@ jobs:
|
|
|
13
13
|
black:
|
|
14
14
|
runs-on: ubuntu-latest
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
17
|
with:
|
|
18
18
|
ref: ${{ github.head_ref }}
|
|
19
19
|
- name: Setup Python
|
|
20
|
-
uses: actions/setup-python@
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
21
|
with:
|
|
22
22
|
python-version: 3.x
|
|
23
23
|
- name: Install black
|
|
@@ -27,6 +27,6 @@ jobs:
|
|
|
27
27
|
- name: Run black
|
|
28
28
|
run: |
|
|
29
29
|
black --line-length 100 .
|
|
30
|
-
- uses: stefanzweifel/git-auto-commit-action@
|
|
30
|
+
- uses: stefanzweifel/git-auto-commit-action@v5
|
|
31
31
|
with:
|
|
32
32
|
commit_message: "[skip ci] Apply formatting changes"
|
|
@@ -21,6 +21,9 @@ on:
|
|
|
21
21
|
jobs:
|
|
22
22
|
testing:
|
|
23
23
|
runs-on: ubuntu-latest
|
|
24
|
+
strategy:
|
|
25
|
+
matrix:
|
|
26
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
24
27
|
steps:
|
|
25
28
|
- name: Checkout repository
|
|
26
29
|
uses: actions/checkout@v4
|
|
@@ -37,7 +40,7 @@ jobs:
|
|
|
37
40
|
sudo apt-get upgrade -y
|
|
38
41
|
sudo apt-get install -y libgl1-mesa-glx libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libosmesa6 libosmesa6-dev libgles2-mesa-dev libarchive-dev libpangocairo-1.0-0
|
|
39
42
|
mamba activate
|
|
40
|
-
mamba create -y --name cad_to_dagmc python
|
|
43
|
+
mamba create -y --name cad_to_dagmc python=${{ matrix.python-version }}
|
|
41
44
|
mamba activate cad_to_dagmc
|
|
42
45
|
mamba install -y -c conda-forge "openmc=0.14.0=dagmc*nompi*" gmsh python-gmsh
|
|
43
46
|
python -m pip install --upgrade pip
|
|
@@ -45,7 +48,6 @@ jobs:
|
|
|
45
48
|
python -c "import cad_to_dagmc"
|
|
46
49
|
python -m pip install .[tests]
|
|
47
50
|
pytest -v tests
|
|
48
|
-
python examples/surface_mesh/create_stp_files_for_examples.py
|
|
49
51
|
python examples/surface_mesh/cadquery_assembly.py
|
|
50
52
|
python examples/surface_mesh/cadquery_compound.py
|
|
51
53
|
python examples/surface_mesh/cadquery_object_and_stp_file.py
|
|
@@ -56,5 +58,6 @@ jobs:
|
|
|
56
58
|
python examples/surface_mesh/single_stp_file_multiple_volumes.py
|
|
57
59
|
python examples/surface_mesh/single_cadquery_object.py
|
|
58
60
|
python examples/surface_mesh/single_stp_file.py
|
|
61
|
+
python examples/surface_mesh/from_gmsh_mesh_file.py
|
|
59
62
|
python examples/unstrucutred_volume_mesh/curved_cadquery_object_to_dagmc_volume_mesh.py
|
|
60
63
|
python examples/unstrucutred_volume_mesh/simulate_unstrucutred_volume_mesh_with_openmc.py
|
|
@@ -53,15 +53,16 @@ jobs:
|
|
|
53
53
|
python -m pip install .[tests]
|
|
54
54
|
pytest -v tests
|
|
55
55
|
cd examples
|
|
56
|
-
python
|
|
57
|
-
python
|
|
58
|
-
python
|
|
59
|
-
python
|
|
60
|
-
python
|
|
61
|
-
python
|
|
62
|
-
python
|
|
63
|
-
python
|
|
64
|
-
python
|
|
65
|
-
python
|
|
66
|
-
python
|
|
67
|
-
python
|
|
56
|
+
python examples/surface_mesh/cadquery_assembly.py
|
|
57
|
+
python examples/surface_mesh/cadquery_compound.py
|
|
58
|
+
python examples/surface_mesh/cadquery_object_and_stp_file.py
|
|
59
|
+
python examples/surface_mesh/cadquery_text.py
|
|
60
|
+
python examples/surface_mesh/curved_cadquery_object_to_dagmc_surface_mesh.py
|
|
61
|
+
python examples/surface_mesh/multiple_cadquery_objects.py
|
|
62
|
+
python examples/surface_mesh/multiple_stp_files.py
|
|
63
|
+
python examples/surface_mesh/single_stp_file_multiple_volumes.py
|
|
64
|
+
python examples/surface_mesh/single_cadquery_object.py
|
|
65
|
+
python examples/surface_mesh/single_stp_file.py
|
|
66
|
+
python examples/surface_mesh/from_gmsh_mesh_file.py
|
|
67
|
+
python examples/unstrucutred_volume_mesh/curved_cadquery_object_to_dagmc_volume_mesh.py
|
|
68
|
+
python examples/unstrucutred_volume_mesh/simulate_unstrucutred_volume_mesh_with_openmc.py
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cad_to_dagmc
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: Converts CAD files to a DAGMC h5m file
|
|
5
5
|
Author-email: Jonathan Shimwell <mail@jshimwell.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/fusion-energy/cad_to_dagmc
|
|
@@ -14,7 +14,6 @@ Description-Content-Type: text/markdown
|
|
|
14
14
|
License-File: LICENSE
|
|
15
15
|
Requires-Dist: trimesh
|
|
16
16
|
Requires-Dist: networkx
|
|
17
|
-
Requires-Dist: cadquery-ocp>=7.7.2
|
|
18
17
|
Requires-Dist: cadquery>=2.4.0
|
|
19
18
|
Provides-Extra: tests
|
|
20
19
|
Requires-Dist: pytest; extra == "tests"
|
|
@@ -52,10 +51,59 @@ Also checkout these other software projects that also create DAGMC geometry [CAD
|
|
|
52
51
|
|
|
53
52
|
# Installation options
|
|
54
53
|
|
|
54
|
+
- Install using Mamba
|
|
55
|
+
- Install using Conda
|
|
55
56
|
- Install using Mamba and pip
|
|
56
57
|
- Install using Conda and pip
|
|
57
58
|
- Install using pip and source compilations
|
|
58
59
|
|
|
60
|
+
## Install using Mamba
|
|
61
|
+
|
|
62
|
+
In principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:
|
|
63
|
+
- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)
|
|
64
|
+
- [Anaconda](https://www.anaconda.com/download)
|
|
65
|
+
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)
|
|
66
|
+
|
|
67
|
+
This example assumes you have installed the Miniforge option or separately have installed Mamba with ```conda install -c conda-forge mamba -y```
|
|
68
|
+
|
|
69
|
+
Create a new environment, I've chosen Python 3.10 here but newer versions are
|
|
70
|
+
also supported.
|
|
71
|
+
```bash
|
|
72
|
+
mamba create --name new_env python=3.10 -y
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Activate the environment
|
|
76
|
+
```bash
|
|
77
|
+
mamba activate new_env
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Then you can install the cad_to_dagmc package
|
|
81
|
+
```bash
|
|
82
|
+
mamba install -y -c conda-forge cad_to_dagmc
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Install using Conda
|
|
86
|
+
|
|
87
|
+
In principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:
|
|
88
|
+
- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)
|
|
89
|
+
- [Anaconda](https://www.anaconda.com/download)
|
|
90
|
+
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)
|
|
91
|
+
|
|
92
|
+
Create a new environment, I've chosen Python 3.10 here but newer versions are
|
|
93
|
+
also supported.
|
|
94
|
+
```bash
|
|
95
|
+
conda create --name new_env python=3.10 -y
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Activate the environment
|
|
99
|
+
```bash
|
|
100
|
+
conda activate new_env
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Then you can install the cad_to_dagmc package
|
|
104
|
+
```bash
|
|
105
|
+
conda install -y -c conda-forge cad_to_dagmc
|
|
106
|
+
```
|
|
59
107
|
|
|
60
108
|
## Install using Mamba and pip
|
|
61
109
|
|
|
@@ -66,7 +114,7 @@ In principle, installing any Conda/Mamba distribution will work. A few Conda/Mam
|
|
|
66
114
|
|
|
67
115
|
This example assumes you have installed the Miniforge option or separately have installed Mamba with ```conda install -c conda-forge mamba -y```
|
|
68
116
|
|
|
69
|
-
Create a new
|
|
117
|
+
Create a new environment, I've chosen Python 3.10 here but newer versions are
|
|
70
118
|
also supported.
|
|
71
119
|
```bash
|
|
72
120
|
mamba create --name new_env python=3.10 -y
|
|
@@ -82,7 +130,7 @@ Install the dependencies
|
|
|
82
130
|
mamba install -y -c conda-forge "moab>=5.3.0" gmsh python-gmsh
|
|
83
131
|
```
|
|
84
132
|
|
|
85
|
-
Then you can install the cad_to_dagmc package
|
|
133
|
+
Then you can install the cad_to_dagmc package
|
|
86
134
|
```bash
|
|
87
135
|
pip install cad_to_dagmc
|
|
88
136
|
```
|
|
@@ -97,7 +145,7 @@ In principle, installing any Conda/Mamba distribution will work. A few Conda/Mam
|
|
|
97
145
|
|
|
98
146
|
This example uses Conda to install some dependencies that are not available via PyPi.
|
|
99
147
|
|
|
100
|
-
Create a new
|
|
148
|
+
Create a new environment
|
|
101
149
|
```bash
|
|
102
150
|
conda create --name new_env python=3.10 -y
|
|
103
151
|
```
|
|
@@ -112,7 +160,7 @@ Install the dependencies
|
|
|
112
160
|
conda install -y -c conda-forge "moab>=5.3.0" gmsh python-gmsh
|
|
113
161
|
```
|
|
114
162
|
|
|
115
|
-
Then you can install the cad_to_dagmc package
|
|
163
|
+
Then you can install the cad_to_dagmc package
|
|
116
164
|
```bash
|
|
117
165
|
pip install cad_to_dagmc
|
|
118
166
|
```
|
|
@@ -131,7 +179,7 @@ Then you can install the cad_to_dagmc package with ```pip```
|
|
|
131
179
|
pip install cad_to_dagmc
|
|
132
180
|
```
|
|
133
181
|
|
|
134
|
-
## Install with
|
|
182
|
+
## Install with OpenMC or other particle transport codes
|
|
135
183
|
|
|
136
184
|
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/).
|
|
137
185
|
|
|
@@ -145,7 +193,6 @@ It might not be possible to install OpenMC and cad-to-dagmc in the same conda/ma
|
|
|
145
193
|
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.
|
|
146
194
|
|
|
147
195
|
|
|
148
|
-
|
|
149
196
|
# Known incompatibilities
|
|
150
197
|
|
|
151
198
|
The package requires newer versions of Linux. For example the package does not work on Ubuntu 18.04 or older.
|
|
@@ -154,20 +201,6 @@ The package requires newer versions of pip. It is recommended to ensure that you
|
|
|
154
201
|
|
|
155
202
|
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.
|
|
156
203
|
|
|
157
|
-
# Usage - with OpenMC
|
|
158
|
-
|
|
159
|
-
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 supported by [DAGMC](https://svalinn.github.io/DAGMC/).
|
|
160
|
-
|
|
161
|
-
You can run ```mamba install -c conda-forge openmc``` however this may choose to install OpenMC without DAGMC included.
|
|
162
|
-
|
|
163
|
-
You can be more specific with conda/mamba commands to make sure the latest version of OpenMC which contains DAGMC is chosen by conda / mamba
|
|
164
|
-
```bash
|
|
165
|
-
mamba install -c conda-forge -y "openmc=0.14.0=dagmc*nompi*"
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
You could also [install OpenMC from source](https://docs.openmc.org/en/stable/quickinstall.html) which might be prefered as it can be tricky for the conda enviroment to get resolved.
|
|
169
|
-
|
|
170
|
-
|
|
171
204
|
|
|
172
205
|
# Usage - creation of DAGMC h5m files
|
|
173
206
|
|
|
@@ -30,10 +30,59 @@ Also checkout these other software projects that also create DAGMC geometry [CAD
|
|
|
30
30
|
|
|
31
31
|
# Installation options
|
|
32
32
|
|
|
33
|
+
- Install using Mamba
|
|
34
|
+
- Install using Conda
|
|
33
35
|
- Install using Mamba and pip
|
|
34
36
|
- Install using Conda and pip
|
|
35
37
|
- Install using pip and source compilations
|
|
36
38
|
|
|
39
|
+
## Install using Mamba
|
|
40
|
+
|
|
41
|
+
In principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:
|
|
42
|
+
- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)
|
|
43
|
+
- [Anaconda](https://www.anaconda.com/download)
|
|
44
|
+
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)
|
|
45
|
+
|
|
46
|
+
This example assumes you have installed the Miniforge option or separately have installed Mamba with ```conda install -c conda-forge mamba -y```
|
|
47
|
+
|
|
48
|
+
Create a new environment, I've chosen Python 3.10 here but newer versions are
|
|
49
|
+
also supported.
|
|
50
|
+
```bash
|
|
51
|
+
mamba create --name new_env python=3.10 -y
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Activate the environment
|
|
55
|
+
```bash
|
|
56
|
+
mamba activate new_env
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Then you can install the cad_to_dagmc package
|
|
60
|
+
```bash
|
|
61
|
+
mamba install -y -c conda-forge cad_to_dagmc
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Install using Conda
|
|
65
|
+
|
|
66
|
+
In principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:
|
|
67
|
+
- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)
|
|
68
|
+
- [Anaconda](https://www.anaconda.com/download)
|
|
69
|
+
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)
|
|
70
|
+
|
|
71
|
+
Create a new environment, I've chosen Python 3.10 here but newer versions are
|
|
72
|
+
also supported.
|
|
73
|
+
```bash
|
|
74
|
+
conda create --name new_env python=3.10 -y
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Activate the environment
|
|
78
|
+
```bash
|
|
79
|
+
conda activate new_env
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Then you can install the cad_to_dagmc package
|
|
83
|
+
```bash
|
|
84
|
+
conda install -y -c conda-forge cad_to_dagmc
|
|
85
|
+
```
|
|
37
86
|
|
|
38
87
|
## Install using Mamba and pip
|
|
39
88
|
|
|
@@ -44,7 +93,7 @@ In principle, installing any Conda/Mamba distribution will work. A few Conda/Mam
|
|
|
44
93
|
|
|
45
94
|
This example assumes you have installed the Miniforge option or separately have installed Mamba with ```conda install -c conda-forge mamba -y```
|
|
46
95
|
|
|
47
|
-
Create a new
|
|
96
|
+
Create a new environment, I've chosen Python 3.10 here but newer versions are
|
|
48
97
|
also supported.
|
|
49
98
|
```bash
|
|
50
99
|
mamba create --name new_env python=3.10 -y
|
|
@@ -60,7 +109,7 @@ Install the dependencies
|
|
|
60
109
|
mamba install -y -c conda-forge "moab>=5.3.0" gmsh python-gmsh
|
|
61
110
|
```
|
|
62
111
|
|
|
63
|
-
Then you can install the cad_to_dagmc package
|
|
112
|
+
Then you can install the cad_to_dagmc package
|
|
64
113
|
```bash
|
|
65
114
|
pip install cad_to_dagmc
|
|
66
115
|
```
|
|
@@ -75,7 +124,7 @@ In principle, installing any Conda/Mamba distribution will work. A few Conda/Mam
|
|
|
75
124
|
|
|
76
125
|
This example uses Conda to install some dependencies that are not available via PyPi.
|
|
77
126
|
|
|
78
|
-
Create a new
|
|
127
|
+
Create a new environment
|
|
79
128
|
```bash
|
|
80
129
|
conda create --name new_env python=3.10 -y
|
|
81
130
|
```
|
|
@@ -90,7 +139,7 @@ Install the dependencies
|
|
|
90
139
|
conda install -y -c conda-forge "moab>=5.3.0" gmsh python-gmsh
|
|
91
140
|
```
|
|
92
141
|
|
|
93
|
-
Then you can install the cad_to_dagmc package
|
|
142
|
+
Then you can install the cad_to_dagmc package
|
|
94
143
|
```bash
|
|
95
144
|
pip install cad_to_dagmc
|
|
96
145
|
```
|
|
@@ -109,7 +158,7 @@ Then you can install the cad_to_dagmc package with ```pip```
|
|
|
109
158
|
pip install cad_to_dagmc
|
|
110
159
|
```
|
|
111
160
|
|
|
112
|
-
## Install with
|
|
161
|
+
## Install with OpenMC or other particle transport codes
|
|
113
162
|
|
|
114
163
|
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/).
|
|
115
164
|
|
|
@@ -123,7 +172,6 @@ It might not be possible to install OpenMC and cad-to-dagmc in the same conda/ma
|
|
|
123
172
|
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.
|
|
124
173
|
|
|
125
174
|
|
|
126
|
-
|
|
127
175
|
# Known incompatibilities
|
|
128
176
|
|
|
129
177
|
The package requires newer versions of Linux. For example the package does not work on Ubuntu 18.04 or older.
|
|
@@ -132,20 +180,6 @@ The package requires newer versions of pip. It is recommended to ensure that you
|
|
|
132
180
|
|
|
133
181
|
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.
|
|
134
182
|
|
|
135
|
-
# Usage - with OpenMC
|
|
136
|
-
|
|
137
|
-
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 supported by [DAGMC](https://svalinn.github.io/DAGMC/).
|
|
138
|
-
|
|
139
|
-
You can run ```mamba install -c conda-forge openmc``` however this may choose to install OpenMC without DAGMC included.
|
|
140
|
-
|
|
141
|
-
You can be more specific with conda/mamba commands to make sure the latest version of OpenMC which contains DAGMC is chosen by conda / mamba
|
|
142
|
-
```bash
|
|
143
|
-
mamba install -c conda-forge -y "openmc=0.14.0=dagmc*nompi*"
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
You could also [install OpenMC from source](https://docs.openmc.org/en/stable/quickinstall.html) which might be prefered as it can be tricky for the conda enviroment to get resolved.
|
|
147
|
-
|
|
148
|
-
|
|
149
183
|
|
|
150
184
|
# Usage - creation of DAGMC h5m files
|
|
151
185
|
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import cadquery as cq
|
|
2
|
-
from cadquery import Assembly
|
|
3
2
|
from cad_to_dagmc import CadToDagmc
|
|
4
3
|
|
|
5
4
|
result = cq.Workplane().sphere(5)
|
|
6
5
|
result2 = cq.Workplane().moveTo(10, 0).sphere(2)
|
|
7
6
|
|
|
8
|
-
assembly = Assembly()
|
|
7
|
+
assembly = cq.Assembly()
|
|
9
8
|
assembly.add(result)
|
|
10
9
|
assembly.add(result2)
|
|
11
10
|
|
|
12
11
|
my_model = CadToDagmc()
|
|
13
|
-
my_model.add_cadquery_object(assembly)
|
|
14
|
-
my_model.export_dagmc_h5m_file(min_mesh_size=0.5, max_mesh_size=1.0
|
|
12
|
+
my_model.add_cadquery_object(cadquery_object=assembly, material_tags=["mat1", "mat2"])
|
|
13
|
+
my_model.export_dagmc_h5m_file(min_mesh_size=0.5, max_mesh_size=1.0)
|
|
@@ -24,5 +24,5 @@ cq_shape_2 = r2.extrude(1)
|
|
|
24
24
|
compound_of_shapes = cq.Compound.makeCompound([cq_shape_1.val(), cq_shape_2.val()])
|
|
25
25
|
|
|
26
26
|
my_model = CadToDagmc()
|
|
27
|
-
my_model.add_cadquery_object(
|
|
28
|
-
my_model.export_dagmc_h5m_file(max_mesh_size=0.2, min_mesh_size=0.1
|
|
27
|
+
my_model.add_cadquery_object(cadquery_object=compound_of_shapes, material_tags=["mat1", "mat2"])
|
|
28
|
+
my_model.export_dagmc_h5m_file(max_mesh_size=0.2, min_mesh_size=0.1)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from cad_to_dagmc import CadToDagmc
|
|
2
|
+
import cadquery as cq
|
|
3
|
+
|
|
4
|
+
result = cq.Workplane("XY").moveTo(10, 0).box(3, 3, 0.5).edges("|Z").fillet(0.125)
|
|
5
|
+
|
|
6
|
+
result2 = cq.Workplane("XY").box(1.0, 1.0, 1.0)
|
|
7
|
+
assembly = cq.Assembly()
|
|
8
|
+
assembly.add(result2)
|
|
9
|
+
assembly.save("single_cube.stp", exportType="STEP")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
my_model = CadToDagmc()
|
|
13
|
+
|
|
14
|
+
my_model.add_cadquery_object(
|
|
15
|
+
cadquery_object=result,
|
|
16
|
+
material_tags=["mat1"],
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
my_model.add_stp_file(
|
|
20
|
+
filename="single_cube.stp",
|
|
21
|
+
scale_factor=0.1,
|
|
22
|
+
material_tags=["mat2"],
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
my_model.export_dagmc_h5m_file(
|
|
26
|
+
max_mesh_size=0.2,
|
|
27
|
+
min_mesh_size=0.1,
|
|
28
|
+
)
|
|
@@ -5,12 +5,8 @@ text = cq.Workplane().text(txt="DAGMC", fontsize=10, distance=1)
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
my_model = CadToDagmc()
|
|
8
|
-
my_model.add_cadquery_object(
|
|
9
|
-
|
|
10
|
-
my_model.export_dagmc_h5m_file(
|
|
11
|
-
filename="cadquery_text.h5m",
|
|
12
|
-
max_mesh_size=0.2,
|
|
13
|
-
min_mesh_size=0.1,
|
|
8
|
+
my_model.add_cadquery_object(
|
|
9
|
+
cadquery_object=text,
|
|
14
10
|
material_tags=[
|
|
15
11
|
"mat1",
|
|
16
12
|
"mat2",
|
|
@@ -19,3 +15,9 @@ my_model.export_dagmc_h5m_file(
|
|
|
19
15
|
"mat5",
|
|
20
16
|
], # 5 volumes one for each letter
|
|
21
17
|
)
|
|
18
|
+
|
|
19
|
+
my_model.export_dagmc_h5m_file(
|
|
20
|
+
filename="cadquery_text.h5m",
|
|
21
|
+
max_mesh_size=0.2,
|
|
22
|
+
min_mesh_size=0.1,
|
|
23
|
+
)
|
|
@@ -39,11 +39,13 @@ result = (
|
|
|
39
39
|
|
|
40
40
|
my_model = CadToDagmc()
|
|
41
41
|
|
|
42
|
-
my_model.add_cadquery_object(
|
|
42
|
+
my_model.add_cadquery_object(
|
|
43
|
+
cadquery_object=result,
|
|
44
|
+
material_tags=["mat1"],
|
|
45
|
+
)
|
|
43
46
|
|
|
44
47
|
my_model.export_dagmc_h5m_file(
|
|
45
48
|
filename="cadquery_objects_and_stp_files.h5m",
|
|
46
49
|
max_mesh_size=1,
|
|
47
50
|
min_mesh_size=0.1,
|
|
48
|
-
material_tags=["mat1"],
|
|
49
51
|
)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# this file makes a GMESH mesh file from a Step file
|
|
2
|
+
# then loads up the GMESH file and converts it to a DAGMC file
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
# making the GMESH file
|
|
6
|
+
from cad_to_dagmc import CadToDagmc
|
|
7
|
+
import cadquery as cq
|
|
8
|
+
|
|
9
|
+
result1 = cq.Workplane("XY").box(10.0, 10.0, 5.0)
|
|
10
|
+
result2 = cq.Workplane("XY").moveTo(10, 0).box(10.0, 10.0, 5.0)
|
|
11
|
+
assembly = cq.Assembly()
|
|
12
|
+
assembly.add(result1)
|
|
13
|
+
assembly.add(result2)
|
|
14
|
+
assembly.save("two_connected_cubes.stp", exportType="STEP")
|
|
15
|
+
|
|
16
|
+
geometry = CadToDagmc()
|
|
17
|
+
geometry.add_stp_file("two_connected_cubes.stp")
|
|
18
|
+
geometry.export_gmsh_mesh_file(filename="example_gmsh_mesh.msh")
|
|
19
|
+
|
|
20
|
+
# converting the mesh file to a DAGMC file
|
|
21
|
+
from cad_to_dagmc import MeshToDagmc
|
|
22
|
+
|
|
23
|
+
mesh = MeshToDagmc(filename="example_gmsh_mesh.msh")
|
|
24
|
+
|
|
25
|
+
mesh.export_dagmc_h5m_file(
|
|
26
|
+
material_tags=["mat1", "mat2"],
|
|
27
|
+
filename="dagmc.h5m",
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
# making use of the DAGMC file in OpenMC
|
|
31
|
+
import openmc
|
|
32
|
+
|
|
33
|
+
openmc.config["cross_sections"] = "cross_sections.xml"
|
|
34
|
+
|
|
35
|
+
mat1 = openmc.Material(name="mat1")
|
|
36
|
+
mat1.add_nuclide("H1", 1, percent_type="ao")
|
|
37
|
+
mat1.set_density("g/cm3", 0.001)
|
|
38
|
+
|
|
39
|
+
mat2 = openmc.Material(name="mat2")
|
|
40
|
+
mat2.add_nuclide("H1", 1, percent_type="ao")
|
|
41
|
+
mat2.set_density("g/cm3", 0.002)
|
|
42
|
+
|
|
43
|
+
materials = openmc.Materials([mat1, mat2])
|
|
44
|
+
|
|
45
|
+
universe = openmc.DAGMCUniverse("dagmc.h5m").bounded_universe()
|
|
46
|
+
geometry = openmc.Geometry(universe)
|
|
47
|
+
|
|
48
|
+
my_settings = openmc.Settings()
|
|
49
|
+
my_settings.batches = 10
|
|
50
|
+
my_settings.inactive = 0
|
|
51
|
+
my_settings.particles = 500
|
|
52
|
+
my_settings.run_mode = "fixed source"
|
|
53
|
+
|
|
54
|
+
model = openmc.Model(geometry=geometry, materials=materials, settings=my_settings)
|
|
55
|
+
model.run()
|
{cad_to_dagmc-0.6.1 → cad_to_dagmc-0.7.0}/examples/surface_mesh/multiple_cadquery_objects.py
RENAMED
|
@@ -7,6 +7,6 @@ box = cq.Workplane("XY").moveTo(2, 0).box(2, 2, 2)
|
|
|
7
7
|
box_with_round_corners = cq.Workplane("XY").box(2, 1, 1)
|
|
8
8
|
|
|
9
9
|
my_model = CadToDagmc()
|
|
10
|
-
my_model.add_cadquery_object(box)
|
|
11
|
-
my_model.add_cadquery_object(box_with_round_corners)
|
|
12
|
-
my_model.export_dagmc_h5m_file(
|
|
10
|
+
my_model.add_cadquery_object(cadquery_object=box, material_tags=["mat1"])
|
|
11
|
+
my_model.add_cadquery_object(cadquery_object=box_with_round_corners, material_tags=["mat2"])
|
|
12
|
+
my_model.export_dagmc_h5m_file()
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from cad_to_dagmc import CadToDagmc
|
|
2
|
+
import cadquery as cq
|
|
3
|
+
|
|
4
|
+
result1 = cq.Workplane("XY").box(10.0, 10.0, 5.0)
|
|
5
|
+
result2 = cq.Workplane("XY").moveTo(10, 0).box(10.0, 10.0, 5.0)
|
|
6
|
+
assembly = cq.Assembly()
|
|
7
|
+
assembly.add(result1)
|
|
8
|
+
assembly.add(result2)
|
|
9
|
+
assembly.save("two_connected_cubes.stp", exportType="STEP")
|
|
10
|
+
|
|
11
|
+
result = cq.Workplane().moveTo(100, 0).sphere(5)
|
|
12
|
+
assembly = cq.Assembly()
|
|
13
|
+
assembly.add(result)
|
|
14
|
+
assembly.save("single_sphere.stp", exportType="STEP")
|
|
15
|
+
|
|
16
|
+
my_model = CadToDagmc()
|
|
17
|
+
my_model.add_stp_file(
|
|
18
|
+
filename="two_connected_cubes.stp",
|
|
19
|
+
material_tags=["mat1", "mat2"],
|
|
20
|
+
)
|
|
21
|
+
my_model.add_stp_file(
|
|
22
|
+
filename="single_sphere.stp",
|
|
23
|
+
material_tags=["mat3"],
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
my_model.export_dagmc_h5m_file(
|
|
27
|
+
max_mesh_size=1,
|
|
28
|
+
min_mesh_size=0.5,
|
|
29
|
+
implicit_complement_material_tag="air",
|
|
30
|
+
)
|
|
@@ -4,5 +4,5 @@ import cadquery as cq
|
|
|
4
4
|
result = sphere = cq.Workplane().moveTo(100, 0).sphere(5)
|
|
5
5
|
|
|
6
6
|
my_model = CadToDagmc()
|
|
7
|
-
my_model.add_cadquery_object(result)
|
|
8
|
-
my_model.export_dagmc_h5m_file(
|
|
7
|
+
my_model.add_cadquery_object(cadquery_object=result, material_tags=["mat1"])
|
|
8
|
+
my_model.export_dagmc_h5m_file()
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from cad_to_dagmc import CadToDagmc
|
|
2
|
+
|
|
3
|
+
import cadquery as cq
|
|
4
|
+
|
|
5
|
+
result = cq.Workplane("XY")
|
|
6
|
+
spline_points = [
|
|
7
|
+
(2.75, 1.5),
|
|
8
|
+
(2.5, 1.75),
|
|
9
|
+
(2.0, 1.5),
|
|
10
|
+
(1.5, 1.0),
|
|
11
|
+
(1.0, 1.25),
|
|
12
|
+
(0.5, 1.0),
|
|
13
|
+
(0, 1.0),
|
|
14
|
+
]
|
|
15
|
+
r = result.lineTo(3.0, 0).lineTo(3.0, 1.0).spline(spline_points, includeCurrent=True).close()
|
|
16
|
+
result = r.extrude(1.5)
|
|
17
|
+
assembly = cq.Assembly()
|
|
18
|
+
assembly.add(result)
|
|
19
|
+
assembly.save("spline_extrude.stp", exportType="STEP")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
my_model = CadToDagmc()
|
|
23
|
+
my_model.add_stp_file(filename="spline_extrude.stp", material_tags=["mat1"])
|
|
24
|
+
my_model.export_dagmc_h5m_file()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from cad_to_dagmc import CadToDagmc
|
|
2
|
+
|
|
3
|
+
import cadquery as cq
|
|
4
|
+
|
|
5
|
+
result = cq.Workplane().text(txt="DAGMC", fontsize=10, distance=1)
|
|
6
|
+
assembly = cq.Assembly()
|
|
7
|
+
assembly.add(result)
|
|
8
|
+
assembly.save("text_dagmc.stp", exportType="STEP")
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
my_model = CadToDagmc()
|
|
12
|
+
# the d and c from the word dagmc would be tagged with one material and the agm are tagged with another material
|
|
13
|
+
my_model.add_stp_file(
|
|
14
|
+
filename="text_dagmc.stp", material_tags=["mat1", "mat2", "mat2", "mat2", "mat1"]
|
|
15
|
+
)
|
|
16
|
+
my_model.export_dagmc_h5m_file()
|
|
@@ -19,7 +19,6 @@ mesh_filter = openmc.MeshFilter(umesh)
|
|
|
19
19
|
tally = openmc.Tally(name="unstrucutred_mesh_tally")
|
|
20
20
|
tally.filters = [mesh_filter]
|
|
21
21
|
tally.scores = ["flux"]
|
|
22
|
-
tally.estimator = "tracklength"
|
|
23
22
|
my_tallies = openmc.Tallies([tally])
|
|
24
23
|
|
|
25
24
|
|
|
@@ -38,7 +37,6 @@ my_geometry = openmc.Geometry([cell1])
|
|
|
38
37
|
|
|
39
38
|
my_settings = openmc.Settings()
|
|
40
39
|
my_settings.batches = 10
|
|
41
|
-
my_settings.inactive = 0
|
|
42
40
|
my_settings.particles = 5000
|
|
43
41
|
my_settings.run_mode = "fixed source"
|
|
44
42
|
|