cad-to-dagmc 0.9.5__py3-none-any.whl → 0.9.7__py3-none-any.whl
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.
- _version.py +2 -2
- cad_to_dagmc/core.py +24 -10
- cad_to_dagmc/direct_mesh_plugin.py +2 -0
- {cad_to_dagmc-0.9.5.dist-info → cad_to_dagmc-0.9.7.dist-info}/METADATA +5 -5
- cad_to_dagmc-0.9.7.dist-info/RECORD +9 -0
- cad_to_dagmc-0.9.5.dist-info/RECORD +0 -9
- {cad_to_dagmc-0.9.5.dist-info → cad_to_dagmc-0.9.7.dist-info}/WHEEL +0 -0
- {cad_to_dagmc-0.9.5.dist-info → cad_to_dagmc-0.9.7.dist-info}/licenses/LICENSE +0 -0
- {cad_to_dagmc-0.9.5.dist-info → cad_to_dagmc-0.9.7.dist-info}/top_level.txt +0 -0
_version.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.9.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 9,
|
|
31
|
+
__version__ = version = '0.9.7'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 9, 7)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
cad_to_dagmc/core.py
CHANGED
|
@@ -687,6 +687,7 @@ class CadToDagmc:
|
|
|
687
687
|
assembly.add(part)
|
|
688
688
|
|
|
689
689
|
if imprint:
|
|
690
|
+
print("Imprinting assembly for unstructured mesh generation")
|
|
690
691
|
imprinted_assembly, _ = cq.occ_impl.assembly.imprint(assembly)
|
|
691
692
|
else:
|
|
692
693
|
imprinted_assembly = assembly
|
|
@@ -777,6 +778,7 @@ class CadToDagmc:
|
|
|
777
778
|
assembly.add(part)
|
|
778
779
|
|
|
779
780
|
if imprint:
|
|
781
|
+
print("Imprinting assembly for mesh generation")
|
|
780
782
|
imprinted_assembly, _ = cq.occ_impl.assembly.imprint(assembly)
|
|
781
783
|
else:
|
|
782
784
|
imprinted_assembly = assembly
|
|
@@ -853,21 +855,32 @@ class CadToDagmc:
|
|
|
853
855
|
ValueError: If invalid parameter combinations are used.
|
|
854
856
|
"""
|
|
855
857
|
|
|
858
|
+
# Define all acceptable kwargs
|
|
859
|
+
cadquery_keys = {"tolerance", "angular_tolerance"}
|
|
860
|
+
gmsh_keys = {
|
|
861
|
+
"min_mesh_size",
|
|
862
|
+
"max_mesh_size",
|
|
863
|
+
"mesh_algorithm",
|
|
864
|
+
"set_size",
|
|
865
|
+
"umesh_filename",
|
|
866
|
+
"method",
|
|
867
|
+
"unstructured_volumes",
|
|
868
|
+
}
|
|
869
|
+
all_acceptable_keys = cadquery_keys | gmsh_keys | {"meshing_backend"}
|
|
870
|
+
|
|
871
|
+
# Check for invalid kwargs
|
|
872
|
+
invalid_keys = set(kwargs.keys()) - all_acceptable_keys
|
|
873
|
+
if invalid_keys:
|
|
874
|
+
raise ValueError(
|
|
875
|
+
f"Invalid keyword arguments: {sorted(invalid_keys)}\n"
|
|
876
|
+
f"Acceptable arguments are: {sorted(all_acceptable_keys)}"
|
|
877
|
+
)
|
|
878
|
+
|
|
856
879
|
# Handle meshing_backend - either from kwargs or auto-detect
|
|
857
880
|
meshing_backend = kwargs.pop("meshing_backend", None)
|
|
858
881
|
|
|
859
882
|
if meshing_backend is None:
|
|
860
883
|
# Auto-select meshing_backend based on kwargs
|
|
861
|
-
cadquery_keys = {"tolerance", "angular_tolerance"}
|
|
862
|
-
gmsh_keys = {
|
|
863
|
-
"min_mesh_size",
|
|
864
|
-
"max_mesh_size",
|
|
865
|
-
"mesh_algorithm",
|
|
866
|
-
"set_size",
|
|
867
|
-
"umesh_filename",
|
|
868
|
-
"method",
|
|
869
|
-
"unstructured_volumes",
|
|
870
|
-
}
|
|
871
884
|
has_cadquery = any(key in kwargs for key in cadquery_keys)
|
|
872
885
|
has_gmsh = any(key in kwargs for key in gmsh_keys)
|
|
873
886
|
if has_cadquery and not has_gmsh:
|
|
@@ -1002,6 +1015,7 @@ class CadToDagmc:
|
|
|
1002
1015
|
elif meshing_backend == "gmsh":
|
|
1003
1016
|
# If assembly is not to be imprinted, pass through the assembly as-is
|
|
1004
1017
|
if imprint:
|
|
1018
|
+
print("Imprinting assembly for mesh generation")
|
|
1005
1019
|
imprinted_assembly, imprinted_solids_with_org_id = cq.occ_impl.assembly.imprint(
|
|
1006
1020
|
assembly
|
|
1007
1021
|
)
|
|
@@ -291,6 +291,7 @@ def to_mesh(
|
|
|
291
291
|
# Imprinted assemblies end up being compounds, whereas you have to step through each of the
|
|
292
292
|
# parts in an assembly and extract the solids.
|
|
293
293
|
if imprint:
|
|
294
|
+
print("Imprinting assembly for mesh generation")
|
|
294
295
|
# Imprint the assembly and process it as a compound
|
|
295
296
|
(
|
|
296
297
|
imprinted_assembly,
|
|
@@ -329,6 +330,7 @@ def to_mesh(
|
|
|
329
330
|
|
|
330
331
|
# Step through all of the collected solids and their respective faces to get the vertices
|
|
331
332
|
for solid in solids:
|
|
333
|
+
print(f"Meshing solid {solid_idx} of {len(solids)}")
|
|
332
334
|
# Reset this each time so that we get the correct number of faces per solid
|
|
333
335
|
face_triangles = {}
|
|
334
336
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cad_to_dagmc
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.7
|
|
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
|
|
@@ -50,7 +50,7 @@ cad-to-dagmc can convert the following in to DAGMC compatible meshes:
|
|
|
50
50
|
|
|
51
51
|
Cad-to-dagmc offers a wide range of features including.
|
|
52
52
|
- Geometry scaling with ```scale_factor``` argument
|
|
53
|
-
-
|
|
53
|
+
- Direct surface meshing of CadQuery geometry with ```tolerance``` and ```angular_tolerance``` arguments (avoids using Gmsh)
|
|
54
54
|
- Model wide mesh Gmsh size parameters with ```min_mesh_size``` and ```max_mesh_size``` arguments
|
|
55
55
|
- Volume specific mesh sizing parameters with the ```set_size``` argument
|
|
56
56
|
- Unstructured mesh that share the same coordinates as the surface mesh.
|
|
@@ -73,7 +73,7 @@ Cad-to-dagmc offers a wide range of features including.
|
|
|
73
73
|
|
|
74
74
|
- Install using Mamba
|
|
75
75
|
- Install using Conda
|
|
76
|
-
- Install using pip
|
|
76
|
+
- Install using pip
|
|
77
77
|
|
|
78
78
|
## Install using Mamba
|
|
79
79
|
|
|
@@ -151,10 +151,10 @@ You may also want to install OpenMC with DAGMC to make use of the h5m geometry f
|
|
|
151
151
|
|
|
152
152
|
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
|
|
153
153
|
```bash
|
|
154
|
-
mamba install -c conda-forge -y "openmc=0.15.
|
|
154
|
+
mamba install -c conda-forge -y "openmc=0.15.2=dagmc*nompi*"
|
|
155
155
|
```
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
You could also install using this [wheel repo](https://github.com/shimwell/wheels)
|
|
158
158
|
|
|
159
159
|
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.
|
|
160
160
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
_version.py,sha256=nVR1UPhFOYODT1jRbOZVkLGatCOSQLCVT4ndGPtcnZ8,704
|
|
2
|
+
cad_to_dagmc/__init__.py,sha256=oCr1P0QnBsf6AH0RZujX7T7tdrb75NazdF70HtqXSfc,528
|
|
3
|
+
cad_to_dagmc/core.py,sha256=2U7KdBCCJst3pQTbMV3qjNzV1qNIzT_Ey9OZK7NVd48,42756
|
|
4
|
+
cad_to_dagmc/direct_mesh_plugin.py,sha256=iKPYtWQd35Ipxv6g8fZ-r7GFKd1VlCwrSfaNzrGFtf0,24131
|
|
5
|
+
cad_to_dagmc-0.9.7.dist-info/licenses/LICENSE,sha256=B8kznH_777JVNZ3HOKDc4Tj24F7wJ68ledaNYeL9sCw,1070
|
|
6
|
+
cad_to_dagmc-0.9.7.dist-info/METADATA,sha256=1qZc6ys0oUghoevoLgz-YO3uODOxYocdapgnb7GBIXA,8994
|
|
7
|
+
cad_to_dagmc-0.9.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
+
cad_to_dagmc-0.9.7.dist-info/top_level.txt,sha256=zTi8C64SEBsE5WOtPovnxhOzt-E6Oc5nC3RW6M_5aEA,22
|
|
9
|
+
cad_to_dagmc-0.9.7.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
_version.py,sha256=V1-OiE6OEk5MX27BDAUWprPJs5XL5wiS2EaIpLYazTw,704
|
|
2
|
-
cad_to_dagmc/__init__.py,sha256=oCr1P0QnBsf6AH0RZujX7T7tdrb75NazdF70HtqXSfc,528
|
|
3
|
-
cad_to_dagmc/core.py,sha256=lLPnkK1EM33zBpG3KEzTOLVRWvVlhdrvfgvLGtctT1s,42163
|
|
4
|
-
cad_to_dagmc/direct_mesh_plugin.py,sha256=5jG5ILafjbDacaAvBRWD_ilMZLepcM6H1Tjze85vAxE,24013
|
|
5
|
-
cad_to_dagmc-0.9.5.dist-info/licenses/LICENSE,sha256=B8kznH_777JVNZ3HOKDc4Tj24F7wJ68ledaNYeL9sCw,1070
|
|
6
|
-
cad_to_dagmc-0.9.5.dist-info/METADATA,sha256=ppjg_7Fafa7bZo3qpJDSGylfhTQS4P__wR6YR2rsygQ,9121
|
|
7
|
-
cad_to_dagmc-0.9.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
-
cad_to_dagmc-0.9.5.dist-info/top_level.txt,sha256=zTi8C64SEBsE5WOtPovnxhOzt-E6Oc5nC3RW6M_5aEA,22
|
|
9
|
-
cad_to_dagmc-0.9.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|