cad-to-dagmc 0.7.4__py3-none-any.whl → 0.7.5__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 +36 -10
- {cad_to_dagmc-0.7.4.dist-info → cad_to_dagmc-0.7.5.dist-info}/METADATA +1 -1
- cad_to_dagmc-0.7.5.dist-info/RECORD +8 -0
- cad_to_dagmc-0.7.4.dist-info/RECORD +0 -8
- {cad_to_dagmc-0.7.4.dist-info → cad_to_dagmc-0.7.5.dist-info}/LICENSE +0 -0
- {cad_to_dagmc-0.7.4.dist-info → cad_to_dagmc-0.7.5.dist-info}/WHEEL +0 -0
- {cad_to_dagmc-0.7.4.dist-info → cad_to_dagmc-0.7.5.dist-info}/top_level.txt +0 -0
_version.py
CHANGED
cad_to_dagmc/core.py
CHANGED
|
@@ -491,6 +491,7 @@ class CadToDagmc:
|
|
|
491
491
|
mesh_algorithm: int = 1,
|
|
492
492
|
method: str = "file",
|
|
493
493
|
scale_factor: float = 1.0,
|
|
494
|
+
imprint: bool = True,
|
|
494
495
|
):
|
|
495
496
|
"""
|
|
496
497
|
Exports an unstructured mesh file in VTK format for use with openmc.UnstructuredMesh.
|
|
@@ -518,6 +519,10 @@ class CadToDagmc:
|
|
|
518
519
|
scale_factor: a scaling factor to apply to the geometry that can be
|
|
519
520
|
used to enlarge or shrink the geometry. Useful when converting
|
|
520
521
|
Useful when converting the geometry to cm for use in neutronics
|
|
522
|
+
imprint: whether to imprint the geometry or not. Defaults to True as this is
|
|
523
|
+
normally needed to ensure the geometry is meshed correctly. However if
|
|
524
|
+
you know your geometry does not need imprinting you can set this to False
|
|
525
|
+
and this can save time.
|
|
521
526
|
|
|
522
527
|
Returns:
|
|
523
528
|
--------
|
|
@@ -532,7 +537,10 @@ class CadToDagmc:
|
|
|
532
537
|
for part in self.parts:
|
|
533
538
|
assembly.add(part)
|
|
534
539
|
|
|
535
|
-
|
|
540
|
+
if imprint:
|
|
541
|
+
imprinted_assembly, _ = cq.occ_impl.assembly.imprint(assembly)
|
|
542
|
+
else:
|
|
543
|
+
imprinted_assembly = assembly
|
|
536
544
|
|
|
537
545
|
gmsh = init_gmsh()
|
|
538
546
|
|
|
@@ -563,6 +571,7 @@ class CadToDagmc:
|
|
|
563
571
|
dimensions: int = 2,
|
|
564
572
|
method: str = "file",
|
|
565
573
|
scale_factor: float = 1.0,
|
|
574
|
+
imprint: bool = True,
|
|
566
575
|
):
|
|
567
576
|
"""Saves a GMesh msh file of the geometry in either 2D surface mesh or
|
|
568
577
|
3D volume mesh.
|
|
@@ -585,13 +594,20 @@ class CadToDagmc:
|
|
|
585
594
|
scale_factor: a scaling factor to apply to the geometry that can be
|
|
586
595
|
used to enlarge or shrink the geometry. Useful when converting
|
|
587
596
|
Useful when converting the geometry to cm for use in neutronics
|
|
597
|
+
imprint: whether to imprint the geometry or not. Defaults to True as this is
|
|
598
|
+
normally needed to ensure the geometry is meshed correctly. However if
|
|
599
|
+
you know your geometry does not need imprinting you can set this to False
|
|
600
|
+
and this can save time.
|
|
588
601
|
"""
|
|
589
602
|
|
|
590
603
|
assembly = cq.Assembly()
|
|
591
604
|
for part in self.parts:
|
|
592
605
|
assembly.add(part)
|
|
593
606
|
|
|
594
|
-
|
|
607
|
+
if imprint:
|
|
608
|
+
imprinted_assembly, _ = cq.occ_impl.assembly.imprint(assembly)
|
|
609
|
+
else:
|
|
610
|
+
imprinted_assembly = assembly
|
|
595
611
|
|
|
596
612
|
gmsh = init_gmsh()
|
|
597
613
|
|
|
@@ -620,11 +636,11 @@ class CadToDagmc:
|
|
|
620
636
|
implicit_complement_material_tag: str | None = None,
|
|
621
637
|
method: str = "file",
|
|
622
638
|
scale_factor: float = 1.0,
|
|
639
|
+
imprint: bool = True,
|
|
623
640
|
) -> str:
|
|
624
641
|
"""Saves a DAGMC h5m file of the geometry
|
|
625
642
|
|
|
626
643
|
Args:
|
|
627
|
-
|
|
628
644
|
filename (str, optional): the filename to use for the saved DAGMC file. Defaults to "dagmc.h5m".
|
|
629
645
|
min_mesh_size (float, optional): the minimum size of mesh elements to use. Defaults to 1.
|
|
630
646
|
max_mesh_size (float, optional): the maximum size of mesh elements to use. Defaults to 5.
|
|
@@ -643,6 +659,10 @@ class CadToDagmc:
|
|
|
643
659
|
scale_factor: a scaling factor to apply to the geometry that can be
|
|
644
660
|
used to enlarge or shrink the geometry. Useful when converting
|
|
645
661
|
Useful when converting the geometry to cm for use in neutronics
|
|
662
|
+
imprint: whether to imprint the geometry or not. Defaults to True as this is
|
|
663
|
+
normally needed to ensure the geometry is meshed correctly. However if
|
|
664
|
+
you know your geometry does not need imprinting you can set this to False
|
|
665
|
+
and this can save time.
|
|
646
666
|
|
|
647
667
|
Returns:
|
|
648
668
|
str: the DAGMC filename saved
|
|
@@ -652,21 +672,27 @@ class CadToDagmc:
|
|
|
652
672
|
for part in self.parts:
|
|
653
673
|
assembly.add(part)
|
|
654
674
|
|
|
655
|
-
imprinted_assembly, imprinted_solids_with_org_id = cq.occ_impl.assembly.imprint(assembly)
|
|
656
|
-
|
|
657
675
|
original_ids = _get_ids_from_assembly(assembly)
|
|
658
|
-
scrambled_ids = _get_ids_from_imprinted_assembly(imprinted_solids_with_org_id)
|
|
659
676
|
|
|
660
677
|
# both id lists should be the same length as each other and the same
|
|
661
678
|
# length as the self.material_tags
|
|
662
|
-
|
|
663
679
|
if len(original_ids) != len(self.material_tags):
|
|
664
680
|
msg = f"Number of volumes {len(original_ids)} is not equal to number of material tags {len(self.material_tags)}"
|
|
665
681
|
raise ValueError(msg)
|
|
666
682
|
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
683
|
+
if imprint:
|
|
684
|
+
imprinted_assembly, imprinted_solids_with_org_id = cq.occ_impl.assembly.imprint(
|
|
685
|
+
assembly
|
|
686
|
+
)
|
|
687
|
+
|
|
688
|
+
scrambled_ids = _get_ids_from_imprinted_assembly(imprinted_solids_with_org_id)
|
|
689
|
+
|
|
690
|
+
material_tags_in_brep_order = order_material_ids_by_brep_order(
|
|
691
|
+
original_ids, scrambled_ids, self.material_tags
|
|
692
|
+
)
|
|
693
|
+
else:
|
|
694
|
+
material_tags_in_brep_order = self.material_tags
|
|
695
|
+
imprinted_assembly = assembly
|
|
670
696
|
|
|
671
697
|
_check_material_tags(material_tags_in_brep_order, self.parts)
|
|
672
698
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
_version.py,sha256=AfxYsOLHf-d9Yv9B0Y-QKGSJPkQBqceXnCr_lUKXMKM,411
|
|
2
|
+
cad_to_dagmc/__init__.py,sha256=fskHUTyCunSpnpJUvBfAYjx4uwDKXHTTiMP6GqnFRf0,494
|
|
3
|
+
cad_to_dagmc/core.py,sha256=AfYKmrGCFcXZnsxCW72rdSAJY4kvffk1MTG4uURH-cw,27768
|
|
4
|
+
cad_to_dagmc-0.7.5.dist-info/LICENSE,sha256=B8kznH_777JVNZ3HOKDc4Tj24F7wJ68ledaNYeL9sCw,1070
|
|
5
|
+
cad_to_dagmc-0.7.5.dist-info/METADATA,sha256=okv56zxnjveO_HMC58bd8gO27vLZ_TXKsY5r1N0hVpw,7937
|
|
6
|
+
cad_to_dagmc-0.7.5.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
7
|
+
cad_to_dagmc-0.7.5.dist-info/top_level.txt,sha256=zTi8C64SEBsE5WOtPovnxhOzt-E6Oc5nC3RW6M_5aEA,22
|
|
8
|
+
cad_to_dagmc-0.7.5.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
_version.py,sha256=23GyHFOGbZ47N1N7nnKbPQ9DYbuR8l4JJZLlq4C_xKg,411
|
|
2
|
-
cad_to_dagmc/__init__.py,sha256=fskHUTyCunSpnpJUvBfAYjx4uwDKXHTTiMP6GqnFRf0,494
|
|
3
|
-
cad_to_dagmc/core.py,sha256=7L4HtFUc6C2_C5JG29FLiGXB6gaS7eQfgtNtTgp38bY,26414
|
|
4
|
-
cad_to_dagmc-0.7.4.dist-info/LICENSE,sha256=B8kznH_777JVNZ3HOKDc4Tj24F7wJ68ledaNYeL9sCw,1070
|
|
5
|
-
cad_to_dagmc-0.7.4.dist-info/METADATA,sha256=143eCryJu05KVSyW4xbIwnWkXJHiWf-GrlF5JnJ2tL4,7937
|
|
6
|
-
cad_to_dagmc-0.7.4.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
7
|
-
cad_to_dagmc-0.7.4.dist-info/top_level.txt,sha256=zTi8C64SEBsE5WOtPovnxhOzt-E6Oc5nC3RW6M_5aEA,22
|
|
8
|
-
cad_to_dagmc-0.7.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|