cad-to-dagmc 0.7.4__tar.gz → 0.7.5__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.

Files changed (53) hide show
  1. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/PKG-INFO +1 -1
  2. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/src/_version.py +2 -2
  3. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/src/cad_to_dagmc/core.py +36 -10
  4. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/src/cad_to_dagmc.egg-info/PKG-INFO +1 -1
  5. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/.github/workflows/black.yml +0 -0
  6. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/.github/workflows/ci_with_benchmarks.yml +0 -0
  7. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/.github/workflows/ci_with_conda_install.yml +0 -0
  8. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/.github/workflows/ci_with_pip_install.yml +0 -0
  9. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/.github/workflows/python-publish.yml +0 -0
  10. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/.gitignore +0 -0
  11. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/CITATION.cff +0 -0
  12. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/LICENSE +0 -0
  13. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/README.md +0 -0
  14. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/examples/surface_mesh/cadquery_assembly.py +0 -0
  15. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/examples/surface_mesh/cadquery_assembly_with_scaled_geometry.py +0 -0
  16. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/examples/surface_mesh/cadquery_compound.py +0 -0
  17. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/examples/surface_mesh/cadquery_object_and_stp_file.py +0 -0
  18. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/examples/surface_mesh/cadquery_text.py +0 -0
  19. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/examples/surface_mesh/curved_cadquery_object_to_dagmc_surface_mesh.py +0 -0
  20. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/examples/surface_mesh/from_gmsh_mesh_file.py +0 -0
  21. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/examples/surface_mesh/multiple_cadquery_objects.py +0 -0
  22. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/examples/surface_mesh/multiple_stp_files.py +0 -0
  23. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/examples/surface_mesh/single_cadquery_object.py +0 -0
  24. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/examples/surface_mesh/single_stp_file.py +0 -0
  25. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/examples/surface_mesh/single_stp_file_multiple_volumes.py +0 -0
  26. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/examples/unstrucutred_volume_mesh/curved_cadquery_object_to_dagmc_volume_mesh.py +0 -0
  27. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/examples/unstrucutred_volume_mesh/simulate_unstrucutred_volume_mesh_with_openmc.py +0 -0
  28. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/pyproject.toml +0 -0
  29. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/setup.cfg +0 -0
  30. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/src/cad_to_dagmc/__init__.py +0 -0
  31. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/src/cad_to_dagmc.egg-info/SOURCES.txt +0 -0
  32. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/src/cad_to_dagmc.egg-info/dependency_links.txt +0 -0
  33. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/src/cad_to_dagmc.egg-info/requires.txt +0 -0
  34. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/src/cad_to_dagmc.egg-info/top_level.txt +0 -0
  35. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/ENDFB-7.1-NNDC_H1.h5 +0 -0
  36. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/ball_reactor.brep +0 -0
  37. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/curved_extrude.stp +0 -0
  38. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/extrude_rectangle.stp +0 -0
  39. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/multi_volume_cylinders.stp +0 -0
  40. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/one_cube.brep +0 -0
  41. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/single_cube.stp +0 -0
  42. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/single_volume_thin.stp +0 -0
  43. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/single_volume_thin.vtk +0 -0
  44. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/test_brep_file.brep +0 -0
  45. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/test_file_creation.py +0 -0
  46. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/test_h5m_in_transport.py +0 -0
  47. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/test_loading_from_file_vs_shape_object.py +0 -0
  48. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/test_python_api.py +0 -0
  49. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/test_two_joined_cubes.brep +0 -0
  50. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/test_two_sep_cubes.brep +0 -0
  51. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/test_version.py +0 -0
  52. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/two_connected_cubes.stp +0 -0
  53. {cad_to_dagmc-0.7.4 → cad_to_dagmc-0.7.5}/tests/two_disconnected_cubes.stp +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cad_to_dagmc
3
- Version: 0.7.4
3
+ Version: 0.7.5
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
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.7.4'
16
- __version_tuple__ = version_tuple = (0, 7, 4)
15
+ __version__ = version = '0.7.5'
16
+ __version_tuple__ = version_tuple = (0, 7, 5)
@@ -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
- imprinted_assembly, _ = cq.occ_impl.assembly.imprint(assembly)
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
- imprinted_assembly, _ = cq.occ_impl.assembly.imprint(assembly)
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
- material_tags_in_brep_order = order_material_ids_by_brep_order(
668
- original_ids, scrambled_ids, self.material_tags
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cad_to_dagmc
3
- Version: 0.7.4
3
+ Version: 0.7.5
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
File without changes
File without changes
File without changes
File without changes
File without changes