cad-to-dagmc 0.9.1__py3-none-any.whl → 0.9.2__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.
Potentially problematic release.
This version of cad-to-dagmc might be problematic. Click here for more details.
- _version.py +2 -2
- cad_to_dagmc/core.py +33 -8
- {cad_to_dagmc-0.9.1.dist-info → cad_to_dagmc-0.9.2.dist-info}/METADATA +3 -2
- cad_to_dagmc-0.9.2.dist-info/RECORD +8 -0
- cad_to_dagmc-0.9.1.dist-info/RECORD +0 -8
- {cad_to_dagmc-0.9.1.dist-info → cad_to_dagmc-0.9.2.dist-info}/WHEEL +0 -0
- {cad_to_dagmc-0.9.1.dist-info → cad_to_dagmc-0.9.2.dist-info}/licenses/LICENSE +0 -0
- {cad_to_dagmc-0.9.1.dist-info → cad_to_dagmc-0.9.2.dist-info}/top_level.txt +0 -0
_version.py
CHANGED
cad_to_dagmc/core.py
CHANGED
|
@@ -7,6 +7,7 @@ from cadquery import importers
|
|
|
7
7
|
from pymoab import core, types
|
|
8
8
|
import tempfile
|
|
9
9
|
import warnings
|
|
10
|
+
from typing import Iterable
|
|
10
11
|
from cad_to_dagmc import __version__
|
|
11
12
|
|
|
12
13
|
|
|
@@ -818,6 +819,8 @@ class CadToDagmc:
|
|
|
818
819
|
scale_factor: float = 1.0,
|
|
819
820
|
imprint: bool = True,
|
|
820
821
|
set_size: dict[int, float] | None = None,
|
|
822
|
+
unstructured_volumes: Iterable[int] | None = None,
|
|
823
|
+
umesh_filename: str = "umesh.vtk",
|
|
821
824
|
) -> str:
|
|
822
825
|
"""Saves a DAGMC h5m file of the geometry
|
|
823
826
|
|
|
@@ -846,9 +849,13 @@ class CadToDagmc:
|
|
|
846
849
|
and this can save time.
|
|
847
850
|
set_size: a dictionary of volume ids (int) and target mesh sizes
|
|
848
851
|
(floats) to set for each volume, passed to gmsh.model.mesh.setSize.
|
|
852
|
+
unstructured_volumes: a list of volume ids to be saved in as an
|
|
853
|
+
unstructured mesh file.
|
|
854
|
+
umesh_filename: the filename to use for the optional unstructured
|
|
855
|
+
mesh file. Only used if unstructured_volumes is not empty.
|
|
849
856
|
|
|
850
857
|
Returns:
|
|
851
|
-
str: the
|
|
858
|
+
str: the filenames(s) for the files created.
|
|
852
859
|
"""
|
|
853
860
|
|
|
854
861
|
assembly = cq.Assembly()
|
|
@@ -895,19 +902,37 @@ class CadToDagmc:
|
|
|
895
902
|
|
|
896
903
|
gmsh.model.mesh.generate(2)
|
|
897
904
|
|
|
898
|
-
dims_and_vol_ids = volumes
|
|
899
|
-
|
|
900
905
|
vertices, triangles_by_solid_by_face = mesh_to_vertices_and_triangles(
|
|
901
|
-
dims_and_vol_ids=
|
|
906
|
+
dims_and_vol_ids=volumes
|
|
902
907
|
)
|
|
903
908
|
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
# checks and fixes triangle fix_normals within vertices_to_h5m
|
|
907
|
-
return vertices_to_h5m(
|
|
909
|
+
dagmc_filename = vertices_to_h5m(
|
|
908
910
|
vertices=vertices,
|
|
909
911
|
triangles_by_solid_by_face=triangles_by_solid_by_face,
|
|
910
912
|
material_tags=material_tags_in_brep_order,
|
|
911
913
|
h5m_filename=filename,
|
|
912
914
|
implicit_complement_material_tag=implicit_complement_material_tag,
|
|
913
915
|
)
|
|
916
|
+
|
|
917
|
+
if unstructured_volumes:
|
|
918
|
+
# remove all the unused occ volumes, this prevents them being meshed
|
|
919
|
+
for volume_dim, volume_id in volumes:
|
|
920
|
+
if volume_id not in unstructured_volumes:
|
|
921
|
+
gmsh.model.occ.remove([(volume_dim, volume_id)], recursive=True)
|
|
922
|
+
gmsh.option.setNumber("Mesh.SaveAll", 1)
|
|
923
|
+
gmsh.model.occ.synchronize()
|
|
924
|
+
|
|
925
|
+
# removes all the 2D groups so that 2D faces are not included in the vtk file
|
|
926
|
+
all_2d_groups = gmsh.model.getPhysicalGroups(2)
|
|
927
|
+
for entry in all_2d_groups:
|
|
928
|
+
gmsh.model.removePhysicalGroups([entry])
|
|
929
|
+
|
|
930
|
+
gmsh.model.mesh.generate(3)
|
|
931
|
+
gmsh.option.setNumber("Mesh.SaveElementTagType", 3) # Save only volume elements
|
|
932
|
+
gmsh.write(umesh_filename)
|
|
933
|
+
|
|
934
|
+
gmsh.finalize()
|
|
935
|
+
|
|
936
|
+
return dagmc_filename, umesh_filename
|
|
937
|
+
else:
|
|
938
|
+
return dagmc_filename
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cad_to_dagmc
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.2
|
|
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
|
|
@@ -55,7 +55,8 @@ Cad-to-dagmc offers a wide range of features including.
|
|
|
55
55
|
- Geometry scaling with ```scale_factor``` argument
|
|
56
56
|
- Model wide mesh size parameters with ```min_mesh_size``` and ```max_mesh_size``` arguments
|
|
57
57
|
- Volume specific mesh sizing parameters with the ```set_size``` argument
|
|
58
|
-
-
|
|
58
|
+
- Unstructured mesh that share the same coordinates as the surface mesh.
|
|
59
|
+
- Volume mesh allows selecting individual volumes in the geometry.
|
|
59
60
|
- Parallel meshing to quickly mesh the geometry using multiple CPU cores
|
|
60
61
|
- Imprint and merging of CAD geometry, or disable with the ```imprint``` argument
|
|
61
62
|
- 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)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
_version.py,sha256=eeYYTSIkrgfRwSQ7LKo_py3xs3DvzgfWiAtK4K1JM4A,511
|
|
2
|
+
cad_to_dagmc/__init__.py,sha256=fskHUTyCunSpnpJUvBfAYjx4uwDKXHTTiMP6GqnFRf0,494
|
|
3
|
+
cad_to_dagmc/core.py,sha256=dGj5LRRzboQ8CL8VS5dkvIkGLyj5MJWcbkTPtrFk0QQ,36947
|
|
4
|
+
cad_to_dagmc-0.9.2.dist-info/licenses/LICENSE,sha256=B8kznH_777JVNZ3HOKDc4Tj24F7wJ68ledaNYeL9sCw,1070
|
|
5
|
+
cad_to_dagmc-0.9.2.dist-info/METADATA,sha256=8vLnV93ycmV216LiNj38YI4z445pWtdpBKpcESFLLH0,8990
|
|
6
|
+
cad_to_dagmc-0.9.2.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
|
7
|
+
cad_to_dagmc-0.9.2.dist-info/top_level.txt,sha256=zTi8C64SEBsE5WOtPovnxhOzt-E6Oc5nC3RW6M_5aEA,22
|
|
8
|
+
cad_to_dagmc-0.9.2.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
_version.py,sha256=QG_t-w_CzDn2UjPaW-Svt-wTU1NXK2QkudawUihJfHA,511
|
|
2
|
-
cad_to_dagmc/__init__.py,sha256=fskHUTyCunSpnpJUvBfAYjx4uwDKXHTTiMP6GqnFRf0,494
|
|
3
|
-
cad_to_dagmc/core.py,sha256=ej1wk_-q-eXJ5F7jfjBwPII4qWHnMQWeMT_XZG_A0xI,35713
|
|
4
|
-
cad_to_dagmc-0.9.1.dist-info/licenses/LICENSE,sha256=B8kznH_777JVNZ3HOKDc4Tj24F7wJ68ledaNYeL9sCw,1070
|
|
5
|
-
cad_to_dagmc-0.9.1.dist-info/METADATA,sha256=S15I2B5N_eEUC7XqFB6sNyiuFwSLrHj8--1CraXkaMo,8947
|
|
6
|
-
cad_to_dagmc-0.9.1.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
|
7
|
-
cad_to_dagmc-0.9.1.dist-info/top_level.txt,sha256=zTi8C64SEBsE5WOtPovnxhOzt-E6Oc5nC3RW6M_5aEA,22
|
|
8
|
-
cad_to_dagmc-0.9.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|