cad-to-dagmc 0.8.2__py3-none-any.whl → 0.9.1__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 +9 -4
- cad_to_dagmc/core.py +174 -78
- {cad_to_dagmc-0.8.2.dist-info → cad_to_dagmc-0.9.1.dist-info}/METADATA +12 -17
- cad_to_dagmc-0.9.1.dist-info/RECORD +8 -0
- {cad_to_dagmc-0.8.2.dist-info → cad_to_dagmc-0.9.1.dist-info}/WHEEL +1 -1
- cad_to_dagmc-0.8.2.dist-info/RECORD +0 -8
- {cad_to_dagmc-0.8.2.dist-info → cad_to_dagmc-0.9.1.dist-info/licenses}/LICENSE +0 -0
- {cad_to_dagmc-0.8.2.dist-info → cad_to_dagmc-0.9.1.dist-info}/top_level.txt +0 -0
_version.py
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
# file generated by
|
|
1
|
+
# file generated by setuptools-scm
|
|
2
2
|
# don't change, don't track in version control
|
|
3
|
+
|
|
4
|
+
__all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
|
|
5
|
+
|
|
3
6
|
TYPE_CHECKING = False
|
|
4
7
|
if TYPE_CHECKING:
|
|
5
|
-
from typing import Tuple
|
|
8
|
+
from typing import Tuple
|
|
9
|
+
from typing import Union
|
|
10
|
+
|
|
6
11
|
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
7
12
|
else:
|
|
8
13
|
VERSION_TUPLE = object
|
|
@@ -12,5 +17,5 @@ __version__: str
|
|
|
12
17
|
__version_tuple__: VERSION_TUPLE
|
|
13
18
|
version_tuple: VERSION_TUPLE
|
|
14
19
|
|
|
15
|
-
__version__ = version = '0.
|
|
16
|
-
__version_tuple__ = version_tuple = (0,
|
|
20
|
+
__version__ = version = '0.9.1'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 9, 1)
|
cad_to_dagmc/core.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
|
+
from typing import Iterable
|
|
2
3
|
import cadquery as cq
|
|
3
4
|
import gmsh
|
|
4
5
|
import numpy as np
|
|
@@ -6,6 +7,7 @@ from cadquery import importers
|
|
|
6
7
|
from pymoab import core, types
|
|
7
8
|
import tempfile
|
|
8
9
|
import warnings
|
|
10
|
+
from cad_to_dagmc import __version__
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
def define_moab_core_and_tags() -> tuple[core.Core, dict]:
|
|
@@ -229,19 +231,18 @@ def get_volumes(gmsh, assembly, method="file", scale_factor=1.0):
|
|
|
229
231
|
def init_gmsh():
|
|
230
232
|
gmsh.initialize()
|
|
231
233
|
gmsh.option.setNumber("General.Terminal", 1)
|
|
232
|
-
gmsh.model.add("
|
|
234
|
+
gmsh.model.add(f"made_with_cad_to_dagmc_package_{__version__}")
|
|
233
235
|
return gmsh
|
|
234
236
|
|
|
235
237
|
|
|
236
|
-
def
|
|
238
|
+
def set_sizes_for_mesh(
|
|
237
239
|
gmsh,
|
|
238
240
|
min_mesh_size: float | None = None,
|
|
239
241
|
max_mesh_size: float | None = None,
|
|
240
242
|
mesh_algorithm: int = 1,
|
|
241
|
-
dimensions: int = 2,
|
|
242
243
|
set_size: dict[int, float] | None = None,
|
|
243
244
|
):
|
|
244
|
-
"""
|
|
245
|
+
"""Sets up the mesh sizes for each volume in the mesh.
|
|
245
246
|
|
|
246
247
|
Args:
|
|
247
248
|
occ_shape: the occ_shape of the Brep file to convert
|
|
@@ -251,8 +252,6 @@ def mesh_brep(
|
|
|
251
252
|
into gmsh.option.setNumber("Mesh.MeshSizeMax", max_mesh_size)
|
|
252
253
|
mesh_algorithm: The Gmsh mesh algorithm number to use. Passed into
|
|
253
254
|
gmsh.option.setNumber("Mesh.Algorithm", mesh_algorithm)
|
|
254
|
-
dimensions: The number of dimensions, 2 for a surface mesh 3 for a
|
|
255
|
-
volume mesh. Passed to gmsh.model.mesh.generate()
|
|
256
255
|
set_size: a dictionary of volume ids (int) and target mesh sizes
|
|
257
256
|
(floats) to set for each volume, passed to gmsh.model.mesh.setSize.
|
|
258
257
|
|
|
@@ -278,25 +277,42 @@ def mesh_brep(
|
|
|
278
277
|
volumes = gmsh.model.getEntities(3)
|
|
279
278
|
available_volumes = [volume[1] for volume in volumes]
|
|
280
279
|
print("volumes", volumes)
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
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:
|
|
280
|
+
|
|
281
|
+
# Ensure all volume IDs in set_size exist in the available volumes
|
|
282
|
+
for volume_id in set_size.keys():
|
|
283
|
+
if volume_id not in available_volumes:
|
|
295
284
|
raise ValueError(
|
|
296
285
|
f"volume ID of {volume_id} set in set_sizes but not found in available volumes {volumes}"
|
|
297
286
|
)
|
|
298
287
|
|
|
299
|
-
|
|
288
|
+
# Step 1: Preprocess boundaries to find shared surfaces and decide mesh sizes
|
|
289
|
+
boundary_sizes = {} # Dictionary to store the mesh size and count for each boundary
|
|
290
|
+
for volume_id, size in set_size.items():
|
|
291
|
+
boundaries = gmsh.model.getBoundary(
|
|
292
|
+
[(3, volume_id)], recursive=True
|
|
293
|
+
) # dim must be set to 3
|
|
294
|
+
print(f"Boundaries for volume {volume_id}: {boundaries}")
|
|
295
|
+
|
|
296
|
+
for boundary in boundaries:
|
|
297
|
+
boundary_key = (boundary[0], boundary[1]) # (dimension, tag)
|
|
298
|
+
if boundary_key in boundary_sizes:
|
|
299
|
+
# If the boundary is already processed, add the size to the list
|
|
300
|
+
boundary_sizes[boundary_key]["total_size"] += size
|
|
301
|
+
boundary_sizes[boundary_key]["count"] += 1
|
|
302
|
+
else:
|
|
303
|
+
# Otherwise, initialize the boundary with the current size
|
|
304
|
+
boundary_sizes[boundary_key] = {"total_size": size, "count": 1}
|
|
305
|
+
|
|
306
|
+
# Step 2: Calculate the average size for each boundary
|
|
307
|
+
averaged_boundary_sizes = {
|
|
308
|
+
boundary: data["total_size"] / data["count"]
|
|
309
|
+
for boundary, data in boundary_sizes.items()
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
# Step 3: Apply mesh sizes to all boundaries
|
|
313
|
+
for boundary, size in averaged_boundary_sizes.items():
|
|
314
|
+
gmsh.model.mesh.setSize([boundary], size)
|
|
315
|
+
print(f"Set mesh size {size} for boundary {boundary}")
|
|
300
316
|
|
|
301
317
|
return gmsh
|
|
302
318
|
|
|
@@ -318,7 +334,9 @@ def mesh_to_vertices_and_triangles(
|
|
|
318
334
|
for dim_and_vol in dims_and_vol_ids:
|
|
319
335
|
# removes all groups so that the following getEntitiesForPhysicalGroup
|
|
320
336
|
# command only finds surfaces for the volume
|
|
321
|
-
gmsh.model.
|
|
337
|
+
face_groups = gmsh.model.getPhysicalGroups(2)
|
|
338
|
+
if face_groups: # Only remove if 2D groups exist
|
|
339
|
+
gmsh.model.removePhysicalGroups(face_groups)
|
|
322
340
|
|
|
323
341
|
vol_id = dim_and_vol[1]
|
|
324
342
|
entities_in_volume = gmsh.model.getAdjacencies(3, vol_id)
|
|
@@ -399,64 +417,122 @@ def order_material_ids_by_brep_order(original_ids, scrambled_id, material_tags):
|
|
|
399
417
|
return material_tags_in_brep_order
|
|
400
418
|
|
|
401
419
|
|
|
402
|
-
|
|
403
|
-
|
|
420
|
+
def export_gmsh_object_to_dagmc_h5m_file(
|
|
421
|
+
material_tags: list[str] | None = None,
|
|
422
|
+
implicit_complement_material_tag: str | None = None,
|
|
423
|
+
filename: str = "dagmc.h5m",
|
|
424
|
+
) -> str:
|
|
425
|
+
"""
|
|
426
|
+
Exports a GMSH object to a DAGMC-compatible h5m file. Note gmsh should
|
|
427
|
+
be initialized by the user prior and the gmsh model should be meshed before
|
|
428
|
+
calling this. Also users should ensure that the gmsh model is finalized.
|
|
404
429
|
|
|
405
|
-
|
|
406
|
-
|
|
430
|
+
Args:
|
|
431
|
+
material_tags: A list of material tags corresponding to the volumes in the GMSH object.
|
|
432
|
+
implicit_complement_material_tag: The material tag for the implicit complement (void space).
|
|
433
|
+
filename: The name of the output h5m file. Defaults to "dagmc.h5m".
|
|
407
434
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
# TODO test for exports result in files
|
|
435
|
+
Returns:
|
|
436
|
+
str: The filename of the generated DAGMC h5m file.
|
|
411
437
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
implicit_complement_material_tag: str | None = None,
|
|
416
|
-
filename: str = "dagmc.h5m",
|
|
417
|
-
):
|
|
418
|
-
"""Saves a DAGMC h5m file of the geometry
|
|
438
|
+
Raises:
|
|
439
|
+
ValueError: If the number of material tags does not match the number of volumes in the GMSH object.
|
|
440
|
+
"""
|
|
419
441
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
material tags to assign. These will need to be in the same
|
|
423
|
-
order as the volumes in the GMESH mesh and match the
|
|
424
|
-
material tags used in the neutronics code (e.g. OpenMC).
|
|
425
|
-
implicit_complement_material_tag (str | None, optional):
|
|
426
|
-
the name of the material tag to use for the implicit
|
|
427
|
-
complement (void space). Defaults to None which is a vacuum.
|
|
428
|
-
filename (str, optional): _description_. Defaults to "dagmc.h5m".
|
|
442
|
+
if material_tags is None:
|
|
443
|
+
material_tags = _get_material_tags_from_gmsh()
|
|
429
444
|
|
|
430
|
-
|
|
431
|
-
ValueError: _description_
|
|
445
|
+
dims_and_vol_ids = gmsh.model.getEntities(3)
|
|
432
446
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
447
|
+
if len(dims_and_vol_ids) != len(material_tags):
|
|
448
|
+
msg = f"Number of volumes {len(dims_and_vol_ids)} is not equal to number of material tags {len(material_tags)}"
|
|
449
|
+
raise ValueError(msg)
|
|
436
450
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
451
|
+
vertices, triangles_by_solid_by_face = mesh_to_vertices_and_triangles(
|
|
452
|
+
dims_and_vol_ids=dims_and_vol_ids
|
|
453
|
+
)
|
|
440
454
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
455
|
+
h5m_filename = vertices_to_h5m(
|
|
456
|
+
vertices=vertices,
|
|
457
|
+
triangles_by_solid_by_face=triangles_by_solid_by_face,
|
|
458
|
+
material_tags=material_tags,
|
|
459
|
+
h5m_filename=filename,
|
|
460
|
+
implicit_complement_material_tag=implicit_complement_material_tag,
|
|
461
|
+
)
|
|
444
462
|
|
|
445
|
-
|
|
446
|
-
dims_and_vol_ids=dims_and_vol_ids
|
|
447
|
-
)
|
|
463
|
+
return h5m_filename
|
|
448
464
|
|
|
449
|
-
gmsh.finalize()
|
|
450
465
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
466
|
+
def _get_material_tags_from_gmsh() -> list[str]:
|
|
467
|
+
"""Gets the Physical groups of 3D groups from the GMSH object and returns
|
|
468
|
+
their names."""
|
|
469
|
+
|
|
470
|
+
# Get all 3D physical groups (volumes)
|
|
471
|
+
volume_groups = gmsh.model.getPhysicalGroups(3)
|
|
472
|
+
|
|
473
|
+
material_tags = []
|
|
474
|
+
# Get the name for each physical group
|
|
475
|
+
for dim, tag in volume_groups:
|
|
476
|
+
name = gmsh.model.getPhysicalName(dim, tag)
|
|
477
|
+
material_tags.append(name)
|
|
478
|
+
print(f"Material tag: {name}")
|
|
479
|
+
print(f"Material tags: {material_tags}")
|
|
480
|
+
return material_tags
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
def export_gmsh_file_to_dagmc_h5m_file(
|
|
484
|
+
gmsh_filename: str,
|
|
485
|
+
material_tags: list[str] | None = None,
|
|
486
|
+
implicit_complement_material_tag: str | None = None,
|
|
487
|
+
dagmc_filename: str = "dagmc.h5m",
|
|
488
|
+
) -> str:
|
|
489
|
+
"""Saves a DAGMC h5m file of the geometry GMsh file. This function
|
|
490
|
+
initializes and finalizes Gmsh.
|
|
491
|
+
|
|
492
|
+
Args:
|
|
493
|
+
material_tags (list[str]): the names of the DAGMC
|
|
494
|
+
material tags to assign. These will need to be in the same
|
|
495
|
+
order as the volumes in the GMESH mesh and match the
|
|
496
|
+
material tags used in the neutronics code (e.g. OpenMC).
|
|
497
|
+
implicit_complement_material_tag (str | None, optional):
|
|
498
|
+
the name of the material tag to use for the implicit
|
|
499
|
+
complement (void space). Defaults to None which is a vacuum.
|
|
500
|
+
dagmc_filename (str, optional): _description_. Defaults to "dagmc.h5m".
|
|
501
|
+
|
|
502
|
+
Returns:
|
|
503
|
+
str: The filename of the generated DAGMC h5m file.
|
|
504
|
+
|
|
505
|
+
Raises:
|
|
506
|
+
ValueError: If the number of material tags does not match the number of volumes in the GMSH object.
|
|
507
|
+
"""
|
|
508
|
+
|
|
509
|
+
gmsh.initialize()
|
|
510
|
+
gmsh.open(gmsh_filename)
|
|
458
511
|
|
|
459
|
-
|
|
512
|
+
if material_tags is None:
|
|
513
|
+
material_tags = _get_material_tags_from_gmsh()
|
|
514
|
+
|
|
515
|
+
dims_and_vol_ids = gmsh.model.getEntities(3)
|
|
516
|
+
|
|
517
|
+
if len(dims_and_vol_ids) != len(material_tags):
|
|
518
|
+
msg = f"Number of volumes {len(dims_and_vol_ids)} is not equal to number of material tags {len(material_tags)}"
|
|
519
|
+
raise ValueError(msg)
|
|
520
|
+
|
|
521
|
+
vertices, triangles_by_solid_by_face = mesh_to_vertices_and_triangles(
|
|
522
|
+
dims_and_vol_ids=dims_and_vol_ids
|
|
523
|
+
)
|
|
524
|
+
|
|
525
|
+
gmsh.finalize()
|
|
526
|
+
|
|
527
|
+
h5m_filename = vertices_to_h5m(
|
|
528
|
+
vertices=vertices,
|
|
529
|
+
triangles_by_solid_by_face=triangles_by_solid_by_face,
|
|
530
|
+
material_tags=material_tags,
|
|
531
|
+
h5m_filename=dagmc_filename,
|
|
532
|
+
implicit_complement_material_tag=implicit_complement_material_tag,
|
|
533
|
+
)
|
|
534
|
+
|
|
535
|
+
return h5m_filename
|
|
460
536
|
|
|
461
537
|
|
|
462
538
|
class CadToDagmc:
|
|
@@ -554,11 +630,13 @@ class CadToDagmc:
|
|
|
554
630
|
scale_factor: float = 1.0,
|
|
555
631
|
imprint: bool = True,
|
|
556
632
|
set_size: dict[int, float] | None = None,
|
|
633
|
+
volumes: Iterable[int] | None = None,
|
|
557
634
|
):
|
|
558
635
|
"""
|
|
559
|
-
Exports an unstructured mesh file in VTK format for use with
|
|
560
|
-
Compatible with the MOAB unstructured mesh
|
|
561
|
-
openmc.UnstructuredMesh(filename="umesh.vtk",
|
|
636
|
+
Exports an unstructured mesh file in VTK format for use with
|
|
637
|
+
openmc.UnstructuredMesh. Compatible with the MOAB unstructured mesh
|
|
638
|
+
library. Example useage openmc.UnstructuredMesh(filename="umesh.vtk",
|
|
639
|
+
library="moab").
|
|
562
640
|
|
|
563
641
|
Parameters:
|
|
564
642
|
-----------
|
|
@@ -587,6 +665,8 @@ class CadToDagmc:
|
|
|
587
665
|
and this can save time.
|
|
588
666
|
set_size: a dictionary of volume ids (int) and target mesh sizes
|
|
589
667
|
(floats) to set for each volume, passed to gmsh.model.mesh.setSize.
|
|
668
|
+
volumes: a list of volume ids (int) to include in the mesh. If left
|
|
669
|
+
as default (None) then all volumes will be included.
|
|
590
670
|
|
|
591
671
|
|
|
592
672
|
Returns:
|
|
@@ -611,17 +691,30 @@ class CadToDagmc:
|
|
|
611
691
|
|
|
612
692
|
gmsh = init_gmsh()
|
|
613
693
|
|
|
614
|
-
gmsh,
|
|
694
|
+
gmsh, volumes_in_model = get_volumes(
|
|
695
|
+
gmsh, imprinted_assembly, method=method, scale_factor=scale_factor
|
|
696
|
+
)
|
|
615
697
|
|
|
616
|
-
gmsh =
|
|
698
|
+
gmsh = set_sizes_for_mesh(
|
|
617
699
|
gmsh=gmsh,
|
|
618
700
|
min_mesh_size=min_mesh_size,
|
|
619
701
|
max_mesh_size=max_mesh_size,
|
|
620
702
|
mesh_algorithm=mesh_algorithm,
|
|
621
|
-
dimensions=3,
|
|
622
703
|
set_size=set_size,
|
|
623
704
|
)
|
|
624
705
|
|
|
706
|
+
if volumes:
|
|
707
|
+
for volume_id in volumes_in_model:
|
|
708
|
+
if volume_id[1] not in volumes:
|
|
709
|
+
gmsh.model.occ.remove([volume_id], recursive=True)
|
|
710
|
+
gmsh.option.setNumber("Mesh.SaveAll", 1)
|
|
711
|
+
gmsh.model.occ.synchronize()
|
|
712
|
+
# Clear the mesh
|
|
713
|
+
gmsh.model.mesh.clear()
|
|
714
|
+
gmsh.option.setNumber("Mesh.SaveElementTagType", 3) # Save only volume elements
|
|
715
|
+
|
|
716
|
+
gmsh.model.mesh.generate(3)
|
|
717
|
+
|
|
625
718
|
# makes the folder if it does not exist
|
|
626
719
|
if Path(filename).parent:
|
|
627
720
|
Path(filename).parent.mkdir(parents=True, exist_ok=True)
|
|
@@ -634,7 +727,7 @@ class CadToDagmc:
|
|
|
634
727
|
|
|
635
728
|
gmsh.finalize()
|
|
636
729
|
|
|
637
|
-
return
|
|
730
|
+
return filename
|
|
638
731
|
|
|
639
732
|
def export_gmsh_mesh_file(
|
|
640
733
|
self,
|
|
@@ -690,15 +783,16 @@ class CadToDagmc:
|
|
|
690
783
|
|
|
691
784
|
gmsh, _ = get_volumes(gmsh, imprinted_assembly, method=method, scale_factor=scale_factor)
|
|
692
785
|
|
|
693
|
-
gmsh =
|
|
786
|
+
gmsh = set_sizes_for_mesh(
|
|
694
787
|
gmsh=gmsh,
|
|
695
788
|
min_mesh_size=min_mesh_size,
|
|
696
789
|
max_mesh_size=max_mesh_size,
|
|
697
790
|
mesh_algorithm=mesh_algorithm,
|
|
698
|
-
dimensions=dimensions,
|
|
699
791
|
set_size=set_size,
|
|
700
792
|
)
|
|
701
793
|
|
|
794
|
+
gmsh.model.mesh.generate(dimensions)
|
|
795
|
+
|
|
702
796
|
# makes the folder if it does not exist
|
|
703
797
|
if Path(filename).parent:
|
|
704
798
|
Path(filename).parent.mkdir(parents=True, exist_ok=True)
|
|
@@ -791,7 +885,7 @@ class CadToDagmc:
|
|
|
791
885
|
gmsh, imprinted_assembly, method=method, scale_factor=scale_factor
|
|
792
886
|
)
|
|
793
887
|
|
|
794
|
-
gmsh =
|
|
888
|
+
gmsh = set_sizes_for_mesh(
|
|
795
889
|
gmsh=gmsh,
|
|
796
890
|
min_mesh_size=min_mesh_size,
|
|
797
891
|
max_mesh_size=max_mesh_size,
|
|
@@ -799,6 +893,8 @@ class CadToDagmc:
|
|
|
799
893
|
set_size=set_size,
|
|
800
894
|
)
|
|
801
895
|
|
|
896
|
+
gmsh.model.mesh.generate(2)
|
|
897
|
+
|
|
802
898
|
dims_and_vol_ids = volumes
|
|
803
899
|
|
|
804
900
|
vertices, triangles_by_solid_by_face = mesh_to_vertices_and_triangles(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: cad_to_dagmc
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.1
|
|
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
|
|
@@ -20,6 +20,8 @@ Requires-Dist: gmsh
|
|
|
20
20
|
Provides-Extra: tests
|
|
21
21
|
Requires-Dist: pytest; extra == "tests"
|
|
22
22
|
Requires-Dist: vtk; extra == "tests"
|
|
23
|
+
Requires-Dist: assembly-mesh-plugin; extra == "tests"
|
|
24
|
+
Dynamic: license-file
|
|
23
25
|
|
|
24
26
|
|
|
25
27
|
[](https://www.python.org)
|
|
@@ -43,13 +45,17 @@ cad-to-dagmc can create DAGMC compatible:
|
|
|
43
45
|
|
|
44
46
|
cad-to-dagmc can convert the following in to DAGMC compatible meshes:
|
|
45
47
|
- STEP files
|
|
46
|
-
- CadQuery objects (
|
|
47
|
-
- Gmsh meshes
|
|
48
|
+
- CadQuery objects (optionally use names as material tags)
|
|
49
|
+
- Gmsh meshes (optionally use physical groups as material tags)
|
|
48
50
|
|
|
49
51
|
Cad-to-dagmc offers a wide range of features including.
|
|
52
|
+
- Compatibly with [assembly-mesh-plugin](https://github.com/CadQuery/assembly-mesh-plugin) (see examples)
|
|
53
|
+
- Access to the Gmsh mesh to allow user to define full set of mesh parameters
|
|
54
|
+
- Option to use Gmsh physical groups as material tags
|
|
50
55
|
- Geometry scaling with ```scale_factor``` argument
|
|
51
56
|
- Model wide mesh size parameters with ```min_mesh_size``` and ```max_mesh_size``` arguments
|
|
52
57
|
- Volume specific mesh sizing parameters with the ```set_size``` argument
|
|
58
|
+
- Volume mesh selected volumes in the geometry (helps ensure conformal volume and surface mesh).
|
|
53
59
|
- Parallel meshing to quickly mesh the geometry using multiple CPU cores
|
|
54
60
|
- Imprint and merging of CAD geometry, or disable with the ```imprint``` argument
|
|
55
61
|
- 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)
|
|
@@ -125,21 +131,10 @@ First ensure hdf5 is installed as this is needed by MOAB pip install command
|
|
|
125
131
|
sudo apt-get install libhdf5-dev
|
|
126
132
|
```
|
|
127
133
|
|
|
128
|
-
Then
|
|
134
|
+
Then install MOAB, currently available from the repo.
|
|
129
135
|
|
|
130
136
|
```
|
|
131
|
-
|
|
132
|
-
cd moab
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
Ensure pip is up to date as a new version is needed
|
|
136
|
-
```
|
|
137
|
-
python -m pip install --upgrade pip
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
Run the pip install command with cmake arguments.
|
|
141
|
-
```
|
|
142
|
-
pip install . --config-settings=cmake.args=-DENABLE_HDF5=ON
|
|
137
|
+
pip install git+https://bitbucket.org/fathomteam/moab/
|
|
143
138
|
```
|
|
144
139
|
|
|
145
140
|
Then you can install the cad_to_dagmc package with ```pip```
|
|
@@ -0,0 +1,8 @@
|
|
|
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,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
_version.py,sha256=t6tJJG56wlBKsg_0M1Q4l1ir09jgXRw1tolMbDalW9g,411
|
|
2
|
-
cad_to_dagmc/__init__.py,sha256=fskHUTyCunSpnpJUvBfAYjx4uwDKXHTTiMP6GqnFRf0,494
|
|
3
|
-
cad_to_dagmc/core.py,sha256=dW8p0TuQKJHPR6dqOulc7mTkB9zB2q_odkNSg8mU-Ew,31867
|
|
4
|
-
cad_to_dagmc-0.8.2.dist-info/LICENSE,sha256=B8kznH_777JVNZ3HOKDc4Tj24F7wJ68ledaNYeL9sCw,1070
|
|
5
|
-
cad_to_dagmc-0.8.2.dist-info/METADATA,sha256=aRZgmsBIcMbAB80vBJmuCWUkN6Ejab7X0IPBXsc52lU,8700
|
|
6
|
-
cad_to_dagmc-0.8.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
7
|
-
cad_to_dagmc-0.8.2.dist-info/top_level.txt,sha256=zTi8C64SEBsE5WOtPovnxhOzt-E6Oc5nC3RW6M_5aEA,22
|
|
8
|
-
cad_to_dagmc-0.8.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|