cad-to-dagmc 0.7.6__tar.gz → 0.8.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.7.6 → cad_to_dagmc-0.8.0}/.github/workflows/ci_with_conda_install.yml +32 -20
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/.github/workflows/ci_with_pip_install.yml +2 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/PKG-INFO +29 -21
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/README.md +25 -17
- cad_to_dagmc-0.8.0/examples/surface_mesh/different_resolution_meshes.py +44 -0
- cad_to_dagmc-0.8.0/examples/unstrucutred_volume_mesh/different_resolution_meshes.py +44 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/pyproject.toml +2 -2
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/src/_version.py +2 -2
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/src/cad_to_dagmc/core.py +56 -8
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/src/cad_to_dagmc.egg-info/PKG-INFO +29 -21
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/src/cad_to_dagmc.egg-info/SOURCES.txt +2 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/src/cad_to_dagmc.egg-info/requires.txt +2 -2
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/.github/workflows/black.yml +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/.github/workflows/ci_with_benchmarks.yml +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/.github/workflows/python-publish.yml +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/.gitignore +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/CITATION.cff +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/LICENSE +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/examples/surface_mesh/cadquery_assembly.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/examples/surface_mesh/cadquery_assembly_with_scaled_geometry.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/examples/surface_mesh/cadquery_compound.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/examples/surface_mesh/cadquery_object_and_stp_file.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/examples/surface_mesh/cadquery_text.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/examples/surface_mesh/curved_cadquery_object_to_dagmc_surface_mesh.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/examples/surface_mesh/from_gmsh_mesh_file.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/examples/surface_mesh/multiple_cadquery_objects.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/examples/surface_mesh/multiple_stp_files.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/examples/surface_mesh/single_cadquery_object.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/examples/surface_mesh/single_stp_file.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/examples/surface_mesh/single_stp_file_multiple_volumes.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/examples/unstrucutred_volume_mesh/curved_cadquery_object_to_dagmc_volume_mesh.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/examples/unstrucutred_volume_mesh/simulate_unstrucutred_volume_mesh_with_openmc.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/setup.cfg +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/src/cad_to_dagmc/__init__.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/src/cad_to_dagmc.egg-info/dependency_links.txt +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/src/cad_to_dagmc.egg-info/top_level.txt +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/ENDFB-7.1-NNDC_H1.h5 +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/ball_reactor.brep +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/curved_extrude.stp +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/extrude_rectangle.stp +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/multi_volume_cylinders.stp +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/one_cube.brep +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/single_cube.stp +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/single_volume_thin.stp +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/single_volume_thin.vtk +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/test_brep_file.brep +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/test_file_creation.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/test_h5m_in_transport.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/test_loading_from_file_vs_shape_object.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/test_python_api.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/test_two_joined_cubes.brep +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/test_two_sep_cubes.brep +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/test_version.py +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/two_connected_cubes.stp +0 -0
- {cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/tests/two_disconnected_cubes.stp +0 -0
|
@@ -21,45 +21,57 @@ on:
|
|
|
21
21
|
jobs:
|
|
22
22
|
testing:
|
|
23
23
|
runs-on: ubuntu-latest
|
|
24
|
-
|
|
25
|
-
matrix:
|
|
26
|
-
python-version: ["3.10", "3.11", "3.12"]
|
|
24
|
+
|
|
27
25
|
steps:
|
|
28
26
|
- name: Checkout repository
|
|
29
27
|
uses: actions/checkout@v4
|
|
30
28
|
|
|
31
|
-
- name:
|
|
32
|
-
shell: bash
|
|
29
|
+
- name: Install system packages
|
|
33
30
|
run: |
|
|
34
|
-
wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
|
|
35
|
-
bash Miniforge3.sh -b -p "${HOME}/conda"
|
|
36
|
-
source "${HOME}/conda/etc/profile.d/conda.sh"
|
|
37
|
-
source "${HOME}/conda/etc/profile.d/mamba.sh"
|
|
38
|
-
sudo apt-get --allow-releaseinfo-change update
|
|
39
31
|
sudo apt-get update -y
|
|
40
32
|
sudo apt-get upgrade -y
|
|
41
33
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
|
|
35
|
+
- name: Set up Conda
|
|
36
|
+
uses: conda-incubator/setup-miniconda@v2
|
|
37
|
+
with:
|
|
38
|
+
activate-environment: ci-env
|
|
39
|
+
miniforge-version: latest
|
|
40
|
+
channels: conda-forge
|
|
41
|
+
|
|
42
|
+
- name: install dependencies
|
|
43
|
+
shell: bash -l {0}
|
|
44
|
+
run: |
|
|
45
|
+
conda install -y -c conda-forge "openmc=0.15.0=dagmc*nompi*" trimesh networkx cadquery gmsh python-gmsh vtk
|
|
46
|
+
python -m pip install .[tests]
|
|
47
|
+
|
|
48
|
+
- name: Test import
|
|
49
|
+
shell: bash -l {0}
|
|
50
|
+
run: |
|
|
48
51
|
python -c "import cad_to_dagmc"
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
|
|
53
|
+
- name: Run tests
|
|
54
|
+
shell: bash -l {0}
|
|
55
|
+
run: |
|
|
51
56
|
pytest -v tests
|
|
57
|
+
|
|
58
|
+
- name: Run examples
|
|
59
|
+
shell: bash -l {0}
|
|
60
|
+
run: |
|
|
52
61
|
python examples/surface_mesh/cadquery_assembly.py
|
|
62
|
+
python examples/surface_mesh/cadquery_assembly_with_scaled_geometry.py
|
|
53
63
|
python examples/surface_mesh/cadquery_compound.py
|
|
54
64
|
python examples/surface_mesh/cadquery_object_and_stp_file.py
|
|
55
65
|
python examples/surface_mesh/cadquery_text.py
|
|
56
66
|
python examples/surface_mesh/curved_cadquery_object_to_dagmc_surface_mesh.py
|
|
67
|
+
python examples/surface_mesh/from_gmsh_mesh_file.py
|
|
57
68
|
python examples/surface_mesh/multiple_cadquery_objects.py
|
|
58
69
|
python examples/surface_mesh/multiple_stp_files.py
|
|
59
|
-
python examples/surface_mesh/single_stp_file_multiple_volumes.py
|
|
60
70
|
python examples/surface_mesh/single_cadquery_object.py
|
|
71
|
+
python examples/surface_mesh/single_stp_file_multiple_volumes.py
|
|
61
72
|
python examples/surface_mesh/single_stp_file.py
|
|
62
|
-
python examples/surface_mesh/from_gmsh_mesh_file.py
|
|
63
73
|
python examples/unstrucutred_volume_mesh/curved_cadquery_object_to_dagmc_volume_mesh.py
|
|
64
74
|
python examples/unstrucutred_volume_mesh/simulate_unstrucutred_volume_mesh_with_openmc.py
|
|
75
|
+
python examples/unstrucutred_volume_mesh/different_resolution_meshes.py
|
|
76
|
+
python examples/surface_mesh/different_resolution_meshes.py
|
|
65
77
|
python examples/surface_mesh/cadquery_assembly_with_scaled_geometry.py
|
|
@@ -58,4 +58,6 @@ jobs:
|
|
|
58
58
|
python examples/surface_mesh/from_gmsh_mesh_file.py
|
|
59
59
|
python examples/unstrucutred_volume_mesh/curved_cadquery_object_to_dagmc_volume_mesh.py
|
|
60
60
|
python examples/unstrucutred_volume_mesh/simulate_unstrucutred_volume_mesh_with_openmc.py
|
|
61
|
+
python examples/unstrucutred_volume_mesh/different_resolution_meshes.py
|
|
62
|
+
python examples/surface_mesh/different_resolution_meshes.py
|
|
61
63
|
python examples/surface_mesh/cadquery_assembly_with_scaled_geometry.py
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: cad_to_dagmc
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.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,8 +14,8 @@ Description-Content-Type: text/markdown
|
|
|
14
14
|
License-File: LICENSE
|
|
15
15
|
Requires-Dist: trimesh
|
|
16
16
|
Requires-Dist: networkx
|
|
17
|
-
Requires-Dist: cadquery>=2.
|
|
18
|
-
Requires-Dist: numpy
|
|
17
|
+
Requires-Dist: cadquery>=2.5.2
|
|
18
|
+
Requires-Dist: numpy
|
|
19
19
|
Requires-Dist: gmsh
|
|
20
20
|
Provides-Extra: tests
|
|
21
21
|
Requires-Dist: pytest; extra == "tests"
|
|
@@ -35,23 +35,31 @@ Requires-Dist: vtk; extra == "tests"
|
|
|
35
35
|
[](https://pypi.org/project/cad_to_dagmc/)
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
A minimal package that converts CAD geometry to [DAGMC](https://github.com/svalinn/DAGMC/) h5m files
|
|
38
|
+
A minimal package that converts CAD geometry to [DAGMC](https://github.com/svalinn/DAGMC/) (h5m) files, [unstructured mesh](https://docs.openmc.org/en/latest/pythonapi/generated/openmc.UnstructuredMesh.html) files (vtk) and Gmsh (msh) files ready for use in neutronics simulations.
|
|
39
39
|
|
|
40
|
-
cad-to-dagmc can create:
|
|
40
|
+
cad-to-dagmc can create DAGMC compatible:
|
|
41
41
|
- surface meshes / faceted geometry / triangular meshes
|
|
42
42
|
- unstructured mesh / tetrahedral meshes / volume meshes
|
|
43
43
|
|
|
44
|
-
cad-to-dagmc can convert:
|
|
44
|
+
cad-to-dagmc can convert the following in to DAGMC compatible meshes:
|
|
45
45
|
- STEP files
|
|
46
46
|
- CadQuery objects (in memory)
|
|
47
|
+
- Gmsh meshes
|
|
48
|
+
|
|
49
|
+
Cad-to-dagmc offers a wide range of features including.
|
|
50
|
+
- Geometry scaling with ```scale_factor``` argument
|
|
51
|
+
- Model wide mesh size parameters with ```min_mesh_size``` and ```max_mesh_size``` arguments
|
|
52
|
+
- Volume specific mesh sizing parameters with the ```set_size``` argument
|
|
53
|
+
- Parallel meshing to quickly mesh the geometry using multiple CPU cores
|
|
54
|
+
- Imprint and merging of CAD geometry, or disable with the ```imprint``` argument
|
|
55
|
+
- Add geometry from multiple sources ([STEP](http://www.steptools.com/stds/step/) files, [CadQuery](https://cadquery.readthedocs.io) objects and [Gmsh](https://gmsh.info/) meshes)
|
|
56
|
+
- Ability to tag the DAGMC implicit complement material using the ```implicit_complement_material_tag``` argument
|
|
57
|
+
- Selected different Gmesh mesh algorithms (defaults to 1) using the ```mesh_algorithm``` argument
|
|
58
|
+
- Pass CadQuery objects in memory for fast transfer of geometry using the ```method``` argument
|
|
59
|
+
- Easy to install with [pip](https://pypi.org/project/cad-to-dagmc/) and [Conda/Mamba](https://anaconda.org/conda-forge/cad_to_dagmc)
|
|
60
|
+
- Well tested both with [CI unit tests](https://github.com/fusion-energy/cad_to_dagmc/tree/main/tests), integration tests and the CSG [Model Benchmark Zoo](https://github.com/fusion-energy/model_benchmark_zoo).
|
|
61
|
+
- Compatible with [Paramak](https://github.com/fusion-energy/paramak) geometry for fusion simulations.
|
|
47
62
|
|
|
48
|
-
cad-to-dagmc aims to produce DAGMC compatible h5m files from CAD geometry is intended to convert [STEP](http://www.steptools.com/stds/step/) files or [CadQuery](https://cadquery.readthedocs.io) objects to a [DAGMC](https://github.com/svalinn/DAGMC/) compatible h5m file.
|
|
49
|
-
|
|
50
|
-
The resulting DAGMC geometry can then be used for simulations in [OpenMC](https://github.com/openmc-dev/openmc/) or [other supported codes](https://svalinn.github.io/DAGMC/).
|
|
51
|
-
|
|
52
|
-
This package is tested with [pytest tests](https://github.com/fusion-energy/cad_to_dagmc/tree/main/tests) and also the DAGMC geometry made with this package is compared to simulation carried out with native constructive solid geometry, see [Model Benchmark Zoo](https://github.com/fusion-energy/model_benchmark_zoo) for more details.
|
|
53
|
-
|
|
54
|
-
Also checkout these other software projects that also create DAGMC geometry [CAD-to-OpenMC](https://github.com/openmsr/CAD_to_OpenMC), [Stellarmesh](https://github.com/Thea-Energy/stellarmesh) and [Coreform Cubit](https://coreform.com/products/coreform-cubit/)
|
|
55
63
|
|
|
56
64
|
# Installation options
|
|
57
65
|
|
|
@@ -146,7 +154,7 @@ You may also want to install OpenMC with DAGMC to make use of the h5m geometry f
|
|
|
146
154
|
|
|
147
155
|
To install OpenMC you can run ```mamba install -c conda-forge openmc``` however this more specific command makes sure the latest version of OpenMC which contains DAGMC is chosen by conda / mamba
|
|
148
156
|
```bash
|
|
149
|
-
mamba install -c conda-forge -y "openmc=0.
|
|
157
|
+
mamba install -c conda-forge -y "openmc=0.15.0=dagmc*nompi*"
|
|
150
158
|
```
|
|
151
159
|
|
|
152
160
|
It might not be possible to install OpenMC and cad-to-dagmc in the same conda/mamba python environment so you may have to create a new conda/mamba environment and install OpenMC there.
|
|
@@ -160,15 +168,15 @@ The package requires newer versions of Linux. For example the package does not w
|
|
|
160
168
|
|
|
161
169
|
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```
|
|
162
170
|
|
|
163
|
-
Installing one of the package dependancies (
|
|
171
|
+
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.
|
|
164
172
|
|
|
165
173
|
|
|
166
|
-
# Usage
|
|
174
|
+
# Usage
|
|
167
175
|
|
|
168
|
-
For examples see the [examples folder](https://github.com/fusion-energy/cad_to_dagmc/tree/main/examples)
|
|
176
|
+
For examples showing creation of DAGMC h5m files, vtk files and usage within OpenMC transport code see the [examples folder](https://github.com/fusion-energy/cad_to_dagmc/tree/main/examples)
|
|
169
177
|
|
|
170
|
-
|
|
178
|
+
For more examples see the CAD tasks in the [neutronics-workshop](https://github.com/fusion-energy/neutronics-workshop) and [model benchmark zoo](https://github.com/fusion-energy/model_benchmark_zoo)
|
|
171
179
|
|
|
172
|
-
|
|
180
|
+
# Related software
|
|
173
181
|
|
|
174
|
-
|
|
182
|
+
Also checkout these other software projects that also create DAGMC geometry [CAD-to-OpenMC](https://github.com/openmsr/CAD_to_OpenMC), [Stellarmesh](https://github.com/Thea-Energy/stellarmesh) and [Coreform Cubit](https://coreform.com/products/coreform-cubit/).
|
|
@@ -12,23 +12,31 @@
|
|
|
12
12
|
[](https://pypi.org/project/cad_to_dagmc/)
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
A minimal package that converts CAD geometry to [DAGMC](https://github.com/svalinn/DAGMC/) h5m files
|
|
15
|
+
A minimal package that converts CAD geometry to [DAGMC](https://github.com/svalinn/DAGMC/) (h5m) files, [unstructured mesh](https://docs.openmc.org/en/latest/pythonapi/generated/openmc.UnstructuredMesh.html) files (vtk) and Gmsh (msh) files ready for use in neutronics simulations.
|
|
16
16
|
|
|
17
|
-
cad-to-dagmc can create:
|
|
17
|
+
cad-to-dagmc can create DAGMC compatible:
|
|
18
18
|
- surface meshes / faceted geometry / triangular meshes
|
|
19
19
|
- unstructured mesh / tetrahedral meshes / volume meshes
|
|
20
20
|
|
|
21
|
-
cad-to-dagmc can convert:
|
|
21
|
+
cad-to-dagmc can convert the following in to DAGMC compatible meshes:
|
|
22
22
|
- STEP files
|
|
23
23
|
- CadQuery objects (in memory)
|
|
24
|
+
- Gmsh meshes
|
|
25
|
+
|
|
26
|
+
Cad-to-dagmc offers a wide range of features including.
|
|
27
|
+
- Geometry scaling with ```scale_factor``` argument
|
|
28
|
+
- Model wide mesh size parameters with ```min_mesh_size``` and ```max_mesh_size``` arguments
|
|
29
|
+
- Volume specific mesh sizing parameters with the ```set_size``` argument
|
|
30
|
+
- Parallel meshing to quickly mesh the geometry using multiple CPU cores
|
|
31
|
+
- Imprint and merging of CAD geometry, or disable with the ```imprint``` argument
|
|
32
|
+
- Add geometry from multiple sources ([STEP](http://www.steptools.com/stds/step/) files, [CadQuery](https://cadquery.readthedocs.io) objects and [Gmsh](https://gmsh.info/) meshes)
|
|
33
|
+
- Ability to tag the DAGMC implicit complement material using the ```implicit_complement_material_tag``` argument
|
|
34
|
+
- Selected different Gmesh mesh algorithms (defaults to 1) using the ```mesh_algorithm``` argument
|
|
35
|
+
- Pass CadQuery objects in memory for fast transfer of geometry using the ```method``` argument
|
|
36
|
+
- Easy to install with [pip](https://pypi.org/project/cad-to-dagmc/) and [Conda/Mamba](https://anaconda.org/conda-forge/cad_to_dagmc)
|
|
37
|
+
- Well tested both with [CI unit tests](https://github.com/fusion-energy/cad_to_dagmc/tree/main/tests), integration tests and the CSG [Model Benchmark Zoo](https://github.com/fusion-energy/model_benchmark_zoo).
|
|
38
|
+
- Compatible with [Paramak](https://github.com/fusion-energy/paramak) geometry for fusion simulations.
|
|
24
39
|
|
|
25
|
-
cad-to-dagmc aims to produce DAGMC compatible h5m files from CAD geometry is intended to convert [STEP](http://www.steptools.com/stds/step/) files or [CadQuery](https://cadquery.readthedocs.io) objects to a [DAGMC](https://github.com/svalinn/DAGMC/) compatible h5m file.
|
|
26
|
-
|
|
27
|
-
The resulting DAGMC geometry can then be used for simulations in [OpenMC](https://github.com/openmc-dev/openmc/) or [other supported codes](https://svalinn.github.io/DAGMC/).
|
|
28
|
-
|
|
29
|
-
This package is tested with [pytest tests](https://github.com/fusion-energy/cad_to_dagmc/tree/main/tests) and also the DAGMC geometry made with this package is compared to simulation carried out with native constructive solid geometry, see [Model Benchmark Zoo](https://github.com/fusion-energy/model_benchmark_zoo) for more details.
|
|
30
|
-
|
|
31
|
-
Also checkout these other software projects that also create DAGMC geometry [CAD-to-OpenMC](https://github.com/openmsr/CAD_to_OpenMC), [Stellarmesh](https://github.com/Thea-Energy/stellarmesh) and [Coreform Cubit](https://coreform.com/products/coreform-cubit/)
|
|
32
40
|
|
|
33
41
|
# Installation options
|
|
34
42
|
|
|
@@ -123,7 +131,7 @@ You may also want to install OpenMC with DAGMC to make use of the h5m geometry f
|
|
|
123
131
|
|
|
124
132
|
To install OpenMC you can run ```mamba install -c conda-forge openmc``` however this more specific command makes sure the latest version of OpenMC which contains DAGMC is chosen by conda / mamba
|
|
125
133
|
```bash
|
|
126
|
-
mamba install -c conda-forge -y "openmc=0.
|
|
134
|
+
mamba install -c conda-forge -y "openmc=0.15.0=dagmc*nompi*"
|
|
127
135
|
```
|
|
128
136
|
|
|
129
137
|
It might not be possible to install OpenMC and cad-to-dagmc in the same conda/mamba python environment so you may have to create a new conda/mamba environment and install OpenMC there.
|
|
@@ -137,15 +145,15 @@ The package requires newer versions of Linux. For example the package does not w
|
|
|
137
145
|
|
|
138
146
|
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```
|
|
139
147
|
|
|
140
|
-
Installing one of the package dependancies (
|
|
148
|
+
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.
|
|
141
149
|
|
|
142
150
|
|
|
143
|
-
# Usage
|
|
151
|
+
# Usage
|
|
144
152
|
|
|
145
|
-
For examples see the [examples folder](https://github.com/fusion-energy/cad_to_dagmc/tree/main/examples)
|
|
153
|
+
For examples showing creation of DAGMC h5m files, vtk files and usage within OpenMC transport code see the [examples folder](https://github.com/fusion-energy/cad_to_dagmc/tree/main/examples)
|
|
146
154
|
|
|
147
|
-
|
|
155
|
+
For more examples see the CAD tasks in the [neutronics-workshop](https://github.com/fusion-energy/neutronics-workshop) and [model benchmark zoo](https://github.com/fusion-energy/model_benchmark_zoo)
|
|
148
156
|
|
|
149
|
-
|
|
157
|
+
# Related software
|
|
150
158
|
|
|
151
|
-
|
|
159
|
+
Also checkout these other software projects that also create DAGMC geometry [CAD-to-OpenMC](https://github.com/openmsr/CAD_to_OpenMC), [Stellarmesh](https://github.com/Thea-Energy/stellarmesh) and [Coreform Cubit](https://coreform.com/products/coreform-cubit/).
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# This example makes 3 CAD boxes
|
|
2
|
+
# Meshes the 3 volumes with different resolutions
|
|
3
|
+
# exports the mesh to a DAGMC h5m file and GMsh msh file
|
|
4
|
+
import cadquery as cq
|
|
5
|
+
from cad_to_dagmc import CadToDagmc
|
|
6
|
+
|
|
7
|
+
box_set_size_course_mesh = cq.Workplane().box(1, 1, 2)
|
|
8
|
+
box_set_size_fine_mesh = cq.Workplane().moveTo(1, 0.5).box(1, 1, 1.5)
|
|
9
|
+
box_set_global_mesh = cq.Workplane().moveTo(2, 1).box(1, 1, 1)
|
|
10
|
+
|
|
11
|
+
assembly = cq.Assembly()
|
|
12
|
+
assembly.add(box_set_size_course_mesh, color=cq.Color(0, 0, 1))
|
|
13
|
+
assembly.add(box_set_size_fine_mesh, color=cq.Color(0, 1, 0))
|
|
14
|
+
assembly.add(box_set_global_mesh, color=cq.Color(1, 0, 0))
|
|
15
|
+
|
|
16
|
+
assembly.export("different_resolution_meshes.step")
|
|
17
|
+
|
|
18
|
+
# uncomment to see the assembly in a pop up vtk viewer
|
|
19
|
+
# from cadquery import vis
|
|
20
|
+
# vis.show(assembly)
|
|
21
|
+
|
|
22
|
+
model = CadToDagmc()
|
|
23
|
+
model.add_cadquery_object(assembly, material_tags=["mat1", "mat2", "mat3"])
|
|
24
|
+
|
|
25
|
+
model.export_dagmc_h5m_file(
|
|
26
|
+
filename="different_resolution_meshes.h5m",
|
|
27
|
+
min_mesh_size=0.01,
|
|
28
|
+
max_mesh_size=10,
|
|
29
|
+
set_size={
|
|
30
|
+
1: 0.9,
|
|
31
|
+
2: 0.1,
|
|
32
|
+
}, # not volume 3 is not specified in the set_size so it uses only the min max mesh sizes
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
model.export_gmsh_mesh_file(
|
|
36
|
+
filename="different_resolution_meshes.msh",
|
|
37
|
+
dimensions=2,
|
|
38
|
+
min_mesh_size=0.01,
|
|
39
|
+
max_mesh_size=10,
|
|
40
|
+
set_size={
|
|
41
|
+
1: 0.9,
|
|
42
|
+
2: 0.1,
|
|
43
|
+
}, # not volume 3 is not specified in the set_size so it uses only the min max mesh sizes
|
|
44
|
+
)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# This example makes 3 CAD boxes
|
|
2
|
+
# Meshes the 3 volumes with different resolutions
|
|
3
|
+
# exports the mesh to a DAGMC unstructured VTK file and Gmsh msh file
|
|
4
|
+
import cadquery as cq
|
|
5
|
+
from cad_to_dagmc import CadToDagmc
|
|
6
|
+
|
|
7
|
+
box_set_size_course_mesh = cq.Workplane().box(1, 1, 2)
|
|
8
|
+
box_set_size_fine_mesh = cq.Workplane().moveTo(1, 0.5).box(1, 1, 1.5)
|
|
9
|
+
box_set_global_mesh = cq.Workplane().moveTo(2, 1).box(1, 1, 1)
|
|
10
|
+
|
|
11
|
+
assembly = cq.Assembly()
|
|
12
|
+
assembly.add(box_set_size_course_mesh, color=cq.Color(0, 0, 1))
|
|
13
|
+
assembly.add(box_set_size_fine_mesh, color=cq.Color(0, 1, 0))
|
|
14
|
+
assembly.add(box_set_global_mesh, color=cq.Color(1, 0, 0))
|
|
15
|
+
|
|
16
|
+
assembly.export("different_resolution_meshes.step")
|
|
17
|
+
|
|
18
|
+
# uncomment to see the assembly in a pop up vtk viewer
|
|
19
|
+
# from cadquery import vis
|
|
20
|
+
# vis.show(assembly)
|
|
21
|
+
|
|
22
|
+
model = CadToDagmc()
|
|
23
|
+
model.add_cadquery_object(assembly, material_tags=["mat1", "mat2", "mat3"])
|
|
24
|
+
|
|
25
|
+
model.export_gmsh_mesh_file(
|
|
26
|
+
filename="different_resolution_meshes.msh",
|
|
27
|
+
dimensions=3,
|
|
28
|
+
min_mesh_size=0.01,
|
|
29
|
+
max_mesh_size=10,
|
|
30
|
+
set_size={
|
|
31
|
+
1: 0.9,
|
|
32
|
+
2: 0.1,
|
|
33
|
+
}, # not volume 3 is not specified in the set_size so it uses only the min max mesh sizes
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
model.export_unstructured_mesh_file(
|
|
37
|
+
filename="different_resolution_meshes.vtk",
|
|
38
|
+
min_mesh_size=0.01,
|
|
39
|
+
max_mesh_size=10,
|
|
40
|
+
set_size={
|
|
41
|
+
1: 0.9,
|
|
42
|
+
2: 0.1,
|
|
43
|
+
}, # not volume 3 is not specified in the set_size so it uses only the min max mesh sizes
|
|
44
|
+
)
|
|
@@ -235,10 +235,11 @@ def init_gmsh():
|
|
|
235
235
|
|
|
236
236
|
def _mesh_brep(
|
|
237
237
|
gmsh,
|
|
238
|
-
min_mesh_size: float =
|
|
239
|
-
max_mesh_size: float =
|
|
238
|
+
min_mesh_size: float | None = None,
|
|
239
|
+
max_mesh_size: float | None = None,
|
|
240
240
|
mesh_algorithm: int = 1,
|
|
241
241
|
dimensions: int = 2,
|
|
242
|
+
set_size: dict[int, float] | None = None,
|
|
242
243
|
):
|
|
243
244
|
"""Creates a conformal surface meshes of the volumes in a Brep file using Gmsh.
|
|
244
245
|
|
|
@@ -252,15 +253,49 @@ def _mesh_brep(
|
|
|
252
253
|
gmsh.option.setNumber("Mesh.Algorithm", mesh_algorithm)
|
|
253
254
|
dimensions: The number of dimensions, 2 for a surface mesh 3 for a
|
|
254
255
|
volume mesh. Passed to gmsh.model.mesh.generate()
|
|
256
|
+
set_size: a dictionary of volume ids (int) and target mesh sizes
|
|
257
|
+
(floats) to set for each volume, passed to gmsh.model.mesh.setSize.
|
|
255
258
|
|
|
256
259
|
Returns:
|
|
257
260
|
The resulting gmsh object and volumes
|
|
258
261
|
"""
|
|
262
|
+
if min_mesh_size and max_mesh_size:
|
|
263
|
+
if min_mesh_size > max_mesh_size:
|
|
264
|
+
raise ValueError(
|
|
265
|
+
f"min_mesh_size must be less than or equal to max_mesh_size. Currently min_mesh_size is set to {min_mesh_size} and max_mesh_size is set to {max_mesh_size}"
|
|
266
|
+
)
|
|
267
|
+
|
|
268
|
+
if min_mesh_size:
|
|
269
|
+
gmsh.option.setNumber("Mesh.MeshSizeMin", min_mesh_size)
|
|
270
|
+
|
|
271
|
+
if max_mesh_size:
|
|
272
|
+
gmsh.option.setNumber("Mesh.MeshSizeMax", max_mesh_size)
|
|
259
273
|
|
|
260
274
|
gmsh.option.setNumber("Mesh.Algorithm", mesh_algorithm)
|
|
261
|
-
gmsh.option.setNumber("Mesh.MeshSizeMin", min_mesh_size)
|
|
262
|
-
gmsh.option.setNumber("Mesh.MeshSizeMax", max_mesh_size)
|
|
263
275
|
gmsh.option.setNumber("General.NumThreads", 0) # Use all available cores
|
|
276
|
+
|
|
277
|
+
if set_size:
|
|
278
|
+
volumes = gmsh.model.getEntities(3)
|
|
279
|
+
available_volumes = [volume[1] for volume in volumes]
|
|
280
|
+
print("volumes", volumes)
|
|
281
|
+
for volume_id, size in set_size.items():
|
|
282
|
+
if volume_id in available_volumes:
|
|
283
|
+
size = set_size[volume_id]
|
|
284
|
+
if isinstance(size, dict):
|
|
285
|
+
# TODO face specific mesh sizes
|
|
286
|
+
pass
|
|
287
|
+
else:
|
|
288
|
+
boundaries = gmsh.model.getBoundary(
|
|
289
|
+
[(3, volume_id)], recursive=True
|
|
290
|
+
) # dim must be set to 3
|
|
291
|
+
print("boundaries", boundaries)
|
|
292
|
+
gmsh.model.mesh.setSize(boundaries, size)
|
|
293
|
+
print(f"Set size of {size} for volume {volume_id}")
|
|
294
|
+
else:
|
|
295
|
+
raise ValueError(
|
|
296
|
+
f"volume ID of {volume_id} set in set_sizes but not found in available volumes {volumes}"
|
|
297
|
+
)
|
|
298
|
+
|
|
264
299
|
gmsh.model.mesh.generate(dimensions)
|
|
265
300
|
|
|
266
301
|
return gmsh
|
|
@@ -508,6 +543,7 @@ class CadToDagmc:
|
|
|
508
543
|
method: str = "file",
|
|
509
544
|
scale_factor: float = 1.0,
|
|
510
545
|
imprint: bool = True,
|
|
546
|
+
set_size: dict[int, float] | None = None,
|
|
511
547
|
):
|
|
512
548
|
"""
|
|
513
549
|
Exports an unstructured mesh file in VTK format for use with openmc.UnstructuredMesh.
|
|
@@ -539,6 +575,9 @@ class CadToDagmc:
|
|
|
539
575
|
normally needed to ensure the geometry is meshed correctly. However if
|
|
540
576
|
you know your geometry does not need imprinting you can set this to False
|
|
541
577
|
and this can save time.
|
|
578
|
+
set_size: a dictionary of volume ids (int) and target mesh sizes
|
|
579
|
+
(floats) to set for each volume, passed to gmsh.model.mesh.setSize.
|
|
580
|
+
|
|
542
581
|
|
|
543
582
|
Returns:
|
|
544
583
|
--------
|
|
@@ -570,6 +609,7 @@ class CadToDagmc:
|
|
|
570
609
|
max_mesh_size=max_mesh_size,
|
|
571
610
|
mesh_algorithm=mesh_algorithm,
|
|
572
611
|
dimensions=3,
|
|
612
|
+
set_size=set_size,
|
|
573
613
|
)
|
|
574
614
|
|
|
575
615
|
# makes the folder if it does not exist
|
|
@@ -589,13 +629,14 @@ class CadToDagmc:
|
|
|
589
629
|
def export_gmsh_mesh_file(
|
|
590
630
|
self,
|
|
591
631
|
filename: str = "mesh.msh",
|
|
592
|
-
min_mesh_size: float =
|
|
593
|
-
max_mesh_size: float =
|
|
632
|
+
min_mesh_size: float | None = None,
|
|
633
|
+
max_mesh_size: float | None = None,
|
|
594
634
|
mesh_algorithm: int = 1,
|
|
595
635
|
dimensions: int = 2,
|
|
596
636
|
method: str = "file",
|
|
597
637
|
scale_factor: float = 1.0,
|
|
598
638
|
imprint: bool = True,
|
|
639
|
+
set_size: dict[int, float] | None = None,
|
|
599
640
|
):
|
|
600
641
|
"""Saves a GMesh msh file of the geometry in either 2D surface mesh or
|
|
601
642
|
3D volume mesh.
|
|
@@ -622,6 +663,8 @@ class CadToDagmc:
|
|
|
622
663
|
normally needed to ensure the geometry is meshed correctly. However if
|
|
623
664
|
you know your geometry does not need imprinting you can set this to False
|
|
624
665
|
and this can save time.
|
|
666
|
+
set_size: a dictionary of volume ids (int) and target mesh sizes
|
|
667
|
+
(floats) to set for each volume, passed to gmsh.model.mesh.setSize.
|
|
625
668
|
"""
|
|
626
669
|
|
|
627
670
|
assembly = cq.Assembly()
|
|
@@ -643,6 +686,7 @@ class CadToDagmc:
|
|
|
643
686
|
max_mesh_size=max_mesh_size,
|
|
644
687
|
mesh_algorithm=mesh_algorithm,
|
|
645
688
|
dimensions=dimensions,
|
|
689
|
+
set_size=set_size,
|
|
646
690
|
)
|
|
647
691
|
|
|
648
692
|
# makes the folder if it does not exist
|
|
@@ -662,13 +706,14 @@ class CadToDagmc:
|
|
|
662
706
|
def export_dagmc_h5m_file(
|
|
663
707
|
self,
|
|
664
708
|
filename: str = "dagmc.h5m",
|
|
665
|
-
min_mesh_size: float =
|
|
666
|
-
max_mesh_size: float =
|
|
709
|
+
min_mesh_size: float | None = None,
|
|
710
|
+
max_mesh_size: float | None = None,
|
|
667
711
|
mesh_algorithm: int = 1,
|
|
668
712
|
implicit_complement_material_tag: str | None = None,
|
|
669
713
|
method: str = "file",
|
|
670
714
|
scale_factor: float = 1.0,
|
|
671
715
|
imprint: bool = True,
|
|
716
|
+
set_size: dict[int, float] | None = None,
|
|
672
717
|
) -> str:
|
|
673
718
|
"""Saves a DAGMC h5m file of the geometry
|
|
674
719
|
|
|
@@ -695,6 +740,8 @@ class CadToDagmc:
|
|
|
695
740
|
normally needed to ensure the geometry is meshed correctly. However if
|
|
696
741
|
you know your geometry does not need imprinting you can set this to False
|
|
697
742
|
and this can save time.
|
|
743
|
+
set_size: a dictionary of volume ids (int) and target mesh sizes
|
|
744
|
+
(floats) to set for each volume, passed to gmsh.model.mesh.setSize.
|
|
698
745
|
|
|
699
746
|
Returns:
|
|
700
747
|
str: the DAGMC filename saved
|
|
@@ -739,6 +786,7 @@ class CadToDagmc:
|
|
|
739
786
|
min_mesh_size=min_mesh_size,
|
|
740
787
|
max_mesh_size=max_mesh_size,
|
|
741
788
|
mesh_algorithm=mesh_algorithm,
|
|
789
|
+
set_size=set_size,
|
|
742
790
|
)
|
|
743
791
|
|
|
744
792
|
dims_and_vol_ids = volumes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: cad_to_dagmc
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.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,8 +14,8 @@ Description-Content-Type: text/markdown
|
|
|
14
14
|
License-File: LICENSE
|
|
15
15
|
Requires-Dist: trimesh
|
|
16
16
|
Requires-Dist: networkx
|
|
17
|
-
Requires-Dist: cadquery>=2.
|
|
18
|
-
Requires-Dist: numpy
|
|
17
|
+
Requires-Dist: cadquery>=2.5.2
|
|
18
|
+
Requires-Dist: numpy
|
|
19
19
|
Requires-Dist: gmsh
|
|
20
20
|
Provides-Extra: tests
|
|
21
21
|
Requires-Dist: pytest; extra == "tests"
|
|
@@ -35,23 +35,31 @@ Requires-Dist: vtk; extra == "tests"
|
|
|
35
35
|
[](https://pypi.org/project/cad_to_dagmc/)
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
A minimal package that converts CAD geometry to [DAGMC](https://github.com/svalinn/DAGMC/) h5m files
|
|
38
|
+
A minimal package that converts CAD geometry to [DAGMC](https://github.com/svalinn/DAGMC/) (h5m) files, [unstructured mesh](https://docs.openmc.org/en/latest/pythonapi/generated/openmc.UnstructuredMesh.html) files (vtk) and Gmsh (msh) files ready for use in neutronics simulations.
|
|
39
39
|
|
|
40
|
-
cad-to-dagmc can create:
|
|
40
|
+
cad-to-dagmc can create DAGMC compatible:
|
|
41
41
|
- surface meshes / faceted geometry / triangular meshes
|
|
42
42
|
- unstructured mesh / tetrahedral meshes / volume meshes
|
|
43
43
|
|
|
44
|
-
cad-to-dagmc can convert:
|
|
44
|
+
cad-to-dagmc can convert the following in to DAGMC compatible meshes:
|
|
45
45
|
- STEP files
|
|
46
46
|
- CadQuery objects (in memory)
|
|
47
|
+
- Gmsh meshes
|
|
48
|
+
|
|
49
|
+
Cad-to-dagmc offers a wide range of features including.
|
|
50
|
+
- Geometry scaling with ```scale_factor``` argument
|
|
51
|
+
- Model wide mesh size parameters with ```min_mesh_size``` and ```max_mesh_size``` arguments
|
|
52
|
+
- Volume specific mesh sizing parameters with the ```set_size``` argument
|
|
53
|
+
- Parallel meshing to quickly mesh the geometry using multiple CPU cores
|
|
54
|
+
- Imprint and merging of CAD geometry, or disable with the ```imprint``` argument
|
|
55
|
+
- Add geometry from multiple sources ([STEP](http://www.steptools.com/stds/step/) files, [CadQuery](https://cadquery.readthedocs.io) objects and [Gmsh](https://gmsh.info/) meshes)
|
|
56
|
+
- Ability to tag the DAGMC implicit complement material using the ```implicit_complement_material_tag``` argument
|
|
57
|
+
- Selected different Gmesh mesh algorithms (defaults to 1) using the ```mesh_algorithm``` argument
|
|
58
|
+
- Pass CadQuery objects in memory for fast transfer of geometry using the ```method``` argument
|
|
59
|
+
- Easy to install with [pip](https://pypi.org/project/cad-to-dagmc/) and [Conda/Mamba](https://anaconda.org/conda-forge/cad_to_dagmc)
|
|
60
|
+
- Well tested both with [CI unit tests](https://github.com/fusion-energy/cad_to_dagmc/tree/main/tests), integration tests and the CSG [Model Benchmark Zoo](https://github.com/fusion-energy/model_benchmark_zoo).
|
|
61
|
+
- Compatible with [Paramak](https://github.com/fusion-energy/paramak) geometry for fusion simulations.
|
|
47
62
|
|
|
48
|
-
cad-to-dagmc aims to produce DAGMC compatible h5m files from CAD geometry is intended to convert [STEP](http://www.steptools.com/stds/step/) files or [CadQuery](https://cadquery.readthedocs.io) objects to a [DAGMC](https://github.com/svalinn/DAGMC/) compatible h5m file.
|
|
49
|
-
|
|
50
|
-
The resulting DAGMC geometry can then be used for simulations in [OpenMC](https://github.com/openmc-dev/openmc/) or [other supported codes](https://svalinn.github.io/DAGMC/).
|
|
51
|
-
|
|
52
|
-
This package is tested with [pytest tests](https://github.com/fusion-energy/cad_to_dagmc/tree/main/tests) and also the DAGMC geometry made with this package is compared to simulation carried out with native constructive solid geometry, see [Model Benchmark Zoo](https://github.com/fusion-energy/model_benchmark_zoo) for more details.
|
|
53
|
-
|
|
54
|
-
Also checkout these other software projects that also create DAGMC geometry [CAD-to-OpenMC](https://github.com/openmsr/CAD_to_OpenMC), [Stellarmesh](https://github.com/Thea-Energy/stellarmesh) and [Coreform Cubit](https://coreform.com/products/coreform-cubit/)
|
|
55
63
|
|
|
56
64
|
# Installation options
|
|
57
65
|
|
|
@@ -146,7 +154,7 @@ You may also want to install OpenMC with DAGMC to make use of the h5m geometry f
|
|
|
146
154
|
|
|
147
155
|
To install OpenMC you can run ```mamba install -c conda-forge openmc``` however this more specific command makes sure the latest version of OpenMC which contains DAGMC is chosen by conda / mamba
|
|
148
156
|
```bash
|
|
149
|
-
mamba install -c conda-forge -y "openmc=0.
|
|
157
|
+
mamba install -c conda-forge -y "openmc=0.15.0=dagmc*nompi*"
|
|
150
158
|
```
|
|
151
159
|
|
|
152
160
|
It might not be possible to install OpenMC and cad-to-dagmc in the same conda/mamba python environment so you may have to create a new conda/mamba environment and install OpenMC there.
|
|
@@ -160,15 +168,15 @@ The package requires newer versions of Linux. For example the package does not w
|
|
|
160
168
|
|
|
161
169
|
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```
|
|
162
170
|
|
|
163
|
-
Installing one of the package dependancies (
|
|
171
|
+
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.
|
|
164
172
|
|
|
165
173
|
|
|
166
|
-
# Usage
|
|
174
|
+
# Usage
|
|
167
175
|
|
|
168
|
-
For examples see the [examples folder](https://github.com/fusion-energy/cad_to_dagmc/tree/main/examples)
|
|
176
|
+
For examples showing creation of DAGMC h5m files, vtk files and usage within OpenMC transport code see the [examples folder](https://github.com/fusion-energy/cad_to_dagmc/tree/main/examples)
|
|
169
177
|
|
|
170
|
-
|
|
178
|
+
For more examples see the CAD tasks in the [neutronics-workshop](https://github.com/fusion-energy/neutronics-workshop) and [model benchmark zoo](https://github.com/fusion-energy/model_benchmark_zoo)
|
|
171
179
|
|
|
172
|
-
|
|
180
|
+
# Related software
|
|
173
181
|
|
|
174
|
-
|
|
182
|
+
Also checkout these other software projects that also create DAGMC geometry [CAD-to-OpenMC](https://github.com/openmsr/CAD_to_OpenMC), [Stellarmesh](https://github.com/Thea-Energy/stellarmesh) and [Coreform Cubit](https://coreform.com/products/coreform-cubit/).
|
|
@@ -14,6 +14,7 @@ examples/surface_mesh/cadquery_compound.py
|
|
|
14
14
|
examples/surface_mesh/cadquery_object_and_stp_file.py
|
|
15
15
|
examples/surface_mesh/cadquery_text.py
|
|
16
16
|
examples/surface_mesh/curved_cadquery_object_to_dagmc_surface_mesh.py
|
|
17
|
+
examples/surface_mesh/different_resolution_meshes.py
|
|
17
18
|
examples/surface_mesh/from_gmsh_mesh_file.py
|
|
18
19
|
examples/surface_mesh/multiple_cadquery_objects.py
|
|
19
20
|
examples/surface_mesh/multiple_stp_files.py
|
|
@@ -21,6 +22,7 @@ examples/surface_mesh/single_cadquery_object.py
|
|
|
21
22
|
examples/surface_mesh/single_stp_file.py
|
|
22
23
|
examples/surface_mesh/single_stp_file_multiple_volumes.py
|
|
23
24
|
examples/unstrucutred_volume_mesh/curved_cadquery_object_to_dagmc_volume_mesh.py
|
|
25
|
+
examples/unstrucutred_volume_mesh/different_resolution_meshes.py
|
|
24
26
|
examples/unstrucutred_volume_mesh/simulate_unstrucutred_volume_mesh_with_openmc.py
|
|
25
27
|
src/_version.py
|
|
26
28
|
src/cad_to_dagmc/__init__.py
|
|
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
|
{cad_to_dagmc-0.7.6 → cad_to_dagmc-0.8.0}/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.6 → cad_to_dagmc-0.8.0}/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.6 → cad_to_dagmc-0.8.0}/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
|
|
File without changes
|
|
File without changes
|