cad-to-dagmc 0.6.2__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.

Files changed (60) hide show
  1. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/.github/workflows/black.yml +3 -3
  2. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/.github/workflows/ci_with_install.yml +5 -2
  3. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/.github/workflows/ci_with_pip_install.yml +13 -12
  4. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/PKG-INFO +55 -21
  5. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/README.md +54 -20
  6. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/examples/surface_mesh/cadquery_assembly.py +3 -4
  7. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/examples/surface_mesh/cadquery_compound.py +2 -2
  8. cad_to_dagmc-0.7.0/examples/surface_mesh/cadquery_object_and_stp_file.py +28 -0
  9. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/examples/surface_mesh/cadquery_text.py +8 -6
  10. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/examples/surface_mesh/curved_cadquery_object_to_dagmc_surface_mesh.py +4 -2
  11. cad_to_dagmc-0.7.0/examples/surface_mesh/from_gmsh_mesh_file.py +55 -0
  12. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/examples/surface_mesh/multiple_cadquery_objects.py +3 -3
  13. cad_to_dagmc-0.7.0/examples/surface_mesh/multiple_stp_files.py +30 -0
  14. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/examples/surface_mesh/single_cadquery_object.py +2 -2
  15. cad_to_dagmc-0.7.0/examples/surface_mesh/single_stp_file.py +24 -0
  16. cad_to_dagmc-0.7.0/examples/surface_mesh/single_stp_file_multiple_volumes.py +16 -0
  17. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/examples/unstrucutred_volume_mesh/simulate_unstrucutred_volume_mesh_with_openmc.py +0 -2
  18. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/src/_version.py +2 -2
  19. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/src/cad_to_dagmc/core.py +144 -52
  20. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/src/cad_to_dagmc.egg-info/PKG-INFO +55 -21
  21. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/src/cad_to_dagmc.egg-info/SOURCES.txt +1 -2
  22. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/test_file_creation.py +29 -16
  23. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/test_h5m_in_transport.py +19 -16
  24. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/test_python_api.py +5 -10
  25. cad_to_dagmc-0.6.2/examples/surface_mesh/cadquery_object_and_stp_file.py +0 -16
  26. cad_to_dagmc-0.6.2/examples/surface_mesh/create_stp_files_for_examples.py +0 -90
  27. cad_to_dagmc-0.6.2/examples/surface_mesh/multiple_stp_files.py +0 -12
  28. cad_to_dagmc-0.6.2/examples/surface_mesh/single_stp_file.py +0 -5
  29. cad_to_dagmc-0.6.2/examples/surface_mesh/single_stp_file_multiple_volumes.py +0 -6
  30. cad_to_dagmc-0.6.2/tests/create_brep_file_for_testing.py +0 -56
  31. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/.github/workflows/anaconda-publish.yml +0 -0
  32. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/.github/workflows/ci_with_benchmarks.yml +0 -0
  33. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/.github/workflows/python-publish.yml +0 -0
  34. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/.gitignore +0 -0
  35. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/LICENSE +0 -0
  36. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/examples/unstrucutred_volume_mesh/curved_cadquery_object_to_dagmc_volume_mesh.py +0 -0
  37. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/pyproject.toml +0 -0
  38. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/setup.cfg +0 -0
  39. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/src/cad_to_dagmc/__init__.py +0 -0
  40. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/src/cad_to_dagmc.egg-info/dependency_links.txt +0 -0
  41. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/src/cad_to_dagmc.egg-info/requires.txt +0 -0
  42. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/src/cad_to_dagmc.egg-info/top_level.txt +0 -0
  43. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/ENDFB-7.1-NNDC_H1.h5 +0 -0
  44. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/ball_reactor.brep +0 -0
  45. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/curved_extrude.stp +0 -0
  46. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/extrude_rectangle.step +0 -0
  47. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/extrude_rectangle.stp +0 -0
  48. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/multi_volume_cylinders.stp +0 -0
  49. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/one_cube.brep +0 -0
  50. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/single_cube.step +0 -0
  51. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/single_cube.stp +0 -0
  52. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/single_volume_thin.stp +0 -0
  53. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/single_volume_thin.vtk +0 -0
  54. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/test_brep_file.brep +0 -0
  55. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/test_loading_from_file_vs_shape_object.py +0 -0
  56. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/test_two_joined_cubes.brep +0 -0
  57. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/test_two_sep_cubes.brep +0 -0
  58. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/test_version.py +0 -0
  59. {cad_to_dagmc-0.6.2 → cad_to_dagmc-0.7.0}/tests/two_connected_cubes.stp +0 -0
  60. {cad_to_dagmc-0.6.2 → 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@v3
16
+ - uses: actions/checkout@v4
17
17
  with:
18
18
  ref: ${{ github.head_ref }}
19
19
  - name: Setup Python
20
- uses: actions/setup-python@v2
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@v4
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=3.10
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 create_stp_files_for_examples.py
57
- python cadquery_assembly.py
58
- python cadquery_compound.py
59
- python cadquery_object_and_stp_file.py
60
- python cadquery_text.py
61
- python curved_cadquery_object_to_dagmc_surface_mesh.py
62
- python curved_cadquery_object_to_dagmc_volume_mesh.py
63
- python multiple_cadquery_objects.py
64
- python multiple_stp_files.py
65
- python single_stp_file_multiple_volumes.py
66
- python single_cadquery_object.py
67
- python single_stp_file.py
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.6.2
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
@@ -51,10 +51,59 @@ Also checkout these other software projects that also create DAGMC geometry [CAD
51
51
 
52
52
  # Installation options
53
53
 
54
+ - Install using Mamba
55
+ - Install using Conda
54
56
  - Install using Mamba and pip
55
57
  - Install using Conda and pip
56
58
  - Install using pip and source compilations
57
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
+ ```
58
107
 
59
108
  ## Install using Mamba and pip
60
109
 
@@ -65,7 +114,7 @@ In principle, installing any Conda/Mamba distribution will work. A few Conda/Mam
65
114
 
66
115
  This example assumes you have installed the Miniforge option or separately have installed Mamba with ```conda install -c conda-forge mamba -y```
67
116
 
68
- Create a new conda environment, I've chosen Python 3.10 here but newer versions are
117
+ Create a new environment, I've chosen Python 3.10 here but newer versions are
69
118
  also supported.
70
119
  ```bash
71
120
  mamba create --name new_env python=3.10 -y
@@ -81,7 +130,7 @@ Install the dependencies
81
130
  mamba install -y -c conda-forge "moab>=5.3.0" gmsh python-gmsh
82
131
  ```
83
132
 
84
- Then you can install the cad_to_dagmc package with ```pip```
133
+ Then you can install the cad_to_dagmc package
85
134
  ```bash
86
135
  pip install cad_to_dagmc
87
136
  ```
@@ -96,7 +145,7 @@ In principle, installing any Conda/Mamba distribution will work. A few Conda/Mam
96
145
 
97
146
  This example uses Conda to install some dependencies that are not available via PyPi.
98
147
 
99
- Create a new conda environment
148
+ Create a new environment
100
149
  ```bash
101
150
  conda create --name new_env python=3.10 -y
102
151
  ```
@@ -111,7 +160,7 @@ Install the dependencies
111
160
  conda install -y -c conda-forge "moab>=5.3.0" gmsh python-gmsh
112
161
  ```
113
162
 
114
- Then you can install the cad_to_dagmc package with ```pip```
163
+ Then you can install the cad_to_dagmc package
115
164
  ```bash
116
165
  pip install cad_to_dagmc
117
166
  ```
@@ -130,7 +179,7 @@ Then you can install the cad_to_dagmc package with ```pip```
130
179
  pip install cad_to_dagmc
131
180
  ```
132
181
 
133
- ## Install with transport code (e.g OpenMC)
182
+ ## Install with OpenMC or other particle transport codes
134
183
 
135
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/).
136
185
 
@@ -144,7 +193,6 @@ It might not be possible to install OpenMC and cad-to-dagmc in the same conda/ma
144
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.
145
194
 
146
195
 
147
-
148
196
  # Known incompatibilities
149
197
 
150
198
  The package requires newer versions of Linux. For example the package does not work on Ubuntu 18.04 or older.
@@ -153,20 +201,6 @@ The package requires newer versions of pip. It is recommended to ensure that you
153
201
 
154
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.
155
203
 
156
- # Usage - with OpenMC
157
-
158
- 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/).
159
-
160
- You can run ```mamba install -c conda-forge openmc``` however this may choose to install OpenMC without DAGMC included.
161
-
162
- 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
163
- ```bash
164
- mamba install -c conda-forge -y "openmc=0.14.0=dagmc*nompi*"
165
- ```
166
-
167
- 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.
168
-
169
-
170
204
 
171
205
  # Usage - creation of DAGMC h5m files
172
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 conda environment, I've chosen Python 3.10 here but newer versions are
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 with ```pip```
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 conda environment
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 with ```pip```
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 transport code (e.g OpenMC)
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, material_tags=["mat1", "mat2"])
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(object=compound_of_shapes)
28
- my_model.export_dagmc_h5m_file(max_mesh_size=0.2, min_mesh_size=0.1, material_tags=["mat1", "mat2"])
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(object=text)
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(result)
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()
@@ -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(material_tags=["mat1", "mat2"])
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(material_tags=["mat1"])
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
 
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.6.2'
16
- __version_tuple__ = version_tuple = (0, 6, 2)
15
+ __version__ = version = '0.7.0'
16
+ __version_tuple__ = version_tuple = (0, 7, 0)