cad-to-dagmc 0.7.0__tar.gz → 0.7.1__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.7.0 → cad_to_dagmc-0.7.1}/.github/workflows/ci_with_benchmarks.yml +4 -4
- cad_to_dagmc-0.7.0/.github/workflows/ci_with_install.yml → cad_to_dagmc-0.7.1/.github/workflows/ci_with_conda_install.yml +7 -6
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/.github/workflows/ci_with_pip_install.yml +8 -15
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/.gitignore +1 -0
- cad_to_dagmc-0.7.1/CITATION.cff +10 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/PKG-INFO +16 -57
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/README.md +13 -56
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/examples/unstrucutred_volume_mesh/curved_cadquery_object_to_dagmc_volume_mesh.py +2 -2
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/pyproject.toml +2 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/src/_version.py +2 -2
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/src/cad_to_dagmc/core.py +92 -43
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/src/cad_to_dagmc.egg-info/PKG-INFO +16 -57
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/src/cad_to_dagmc.egg-info/SOURCES.txt +2 -4
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/src/cad_to_dagmc.egg-info/requires.txt +2 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/test_python_api.py +32 -0
- cad_to_dagmc-0.7.0/.github/workflows/anaconda-publish.yml +0 -30
- cad_to_dagmc-0.7.0/tests/extrude_rectangle.step +0 -0
- cad_to_dagmc-0.7.0/tests/single_cube.step +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/.github/workflows/black.yml +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/.github/workflows/python-publish.yml +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/LICENSE +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/examples/surface_mesh/cadquery_assembly.py +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/examples/surface_mesh/cadquery_compound.py +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/examples/surface_mesh/cadquery_object_and_stp_file.py +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/examples/surface_mesh/cadquery_text.py +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/examples/surface_mesh/curved_cadquery_object_to_dagmc_surface_mesh.py +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/examples/surface_mesh/from_gmsh_mesh_file.py +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/examples/surface_mesh/multiple_cadquery_objects.py +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/examples/surface_mesh/multiple_stp_files.py +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/examples/surface_mesh/single_cadquery_object.py +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/examples/surface_mesh/single_stp_file.py +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/examples/surface_mesh/single_stp_file_multiple_volumes.py +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/examples/unstrucutred_volume_mesh/simulate_unstrucutred_volume_mesh_with_openmc.py +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/setup.cfg +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/src/cad_to_dagmc/__init__.py +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/src/cad_to_dagmc.egg-info/dependency_links.txt +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/src/cad_to_dagmc.egg-info/top_level.txt +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/ENDFB-7.1-NNDC_H1.h5 +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/ball_reactor.brep +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/curved_extrude.stp +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/extrude_rectangle.stp +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/multi_volume_cylinders.stp +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/one_cube.brep +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/single_cube.stp +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/single_volume_thin.stp +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/single_volume_thin.vtk +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/test_brep_file.brep +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/test_file_creation.py +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/test_h5m_in_transport.py +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/test_loading_from_file_vs_shape_object.py +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/test_two_joined_cubes.brep +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/test_two_sep_cubes.brep +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/test_version.py +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/two_connected_cubes.stp +0 -0
- {cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/tests/two_disconnected_cubes.stp +0 -0
|
@@ -35,11 +35,11 @@ jobs:
|
|
|
35
35
|
sudo apt-get --allow-releaseinfo-change update
|
|
36
36
|
sudo apt-get update -y
|
|
37
37
|
sudo apt-get upgrade -y
|
|
38
|
-
sudo apt-get install -y libgl1-
|
|
38
|
+
sudo apt-get install -y libgl1 libglx-mesa0 libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libosmesa6 libosmesa6-dev libgles2-mesa-dev libarchive-dev libpangocairo-1.0-0
|
|
39
39
|
mamba activate
|
|
40
|
-
mamba install -y -c conda-forge "openmc=0.
|
|
41
|
-
python -m
|
|
42
|
-
python -m pip install .
|
|
40
|
+
mamba install -y -c conda-forge "openmc=0.15.0=dagmc*nompi*" trimesh networkx cadquery gmsh python-gmsh
|
|
41
|
+
python -m ensurepip --upgrade
|
|
42
|
+
python -m pip install . --no-deps
|
|
43
43
|
python -m pip install openmc_data_downloader
|
|
44
44
|
openmc_data_downloader -l ENDFB-7.1-NNDC -i Fe56 Be9
|
|
45
45
|
git clone --single-branch -b main --depth 1 https://github.com/fusion-energy/model_benchmark_zoo.git
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
# This CI does includes particle transport tests as openmc is installed
|
|
3
3
|
|
|
4
|
-
name: CI with install
|
|
4
|
+
name: CI with Conda install
|
|
5
5
|
|
|
6
6
|
on:
|
|
7
7
|
pull_request:
|
|
@@ -38,15 +38,16 @@ jobs:
|
|
|
38
38
|
sudo apt-get --allow-releaseinfo-change update
|
|
39
39
|
sudo apt-get update -y
|
|
40
40
|
sudo apt-get upgrade -y
|
|
41
|
-
sudo apt-get install -y libgl1-
|
|
41
|
+
sudo apt-get install -y libgl1 libglx-mesa0 libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libosmesa6 libosmesa6-dev libgles2-mesa-dev libarchive-dev libpangocairo-1.0-0
|
|
42
42
|
mamba activate
|
|
43
43
|
mamba create -y --name cad_to_dagmc python=${{ matrix.python-version }}
|
|
44
44
|
mamba activate cad_to_dagmc
|
|
45
|
-
mamba install -y -c conda-forge "openmc=0.
|
|
46
|
-
python -m
|
|
47
|
-
python -m pip install .
|
|
45
|
+
mamba install -y -c conda-forge "openmc=0.15.0=dagmc*nompi*" trimesh networkx cadquery gmsh python-gmsh
|
|
46
|
+
python -m ensurepip --upgrade
|
|
47
|
+
python -m pip install . --no-deps
|
|
48
48
|
python -c "import cad_to_dagmc"
|
|
49
|
-
|
|
49
|
+
mamba install -y -c conda-forge pytest vtk
|
|
50
|
+
python -m pip install .[tests] --no-deps
|
|
50
51
|
pytest -v tests
|
|
51
52
|
python examples/surface_mesh/cadquery_assembly.py
|
|
52
53
|
python examples/surface_mesh/cadquery_compound.py
|
|
@@ -33,26 +33,19 @@ jobs:
|
|
|
33
33
|
apt-get --allow-releaseinfo-change update
|
|
34
34
|
apt-get update -y
|
|
35
35
|
apt-get upgrade -y
|
|
36
|
-
apt-get install -y
|
|
37
|
-
apt-get install -y make cmake
|
|
36
|
+
apt-get install -y libhdf5-dev libblas-dev liblapack-dev libgl1 libglx-mesa0 libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libosmesa6 libosmesa6-dev libgles2-mesa-dev libarchive-dev libpangocairo-1.0-0 libxcursor-dev libxft2 libxinerama-dev make cmake libeigen3-dev
|
|
38
37
|
apt install python3
|
|
39
38
|
apt install python3-pip
|
|
40
39
|
python -m pip install --upgrade pip
|
|
41
|
-
|
|
42
|
-
cd
|
|
43
|
-
git
|
|
44
|
-
|
|
45
|
-
cd
|
|
46
|
-
|
|
47
|
-
cmake ../moab -DENABLE_PYMOAB=ON -DENABLE_HDF5=ON -DENABLE_BLASLAPACK=OFF -DENABLE_FORTRAN=OFF
|
|
48
|
-
make -j2
|
|
49
|
-
make install
|
|
50
|
-
cd ../..
|
|
51
|
-
python -m pip install .
|
|
52
|
-
python -c "import cad_to_dagmc"
|
|
40
|
+
git clone --single-branch -b master --depth 1 https://bitbucket.org/fathomteam/moab/
|
|
41
|
+
cd moab
|
|
42
|
+
git checkout faf7e989c0fd0be4a19f61c1d4713afc5397c8a7
|
|
43
|
+
python -m pip install . --config-settings=cmake.args=-DENABLE_HDF5=ON
|
|
44
|
+
cd ..
|
|
45
|
+
python -c "import pymoab"
|
|
53
46
|
python -m pip install .[tests]
|
|
47
|
+
python -c "import cad_to_dagmc"
|
|
54
48
|
pytest -v tests
|
|
55
|
-
cd examples
|
|
56
49
|
python examples/surface_mesh/cadquery_assembly.py
|
|
57
50
|
python examples/surface_mesh/cadquery_compound.py
|
|
58
51
|
python examples/surface_mesh/cadquery_object_and_stp_file.py
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use this software, please cite it as below."
|
|
3
|
+
authors:
|
|
4
|
+
- family-names: "Shimwell"
|
|
5
|
+
given-names: "Jonathan"
|
|
6
|
+
orcid: "https://orcid.org/0000-0001-6909-0946"
|
|
7
|
+
title: "CAD to DAGMC. Convert CAD geometry (STP files) or Cadquery assemblies to DAGMC h5m files"
|
|
8
|
+
version: 0.7.0
|
|
9
|
+
date-released: 2024-4-14
|
|
10
|
+
url: "https://github.com/fusion-energy/cad_to_dagmc"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cad_to_dagmc
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.1
|
|
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
|
|
@@ -15,6 +15,8 @@ License-File: LICENSE
|
|
|
15
15
|
Requires-Dist: trimesh
|
|
16
16
|
Requires-Dist: networkx
|
|
17
17
|
Requires-Dist: cadquery>=2.4.0
|
|
18
|
+
Requires-Dist: numpy<=1.23.5
|
|
19
|
+
Requires-Dist: gmsh
|
|
18
20
|
Provides-Extra: tests
|
|
19
21
|
Requires-Dist: pytest; extra == "tests"
|
|
20
22
|
Requires-Dist: vtk; extra == "tests"
|
|
@@ -53,8 +55,6 @@ Also checkout these other software projects that also create DAGMC geometry [CAD
|
|
|
53
55
|
|
|
54
56
|
- Install using Mamba
|
|
55
57
|
- Install using Conda
|
|
56
|
-
- Install using Mamba and pip
|
|
57
|
-
- Install using Conda and pip
|
|
58
58
|
- Install using pip and source compilations
|
|
59
59
|
|
|
60
60
|
## Install using Mamba
|
|
@@ -105,73 +105,32 @@ Then you can install the cad_to_dagmc package
|
|
|
105
105
|
conda install -y -c conda-forge cad_to_dagmc
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
## Install using
|
|
108
|
+
## Install using pip and source compilations
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)
|
|
112
|
-
- [Anaconda](https://www.anaconda.com/download)
|
|
113
|
-
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)
|
|
110
|
+
It is also possible to avoid the use of conda/mamba and installing using pip.
|
|
114
111
|
|
|
115
|
-
|
|
112
|
+
First ensure hdf5 is installed as this is needed by MOAB pip install command
|
|
116
113
|
|
|
117
|
-
Create a new environment, I've chosen Python 3.10 here but newer versions are
|
|
118
|
-
also supported.
|
|
119
|
-
```bash
|
|
120
|
-
mamba create --name new_env python=3.10 -y
|
|
121
114
|
```
|
|
122
|
-
|
|
123
|
-
Activate the environment
|
|
124
|
-
```bash
|
|
125
|
-
mamba activate new_env
|
|
115
|
+
sudo apt-get install libhdf5-dev
|
|
126
116
|
```
|
|
127
117
|
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
mamba install -y -c conda-forge "moab>=5.3.0" gmsh python-gmsh
|
|
131
|
-
```
|
|
118
|
+
Then clone the latest version of MOAB and cd into the moab directory.
|
|
132
119
|
|
|
133
|
-
Then you can install the cad_to_dagmc package
|
|
134
|
-
```bash
|
|
135
|
-
pip install cad_to_dagmc
|
|
136
120
|
```
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
## Install using Conda and pip
|
|
140
|
-
|
|
141
|
-
In principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:
|
|
142
|
-
- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)
|
|
143
|
-
- [Anaconda](https://www.anaconda.com/download)
|
|
144
|
-
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)
|
|
145
|
-
|
|
146
|
-
This example uses Conda to install some dependencies that are not available via PyPi.
|
|
147
|
-
|
|
148
|
-
Create a new environment
|
|
149
|
-
```bash
|
|
150
|
-
conda create --name new_env python=3.10 -y
|
|
121
|
+
git clone master https://bitbucket.org/fathomteam/moab/
|
|
122
|
+
cd moab
|
|
151
123
|
```
|
|
152
124
|
|
|
153
|
-
|
|
154
|
-
```bash
|
|
155
|
-
conda activate new_env
|
|
125
|
+
Ensure pip is up to date as a new version is needed
|
|
156
126
|
```
|
|
157
|
-
|
|
158
|
-
Install the dependencies
|
|
159
|
-
```bash
|
|
160
|
-
conda install -y -c conda-forge "moab>=5.3.0" gmsh python-gmsh
|
|
127
|
+
python -m pip install --upgrade pip
|
|
161
128
|
```
|
|
162
129
|
|
|
163
|
-
|
|
164
|
-
```
|
|
165
|
-
pip install
|
|
130
|
+
Run the pip install command with cmake arguments.
|
|
131
|
+
```
|
|
132
|
+
pip install . --config-settings=cmake.args=-DENABLE_HDF5=ON
|
|
166
133
|
```
|
|
167
|
-
|
|
168
|
-
## Install using pip and source compilations
|
|
169
|
-
|
|
170
|
-
It should possible to avoid the use of conda and installing using pip and compiling from source.
|
|
171
|
-
|
|
172
|
-
First compile MOAB (and install Pymoab) from source
|
|
173
|
-
|
|
174
|
-
Then install gmsh from source (installing from pip appears to cause conflicts with the open cascade used in ocp and cadquery)
|
|
175
134
|
|
|
176
135
|
Then you can install the cad_to_dagmc package with ```pip```
|
|
177
136
|
|
|
@@ -199,7 +158,7 @@ The package requires newer versions of Linux. For example the package does not w
|
|
|
199
158
|
|
|
200
159
|
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```
|
|
201
160
|
|
|
202
|
-
Installing one of the package dependancies (gmsh) with pip appears to result in
|
|
161
|
+
Installing one of the package dependancies (gmsh) with pip appears to result in errors when passing cad objects in memory between cadquery / ocp and gmsh. The default method of passing cad objects is via file so this should not impact most users. The conda install gmsh appears to work fine with in memory passing of cad objects as the version of OCP matches between Gmsh and CadQuery.
|
|
203
162
|
|
|
204
163
|
|
|
205
164
|
# Usage - creation of DAGMC h5m files
|
|
@@ -32,8 +32,6 @@ Also checkout these other software projects that also create DAGMC geometry [CAD
|
|
|
32
32
|
|
|
33
33
|
- Install using Mamba
|
|
34
34
|
- Install using Conda
|
|
35
|
-
- Install using Mamba and pip
|
|
36
|
-
- Install using Conda and pip
|
|
37
35
|
- Install using pip and source compilations
|
|
38
36
|
|
|
39
37
|
## Install using Mamba
|
|
@@ -84,73 +82,32 @@ Then you can install the cad_to_dagmc package
|
|
|
84
82
|
conda install -y -c conda-forge cad_to_dagmc
|
|
85
83
|
```
|
|
86
84
|
|
|
87
|
-
## Install using
|
|
85
|
+
## Install using pip and source compilations
|
|
88
86
|
|
|
89
|
-
|
|
90
|
-
- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)
|
|
91
|
-
- [Anaconda](https://www.anaconda.com/download)
|
|
92
|
-
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)
|
|
87
|
+
It is also possible to avoid the use of conda/mamba and installing using pip.
|
|
93
88
|
|
|
94
|
-
|
|
89
|
+
First ensure hdf5 is installed as this is needed by MOAB pip install command
|
|
95
90
|
|
|
96
|
-
Create a new environment, I've chosen Python 3.10 here but newer versions are
|
|
97
|
-
also supported.
|
|
98
|
-
```bash
|
|
99
|
-
mamba create --name new_env python=3.10 -y
|
|
100
91
|
```
|
|
101
|
-
|
|
102
|
-
Activate the environment
|
|
103
|
-
```bash
|
|
104
|
-
mamba activate new_env
|
|
92
|
+
sudo apt-get install libhdf5-dev
|
|
105
93
|
```
|
|
106
94
|
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
mamba install -y -c conda-forge "moab>=5.3.0" gmsh python-gmsh
|
|
110
|
-
```
|
|
95
|
+
Then clone the latest version of MOAB and cd into the moab directory.
|
|
111
96
|
|
|
112
|
-
Then you can install the cad_to_dagmc package
|
|
113
|
-
```bash
|
|
114
|
-
pip install cad_to_dagmc
|
|
115
97
|
```
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
## Install using Conda and pip
|
|
119
|
-
|
|
120
|
-
In principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:
|
|
121
|
-
- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)
|
|
122
|
-
- [Anaconda](https://www.anaconda.com/download)
|
|
123
|
-
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)
|
|
124
|
-
|
|
125
|
-
This example uses Conda to install some dependencies that are not available via PyPi.
|
|
126
|
-
|
|
127
|
-
Create a new environment
|
|
128
|
-
```bash
|
|
129
|
-
conda create --name new_env python=3.10 -y
|
|
98
|
+
git clone master https://bitbucket.org/fathomteam/moab/
|
|
99
|
+
cd moab
|
|
130
100
|
```
|
|
131
101
|
|
|
132
|
-
|
|
133
|
-
```bash
|
|
134
|
-
conda activate new_env
|
|
102
|
+
Ensure pip is up to date as a new version is needed
|
|
135
103
|
```
|
|
136
|
-
|
|
137
|
-
Install the dependencies
|
|
138
|
-
```bash
|
|
139
|
-
conda install -y -c conda-forge "moab>=5.3.0" gmsh python-gmsh
|
|
104
|
+
python -m pip install --upgrade pip
|
|
140
105
|
```
|
|
141
106
|
|
|
142
|
-
|
|
143
|
-
```
|
|
144
|
-
pip install
|
|
107
|
+
Run the pip install command with cmake arguments.
|
|
108
|
+
```
|
|
109
|
+
pip install . --config-settings=cmake.args=-DENABLE_HDF5=ON
|
|
145
110
|
```
|
|
146
|
-
|
|
147
|
-
## Install using pip and source compilations
|
|
148
|
-
|
|
149
|
-
It should possible to avoid the use of conda and installing using pip and compiling from source.
|
|
150
|
-
|
|
151
|
-
First compile MOAB (and install Pymoab) from source
|
|
152
|
-
|
|
153
|
-
Then install gmsh from source (installing from pip appears to cause conflicts with the open cascade used in ocp and cadquery)
|
|
154
111
|
|
|
155
112
|
Then you can install the cad_to_dagmc package with ```pip```
|
|
156
113
|
|
|
@@ -178,7 +135,7 @@ The package requires newer versions of Linux. For example the package does not w
|
|
|
178
135
|
|
|
179
136
|
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```
|
|
180
137
|
|
|
181
|
-
Installing one of the package dependancies (gmsh) with pip appears to result in
|
|
138
|
+
Installing one of the package dependancies (gmsh) with pip appears to result in errors when passing cad objects in memory between cadquery / ocp and gmsh. The default method of passing cad objects is via file so this should not impact most users. The conda install gmsh appears to work fine with in memory passing of cad objects as the version of OCP matches between Gmsh and CadQuery.
|
|
182
139
|
|
|
183
140
|
|
|
184
141
|
# Usage - creation of DAGMC h5m files
|
|
@@ -56,7 +56,7 @@ assembly.save("twist_and_extrude.step")
|
|
|
56
56
|
|
|
57
57
|
my_model = CadToDagmc()
|
|
58
58
|
|
|
59
|
-
my_model.add_cadquery_object(result)
|
|
60
|
-
my_model.add_cadquery_object(result2)
|
|
59
|
+
my_model.add_cadquery_object(result, material_tags=["mat1"])
|
|
60
|
+
my_model.add_cadquery_object(result2, material_tags=["mat2"])
|
|
61
61
|
|
|
62
62
|
my_model.export_unstructured_mesh_file(filename="umesh.h5m", max_mesh_size=1, min_mesh_size=0.1)
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import typing
|
|
2
|
-
|
|
3
1
|
import cadquery as cq
|
|
4
2
|
import gmsh
|
|
5
3
|
import numpy as np
|
|
6
|
-
from cadquery import importers
|
|
4
|
+
from cadquery import importers, exporters
|
|
7
5
|
from pymoab import core, types
|
|
6
|
+
import tempfile
|
|
8
7
|
|
|
9
8
|
|
|
10
|
-
def _define_moab_core_and_tags() ->
|
|
9
|
+
def _define_moab_core_and_tags() -> tuple[core.Core, dict]:
|
|
11
10
|
"""Creates a MOAB Core instance which can be built up by adding sets of
|
|
12
11
|
triangles to the instance
|
|
13
12
|
|
|
@@ -62,14 +61,11 @@ def _define_moab_core_and_tags() -> typing.Tuple[core.Core, dict]:
|
|
|
62
61
|
|
|
63
62
|
|
|
64
63
|
def _vertices_to_h5m(
|
|
65
|
-
vertices:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
material_tags: typing.Iterable[str],
|
|
71
|
-
h5m_filename="dagmc.h5m",
|
|
72
|
-
implicit_complement_material_tag=None,
|
|
64
|
+
vertices: list[tuple[float, float, float]] | list["cadquery.occ_impl.geom.Vector"],
|
|
65
|
+
triangles_by_solid_by_face: list[list[tuple[int, int, int]]],
|
|
66
|
+
material_tags: list[str],
|
|
67
|
+
h5m_filename: str = "dagmc.h5m",
|
|
68
|
+
implicit_complement_material_tag: str | None = None,
|
|
73
69
|
):
|
|
74
70
|
"""Converts vertices and triangle sets into a tagged h5m file compatible
|
|
75
71
|
with DAGMC enabled neutronics simulations
|
|
@@ -194,8 +190,29 @@ def _vertices_to_h5m(
|
|
|
194
190
|
return h5m_filename
|
|
195
191
|
|
|
196
192
|
|
|
193
|
+
def get_volumes(gmsh, assembly, method="file"):
|
|
194
|
+
|
|
195
|
+
if method == "in memory":
|
|
196
|
+
volumes = gmsh.model.occ.importShapesNativePointer(assembly.wrapped._address())
|
|
197
|
+
gmsh.model.occ.synchronize()
|
|
198
|
+
elif method == "file":
|
|
199
|
+
with tempfile.NamedTemporaryFile(suffix=".step") as temp_file:
|
|
200
|
+
exporters.export(assembly, temp_file.name)
|
|
201
|
+
volumes = gmsh.model.occ.importShapes(temp_file.name)
|
|
202
|
+
gmsh.model.occ.synchronize()
|
|
203
|
+
|
|
204
|
+
return gmsh, volumes
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
def init_gmsh():
|
|
208
|
+
gmsh.initialize()
|
|
209
|
+
gmsh.option.setNumber("General.Terminal", 1)
|
|
210
|
+
gmsh.model.add("made_with_cad_to_dagmc_package")
|
|
211
|
+
return gmsh
|
|
212
|
+
|
|
213
|
+
|
|
197
214
|
def _mesh_brep(
|
|
198
|
-
|
|
215
|
+
gmsh,
|
|
199
216
|
min_mesh_size: float = 1,
|
|
200
217
|
max_mesh_size: float = 10,
|
|
201
218
|
mesh_algorithm: int = 1,
|
|
@@ -219,18 +236,12 @@ def _mesh_brep(
|
|
|
219
236
|
The resulting gmsh object and volumes
|
|
220
237
|
"""
|
|
221
238
|
|
|
222
|
-
gmsh.initialize()
|
|
223
|
-
gmsh.option.setNumber("General.Terminal", 1)
|
|
224
|
-
gmsh.model.add("made_with_cad_to_dagmc_package")
|
|
225
|
-
volumes = gmsh.model.occ.importShapesNativePointer(occ_shape)
|
|
226
|
-
gmsh.model.occ.synchronize()
|
|
227
|
-
|
|
228
239
|
gmsh.option.setNumber("Mesh.Algorithm", mesh_algorithm)
|
|
229
240
|
gmsh.option.setNumber("Mesh.MeshSizeMin", min_mesh_size)
|
|
230
241
|
gmsh.option.setNumber("Mesh.MeshSizeMax", max_mesh_size)
|
|
231
242
|
gmsh.model.mesh.generate(dimensions)
|
|
232
243
|
|
|
233
|
-
return gmsh
|
|
244
|
+
return gmsh
|
|
234
245
|
|
|
235
246
|
|
|
236
247
|
def mesh_to_vertices_and_triangles(
|
|
@@ -336,18 +347,18 @@ class MeshToDagmc:
|
|
|
336
347
|
|
|
337
348
|
def export_dagmc_h5m_file(
|
|
338
349
|
self,
|
|
339
|
-
material_tags:
|
|
340
|
-
implicit_complement_material_tag:
|
|
350
|
+
material_tags: list[str],
|
|
351
|
+
implicit_complement_material_tag: str | None = None,
|
|
341
352
|
filename: str = "dagmc.h5m",
|
|
342
353
|
):
|
|
343
354
|
"""Saves a DAGMC h5m file of the geometry
|
|
344
355
|
|
|
345
356
|
Args:
|
|
346
|
-
material_tags (
|
|
357
|
+
material_tags (list[str]): the names of the DAGMC
|
|
347
358
|
material tags to assign. These will need to be in the same
|
|
348
359
|
order as the volumes in the GMESH mesh and match the
|
|
349
360
|
material tags used in the neutronics code (e.g. OpenMC).
|
|
350
|
-
implicit_complement_material_tag (
|
|
361
|
+
implicit_complement_material_tag (str | None, optional):
|
|
351
362
|
the name of the material tag to use for the implicit
|
|
352
363
|
complement (void space). Defaults to None which is a vacuum.
|
|
353
364
|
filename (str, optional): _description_. Defaults to "dagmc.h5m".
|
|
@@ -395,13 +406,13 @@ class CadToDagmc:
|
|
|
395
406
|
self,
|
|
396
407
|
filename: str,
|
|
397
408
|
scale_factor: float = 1.0,
|
|
398
|
-
material_tags:
|
|
399
|
-
):
|
|
409
|
+
material_tags: list[str] | None = None,
|
|
410
|
+
) -> int:
|
|
400
411
|
"""Loads the parts from stp file into the model.
|
|
401
412
|
|
|
402
413
|
Args:
|
|
403
414
|
filename: the filename used to save the html graph.
|
|
404
|
-
material_tags (
|
|
415
|
+
material_tags (list[str]): the names of the DAGMC
|
|
405
416
|
material tags to assign. These will need to be in the
|
|
406
417
|
same order as the volumes in the geometry added (STP
|
|
407
418
|
file and CadQuery objects) and match the material tags
|
|
@@ -410,6 +421,9 @@ class CadToDagmc:
|
|
|
410
421
|
used to increase the size or decrease the size of the geometry.
|
|
411
422
|
Useful when converting the geometry to cm for use in neutronics
|
|
412
423
|
simulations.
|
|
424
|
+
|
|
425
|
+
Returns:
|
|
426
|
+
int: number of volumes in the stp file.
|
|
413
427
|
"""
|
|
414
428
|
part = importers.importStep(str(filename)).val()
|
|
415
429
|
|
|
@@ -417,25 +431,28 @@ class CadToDagmc:
|
|
|
417
431
|
scaled_part = part
|
|
418
432
|
else:
|
|
419
433
|
scaled_part = part.scale(scale_factor)
|
|
420
|
-
self.add_cadquery_object(cadquery_object=scaled_part, material_tags=material_tags)
|
|
434
|
+
return self.add_cadquery_object(cadquery_object=scaled_part, material_tags=material_tags)
|
|
421
435
|
|
|
422
436
|
def add_cadquery_object(
|
|
423
437
|
self,
|
|
424
|
-
cadquery_object:
|
|
425
|
-
cq.assembly.Assembly
|
|
426
|
-
|
|
427
|
-
material_tags:
|
|
428
|
-
):
|
|
438
|
+
cadquery_object: (
|
|
439
|
+
cq.assembly.Assembly | cq.occ_impl.shapes.Compound | cq.occ_impl.shapes.Solid
|
|
440
|
+
),
|
|
441
|
+
material_tags: list[str] | None,
|
|
442
|
+
) -> int:
|
|
429
443
|
"""Loads the parts from CadQuery object into the model.
|
|
430
444
|
|
|
431
445
|
Args:
|
|
432
446
|
cadquery_object: the cadquery object to convert, can be a CadQuery assembly
|
|
433
447
|
cadquery workplane or a cadquery solid
|
|
434
|
-
material_tags (Optional
|
|
448
|
+
material_tags (Optional list[str]): the names of the
|
|
435
449
|
DAGMC material tags to assign. These will need to be in the
|
|
436
450
|
same order as the volumes in the geometry added (STP file and
|
|
437
451
|
CadQuery objects) and match the material tags used in the
|
|
438
452
|
neutronics code (e.g. OpenMC).
|
|
453
|
+
|
|
454
|
+
Returns:
|
|
455
|
+
int: number of volumes in the stp file.
|
|
439
456
|
"""
|
|
440
457
|
|
|
441
458
|
if isinstance(cadquery_object, cq.assembly.Assembly):
|
|
@@ -451,12 +468,15 @@ class CadToDagmc:
|
|
|
451
468
|
self.material_tags = self.material_tags + material_tags
|
|
452
469
|
self.parts = self.parts + iterable_solids
|
|
453
470
|
|
|
471
|
+
return len(iterable_solids)
|
|
472
|
+
|
|
454
473
|
def export_unstructured_mesh_file(
|
|
455
474
|
self,
|
|
456
475
|
filename: str = "umesh.h5m",
|
|
457
476
|
min_mesh_size: float = 1,
|
|
458
477
|
max_mesh_size: float = 5,
|
|
459
478
|
mesh_algorithm: int = 1,
|
|
479
|
+
method: str = "file",
|
|
460
480
|
):
|
|
461
481
|
|
|
462
482
|
assembly = cq.Assembly()
|
|
@@ -465,8 +485,12 @@ class CadToDagmc:
|
|
|
465
485
|
|
|
466
486
|
imprinted_assembly, _ = cq.occ_impl.assembly.imprint(assembly)
|
|
467
487
|
|
|
468
|
-
gmsh
|
|
469
|
-
|
|
488
|
+
gmsh = init_gmsh()
|
|
489
|
+
|
|
490
|
+
gmsh, _ = get_volumes(gmsh, imprinted_assembly, method=method)
|
|
491
|
+
|
|
492
|
+
gmsh = _mesh_brep(
|
|
493
|
+
gmsh=gmsh,
|
|
470
494
|
min_mesh_size=min_mesh_size,
|
|
471
495
|
max_mesh_size=max_mesh_size,
|
|
472
496
|
mesh_algorithm=mesh_algorithm,
|
|
@@ -491,6 +515,7 @@ class CadToDagmc:
|
|
|
491
515
|
max_mesh_size: float = 5,
|
|
492
516
|
mesh_algorithm: int = 1,
|
|
493
517
|
dimensions: int = 2,
|
|
518
|
+
method: str = "file",
|
|
494
519
|
):
|
|
495
520
|
"""Saves a GMesh msh file of the geometry in either 2D surface mesh or
|
|
496
521
|
3D volume mesh.
|
|
@@ -502,6 +527,14 @@ class CadToDagmc:
|
|
|
502
527
|
mesh_algorithm: the gmsh mesh algorithm to use.
|
|
503
528
|
dimensions: The number of dimensions, 2 for a surface mesh 3 for a
|
|
504
529
|
volume mesh. Passed to gmsh.model.mesh.generate()
|
|
530
|
+
method: the method to use to import the geometry into gmsh. Options
|
|
531
|
+
are 'file' or 'in memory'. 'file' is the default and will write
|
|
532
|
+
the geometry to a temporary file before importing it into gmsh.
|
|
533
|
+
'in memory' will import the geometry directly into gmsh but
|
|
534
|
+
requires the version of OpenCASCADE used to build gmsh to be
|
|
535
|
+
the same as the version used by CadQuery. This is possible to
|
|
536
|
+
ensure when installing the package with Conda but harder when
|
|
537
|
+
installing from PyPI.
|
|
505
538
|
"""
|
|
506
539
|
|
|
507
540
|
assembly = cq.Assembly()
|
|
@@ -510,8 +543,12 @@ class CadToDagmc:
|
|
|
510
543
|
|
|
511
544
|
imprinted_assembly, _ = cq.occ_impl.assembly.imprint(assembly)
|
|
512
545
|
|
|
513
|
-
gmsh
|
|
514
|
-
|
|
546
|
+
gmsh = init_gmsh()
|
|
547
|
+
|
|
548
|
+
gmsh, _ = get_volumes(gmsh, imprinted_assembly, method=method)
|
|
549
|
+
|
|
550
|
+
gmsh = _mesh_brep(
|
|
551
|
+
gmsh=gmsh,
|
|
515
552
|
min_mesh_size=min_mesh_size,
|
|
516
553
|
max_mesh_size=max_mesh_size,
|
|
517
554
|
mesh_algorithm=mesh_algorithm,
|
|
@@ -530,7 +567,8 @@ class CadToDagmc:
|
|
|
530
567
|
min_mesh_size: float = 1,
|
|
531
568
|
max_mesh_size: float = 5,
|
|
532
569
|
mesh_algorithm: int = 1,
|
|
533
|
-
implicit_complement_material_tag:
|
|
570
|
+
implicit_complement_material_tag: str | None = None,
|
|
571
|
+
method: str = "file",
|
|
534
572
|
) -> str:
|
|
535
573
|
"""Saves a DAGMC h5m file of the geometry
|
|
536
574
|
|
|
@@ -540,10 +578,17 @@ class CadToDagmc:
|
|
|
540
578
|
min_mesh_size (float, optional): the minimum size of mesh elements to use. Defaults to 1.
|
|
541
579
|
max_mesh_size (float, optional): the maximum size of mesh elements to use. Defaults to 5.
|
|
542
580
|
mesh_algorithm (int, optional): the GMSH mesh algorithm to use.. Defaults to 1.
|
|
543
|
-
implicit_complement_material_tag (
|
|
581
|
+
implicit_complement_material_tag (str | None, optional):
|
|
544
582
|
the name of the material tag to use for the implicit complement
|
|
545
583
|
(void space). Defaults to None which is a vacuum. Defaults to None.
|
|
546
|
-
|
|
584
|
+
method: the method to use to import the geometry into gmsh. Options
|
|
585
|
+
are 'file' or 'in memory'. 'file' is the default and will write
|
|
586
|
+
the geometry to a temporary file before importing it into gmsh.
|
|
587
|
+
'in memory' will import the geometry directly into gmsh but
|
|
588
|
+
requires the version of OpenCASCADE used to build gmsh to be
|
|
589
|
+
the same as the version used by CadQuery. This is possible to
|
|
590
|
+
ensure when installing the package with Conda but harder when
|
|
591
|
+
installing from PyPI.
|
|
547
592
|
Returns:
|
|
548
593
|
str: the DAGMC filename saved
|
|
549
594
|
"""
|
|
@@ -570,8 +615,12 @@ class CadToDagmc:
|
|
|
570
615
|
|
|
571
616
|
_check_material_tags(material_tags_in_brep_order, self.parts)
|
|
572
617
|
|
|
573
|
-
gmsh
|
|
574
|
-
|
|
618
|
+
gmsh = init_gmsh()
|
|
619
|
+
|
|
620
|
+
gmsh, volumes = get_volumes(gmsh, imprinted_assembly, method=method)
|
|
621
|
+
|
|
622
|
+
gmsh = _mesh_brep(
|
|
623
|
+
gmsh=gmsh,
|
|
575
624
|
min_mesh_size=min_mesh_size,
|
|
576
625
|
max_mesh_size=max_mesh_size,
|
|
577
626
|
mesh_algorithm=mesh_algorithm,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cad_to_dagmc
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.1
|
|
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
|
|
@@ -15,6 +15,8 @@ License-File: LICENSE
|
|
|
15
15
|
Requires-Dist: trimesh
|
|
16
16
|
Requires-Dist: networkx
|
|
17
17
|
Requires-Dist: cadquery>=2.4.0
|
|
18
|
+
Requires-Dist: numpy<=1.23.5
|
|
19
|
+
Requires-Dist: gmsh
|
|
18
20
|
Provides-Extra: tests
|
|
19
21
|
Requires-Dist: pytest; extra == "tests"
|
|
20
22
|
Requires-Dist: vtk; extra == "tests"
|
|
@@ -53,8 +55,6 @@ Also checkout these other software projects that also create DAGMC geometry [CAD
|
|
|
53
55
|
|
|
54
56
|
- Install using Mamba
|
|
55
57
|
- Install using Conda
|
|
56
|
-
- Install using Mamba and pip
|
|
57
|
-
- Install using Conda and pip
|
|
58
58
|
- Install using pip and source compilations
|
|
59
59
|
|
|
60
60
|
## Install using Mamba
|
|
@@ -105,73 +105,32 @@ Then you can install the cad_to_dagmc package
|
|
|
105
105
|
conda install -y -c conda-forge cad_to_dagmc
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
## Install using
|
|
108
|
+
## Install using pip and source compilations
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)
|
|
112
|
-
- [Anaconda](https://www.anaconda.com/download)
|
|
113
|
-
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)
|
|
110
|
+
It is also possible to avoid the use of conda/mamba and installing using pip.
|
|
114
111
|
|
|
115
|
-
|
|
112
|
+
First ensure hdf5 is installed as this is needed by MOAB pip install command
|
|
116
113
|
|
|
117
|
-
Create a new environment, I've chosen Python 3.10 here but newer versions are
|
|
118
|
-
also supported.
|
|
119
|
-
```bash
|
|
120
|
-
mamba create --name new_env python=3.10 -y
|
|
121
114
|
```
|
|
122
|
-
|
|
123
|
-
Activate the environment
|
|
124
|
-
```bash
|
|
125
|
-
mamba activate new_env
|
|
115
|
+
sudo apt-get install libhdf5-dev
|
|
126
116
|
```
|
|
127
117
|
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
mamba install -y -c conda-forge "moab>=5.3.0" gmsh python-gmsh
|
|
131
|
-
```
|
|
118
|
+
Then clone the latest version of MOAB and cd into the moab directory.
|
|
132
119
|
|
|
133
|
-
Then you can install the cad_to_dagmc package
|
|
134
|
-
```bash
|
|
135
|
-
pip install cad_to_dagmc
|
|
136
120
|
```
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
## Install using Conda and pip
|
|
140
|
-
|
|
141
|
-
In principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:
|
|
142
|
-
- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)
|
|
143
|
-
- [Anaconda](https://www.anaconda.com/download)
|
|
144
|
-
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)
|
|
145
|
-
|
|
146
|
-
This example uses Conda to install some dependencies that are not available via PyPi.
|
|
147
|
-
|
|
148
|
-
Create a new environment
|
|
149
|
-
```bash
|
|
150
|
-
conda create --name new_env python=3.10 -y
|
|
121
|
+
git clone master https://bitbucket.org/fathomteam/moab/
|
|
122
|
+
cd moab
|
|
151
123
|
```
|
|
152
124
|
|
|
153
|
-
|
|
154
|
-
```bash
|
|
155
|
-
conda activate new_env
|
|
125
|
+
Ensure pip is up to date as a new version is needed
|
|
156
126
|
```
|
|
157
|
-
|
|
158
|
-
Install the dependencies
|
|
159
|
-
```bash
|
|
160
|
-
conda install -y -c conda-forge "moab>=5.3.0" gmsh python-gmsh
|
|
127
|
+
python -m pip install --upgrade pip
|
|
161
128
|
```
|
|
162
129
|
|
|
163
|
-
|
|
164
|
-
```
|
|
165
|
-
pip install
|
|
130
|
+
Run the pip install command with cmake arguments.
|
|
131
|
+
```
|
|
132
|
+
pip install . --config-settings=cmake.args=-DENABLE_HDF5=ON
|
|
166
133
|
```
|
|
167
|
-
|
|
168
|
-
## Install using pip and source compilations
|
|
169
|
-
|
|
170
|
-
It should possible to avoid the use of conda and installing using pip and compiling from source.
|
|
171
|
-
|
|
172
|
-
First compile MOAB (and install Pymoab) from source
|
|
173
|
-
|
|
174
|
-
Then install gmsh from source (installing from pip appears to cause conflicts with the open cascade used in ocp and cadquery)
|
|
175
134
|
|
|
176
135
|
Then you can install the cad_to_dagmc package with ```pip```
|
|
177
136
|
|
|
@@ -199,7 +158,7 @@ The package requires newer versions of Linux. For example the package does not w
|
|
|
199
158
|
|
|
200
159
|
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```
|
|
201
160
|
|
|
202
|
-
Installing one of the package dependancies (gmsh) with pip appears to result in
|
|
161
|
+
Installing one of the package dependancies (gmsh) with pip appears to result in errors when passing cad objects in memory between cadquery / ocp and gmsh. The default method of passing cad objects is via file so this should not impact most users. The conda install gmsh appears to work fine with in memory passing of cad objects as the version of OCP matches between Gmsh and CadQuery.
|
|
203
162
|
|
|
204
163
|
|
|
205
164
|
# Usage - creation of DAGMC h5m files
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
.gitignore
|
|
2
|
+
CITATION.cff
|
|
2
3
|
LICENSE
|
|
3
4
|
README.md
|
|
4
5
|
pyproject.toml
|
|
5
|
-
.github/workflows/anaconda-publish.yml
|
|
6
6
|
.github/workflows/black.yml
|
|
7
7
|
.github/workflows/ci_with_benchmarks.yml
|
|
8
|
-
.github/workflows/
|
|
8
|
+
.github/workflows/ci_with_conda_install.yml
|
|
9
9
|
.github/workflows/ci_with_pip_install.yml
|
|
10
10
|
.github/workflows/python-publish.yml
|
|
11
11
|
examples/surface_mesh/cadquery_assembly.py
|
|
@@ -32,11 +32,9 @@ src/cad_to_dagmc.egg-info/top_level.txt
|
|
|
32
32
|
tests/ENDFB-7.1-NNDC_H1.h5
|
|
33
33
|
tests/ball_reactor.brep
|
|
34
34
|
tests/curved_extrude.stp
|
|
35
|
-
tests/extrude_rectangle.step
|
|
36
35
|
tests/extrude_rectangle.stp
|
|
37
36
|
tests/multi_volume_cylinders.stp
|
|
38
37
|
tests/one_cube.brep
|
|
39
|
-
tests/single_cube.step
|
|
40
38
|
tests/single_cube.stp
|
|
41
39
|
tests/single_volume_thin.stp
|
|
42
40
|
tests/single_volume_thin.vtk
|
|
@@ -106,3 +106,35 @@ def test_h5m_file_tags():
|
|
|
106
106
|
2: "mat:mat2",
|
|
107
107
|
3: "mat:mat3",
|
|
108
108
|
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def test_add_cadquery_object_returned_volumes():
|
|
112
|
+
"""Checks that a add_cadquery_object method returns the correct number of volumes"""
|
|
113
|
+
|
|
114
|
+
sphere1 = cq.Workplane().sphere(20)
|
|
115
|
+
sphere2 = cq.Workplane().moveTo(100, 100).sphere(20)
|
|
116
|
+
sphere3 = cq.Workplane().moveTo(-100, -100).sphere(20)
|
|
117
|
+
|
|
118
|
+
c2d = CadToDagmc()
|
|
119
|
+
vols = c2d.add_cadquery_object(sphere1, material_tags=["mat1"])
|
|
120
|
+
assert vols == 1
|
|
121
|
+
|
|
122
|
+
assembly = cq.Assembly()
|
|
123
|
+
assembly.add(sphere1)
|
|
124
|
+
assembly.add(sphere2)
|
|
125
|
+
assembly.add(sphere3)
|
|
126
|
+
c2d = CadToDagmc()
|
|
127
|
+
vols = c2d.add_cadquery_object(assembly, material_tags=["mat1", "mat2", "mat3"])
|
|
128
|
+
assert vols == 3
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def test_add_stp_file_returned_volumes():
|
|
132
|
+
"""Checks that a add_stp_file method returns the correct number of volumes"""
|
|
133
|
+
|
|
134
|
+
c2d = CadToDagmc()
|
|
135
|
+
vols = c2d.add_stp_file("tests/curved_extrude.stp")
|
|
136
|
+
assert vols == 1
|
|
137
|
+
|
|
138
|
+
c2d = CadToDagmc()
|
|
139
|
+
vols = c2d.add_stp_file("tests/two_disconnected_cubes.stp")
|
|
140
|
+
assert vols == 2
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
name: anaconda-publish
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_dispatch:
|
|
5
|
-
release:
|
|
6
|
-
types: [published]
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
build:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
container: continuumio/miniconda3:4.12.0
|
|
12
|
-
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v3
|
|
15
|
-
|
|
16
|
-
- name: Set up conda
|
|
17
|
-
run: |
|
|
18
|
-
apt-get --allow-releaseinfo-change update
|
|
19
|
-
apt install -y libgl1-mesa-glx
|
|
20
|
-
conda install -y anaconda-client conda-build
|
|
21
|
-
conda config --set anaconda_upload no
|
|
22
|
-
- name: Build and publish to conda
|
|
23
|
-
env:
|
|
24
|
-
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
|
|
25
|
-
run: |
|
|
26
|
-
conda build conda -c conda-forge --config-file conda/conda_build_config.yaml
|
|
27
|
-
conda convert /opt/conda/conda-bld/linux-64/*.tar.bz2 --platform osx-64
|
|
28
|
-
anaconda upload -f /opt/conda/conda-bld/*/*.tar.bz2
|
|
29
|
-
|
|
30
|
-
# Note conversion to windows is not supported as MOAB is a dependency
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/examples/surface_mesh/cadquery_object_and_stp_file.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/examples/surface_mesh/multiple_cadquery_objects.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cad_to_dagmc-0.7.0 → cad_to_dagmc-0.7.1}/examples/surface_mesh/single_stp_file_multiple_volumes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|