cad-to-dagmc 0.6.2__py3-none-any.whl → 0.7.0__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 +144 -52
- {cad_to_dagmc-0.6.2.dist-info → cad_to_dagmc-0.7.0.dist-info}/METADATA +55 -21
- cad_to_dagmc-0.7.0.dist-info/RECORD +8 -0
- cad_to_dagmc-0.6.2.dist-info/RECORD +0 -8
- {cad_to_dagmc-0.6.2.dist-info → cad_to_dagmc-0.7.0.dist-info}/LICENSE +0 -0
- {cad_to_dagmc-0.6.2.dist-info → cad_to_dagmc-0.7.0.dist-info}/WHEEL +0 -0
- {cad_to_dagmc-0.6.2.dist-info → cad_to_dagmc-0.7.0.dist-info}/top_level.txt +0 -0
_version.py
CHANGED
cad_to_dagmc/core.py
CHANGED
|
@@ -189,11 +189,13 @@ def _vertices_to_h5m(
|
|
|
189
189
|
|
|
190
190
|
moab_core.write_file(h5m_filename)
|
|
191
191
|
|
|
192
|
+
print(f"written DAGMC file {h5m_filename}")
|
|
193
|
+
|
|
192
194
|
return h5m_filename
|
|
193
195
|
|
|
194
196
|
|
|
195
197
|
def _mesh_brep(
|
|
196
|
-
|
|
198
|
+
occ_shape: str,
|
|
197
199
|
min_mesh_size: float = 1,
|
|
198
200
|
max_mesh_size: float = 10,
|
|
199
201
|
mesh_algorithm: int = 1,
|
|
@@ -203,7 +205,7 @@ def _mesh_brep(
|
|
|
203
205
|
Gmsh.
|
|
204
206
|
|
|
205
207
|
Args:
|
|
206
|
-
|
|
208
|
+
occ_shape: the occ_shape of the Brep file to convert
|
|
207
209
|
min_mesh_size: the minimum mesh element size to use in Gmsh. Passed
|
|
208
210
|
into gmsh.option.setNumber("Mesh.MeshSizeMin", min_mesh_size)
|
|
209
211
|
max_mesh_size: the maximum mesh element size to use in Gmsh. Passed
|
|
@@ -220,7 +222,7 @@ def _mesh_brep(
|
|
|
220
222
|
gmsh.initialize()
|
|
221
223
|
gmsh.option.setNumber("General.Terminal", 1)
|
|
222
224
|
gmsh.model.add("made_with_cad_to_dagmc_package")
|
|
223
|
-
volumes = gmsh.model.occ.importShapesNativePointer(
|
|
225
|
+
volumes = gmsh.model.occ.importShapesNativePointer(occ_shape)
|
|
224
226
|
gmsh.model.occ.synchronize()
|
|
225
227
|
|
|
226
228
|
gmsh.option.setNumber("Mesh.Algorithm", mesh_algorithm)
|
|
@@ -231,16 +233,13 @@ def _mesh_brep(
|
|
|
231
233
|
return gmsh, volumes
|
|
232
234
|
|
|
233
235
|
|
|
234
|
-
def
|
|
235
|
-
|
|
236
|
-
)
|
|
237
|
-
"""Converts gmsh volumes into
|
|
236
|
+
def mesh_to_vertices_and_triangles(
|
|
237
|
+
dims_and_vol_ids,
|
|
238
|
+
):
|
|
239
|
+
"""Converts gmsh volumes into vertices and triangles for each face.
|
|
238
240
|
|
|
239
241
|
Args:
|
|
240
242
|
volumes: the volumes in the gmsh file, found with gmsh.model.occ.importShapes
|
|
241
|
-
material_tags: A list of material tags to tag the DAGMC volumes with.
|
|
242
|
-
Should be in the same order as the volumes
|
|
243
|
-
h5m_filename: the filename of the DAGMC h5m file to write
|
|
244
243
|
|
|
245
244
|
Returns:
|
|
246
245
|
vertices and triangles (grouped by solid then by face)
|
|
@@ -248,7 +247,7 @@ def _mesh_to_h5m_in_memory_method(
|
|
|
248
247
|
|
|
249
248
|
n = 3 # number of verts in a triangles
|
|
250
249
|
triangles_by_solid_by_face = {}
|
|
251
|
-
for dim_and_vol in
|
|
250
|
+
for dim_and_vol in dims_and_vol_ids:
|
|
252
251
|
# removes all groups so that the following getEntitiesForPhysicalGroup
|
|
253
252
|
# command only finds surfaces for the volume
|
|
254
253
|
gmsh.model.removePhysicalGroups()
|
|
@@ -302,6 +301,22 @@ def _get_ids_from_imprinted_assembly(solid_id_dict):
|
|
|
302
301
|
return ids
|
|
303
302
|
|
|
304
303
|
|
|
304
|
+
def _check_material_tags(material_tags, iterable_solids):
|
|
305
|
+
if material_tags:
|
|
306
|
+
if len(material_tags) != len(iterable_solids):
|
|
307
|
+
msg = (
|
|
308
|
+
"When setting material_tags the number of material_tags \n"
|
|
309
|
+
"should be equal to the number of volumes in the CAD \n"
|
|
310
|
+
f"geometry {len(iterable_solids)} volumes found in model \n"
|
|
311
|
+
f"and {len(material_tags)} material_tags found"
|
|
312
|
+
)
|
|
313
|
+
raise ValueError(msg)
|
|
314
|
+
for material_tag in material_tags:
|
|
315
|
+
if not isinstance(material_tag, str):
|
|
316
|
+
msg = f"material_tags should be an iterable of strings."
|
|
317
|
+
raise ValueError(msg)
|
|
318
|
+
|
|
319
|
+
|
|
305
320
|
def order_material_ids_by_brep_order(original_ids, scrambled_id, material_tags):
|
|
306
321
|
material_tags_in_brep_order = []
|
|
307
322
|
for brep_id in scrambled_id:
|
|
@@ -310,23 +325,87 @@ def order_material_ids_by_brep_order(original_ids, scrambled_id, material_tags):
|
|
|
310
325
|
return material_tags_in_brep_order
|
|
311
326
|
|
|
312
327
|
|
|
328
|
+
class MeshToDagmc:
|
|
329
|
+
"""Convert a GMSH mesh file to a DAGMC h5m file"""
|
|
330
|
+
|
|
331
|
+
def __init__(self, filename: str):
|
|
332
|
+
self.filename = filename
|
|
333
|
+
|
|
334
|
+
# TODO add export_unstructured_mesh_file
|
|
335
|
+
# TODO add add_gmsh_msh_file
|
|
336
|
+
|
|
337
|
+
def export_dagmc_h5m_file(
|
|
338
|
+
self,
|
|
339
|
+
material_tags: typing.Iterable[str],
|
|
340
|
+
implicit_complement_material_tag: typing.Optional[str] = None,
|
|
341
|
+
filename: str = "dagmc.h5m",
|
|
342
|
+
):
|
|
343
|
+
"""Saves a DAGMC h5m file of the geometry
|
|
344
|
+
|
|
345
|
+
Args:
|
|
346
|
+
material_tags (typing.Iterable[str]): the names of the DAGMC
|
|
347
|
+
material tags to assign. These will need to be in the same
|
|
348
|
+
order as the volumes in the GMESH mesh and match the
|
|
349
|
+
material tags used in the neutronics code (e.g. OpenMC).
|
|
350
|
+
implicit_complement_material_tag (typing.Optional[str], optional):
|
|
351
|
+
the name of the material tag to use for the implicit
|
|
352
|
+
complement (void space). Defaults to None which is a vacuum.
|
|
353
|
+
filename (str, optional): _description_. Defaults to "dagmc.h5m".
|
|
354
|
+
|
|
355
|
+
Raises:
|
|
356
|
+
ValueError: _description_
|
|
357
|
+
|
|
358
|
+
Returns:
|
|
359
|
+
_type_: _description_
|
|
360
|
+
"""
|
|
361
|
+
|
|
362
|
+
gmsh.initialize()
|
|
363
|
+
self.mesh_file = gmsh.open(self.filename)
|
|
364
|
+
dims_and_vol_ids = gmsh.model.getEntities(3)
|
|
365
|
+
|
|
366
|
+
if len(dims_and_vol_ids) != len(material_tags):
|
|
367
|
+
msg = f"Number of volumes {len(dims_and_vol_ids)} is not equal to number of material tags {len(material_tags)}"
|
|
368
|
+
raise ValueError(msg)
|
|
369
|
+
|
|
370
|
+
vertices, triangles_by_solid_by_face = mesh_to_vertices_and_triangles(
|
|
371
|
+
dims_and_vol_ids=dims_and_vol_ids
|
|
372
|
+
)
|
|
373
|
+
|
|
374
|
+
gmsh.finalize()
|
|
375
|
+
|
|
376
|
+
h5m_filename = _vertices_to_h5m(
|
|
377
|
+
vertices=vertices,
|
|
378
|
+
triangles_by_solid_by_face=triangles_by_solid_by_face,
|
|
379
|
+
material_tags=material_tags,
|
|
380
|
+
h5m_filename=filename,
|
|
381
|
+
implicit_complement_material_tag=implicit_complement_material_tag,
|
|
382
|
+
)
|
|
383
|
+
|
|
384
|
+
return h5m_filename
|
|
385
|
+
|
|
386
|
+
|
|
313
387
|
class CadToDagmc:
|
|
388
|
+
"""Converts Step files and CadQuery parts to a DAGMC h5m file"""
|
|
389
|
+
|
|
314
390
|
def __init__(self):
|
|
315
391
|
self.parts = []
|
|
392
|
+
self.material_tags = []
|
|
316
393
|
|
|
317
394
|
def add_stp_file(
|
|
318
395
|
self,
|
|
319
396
|
filename: str,
|
|
320
397
|
scale_factor: float = 1.0,
|
|
398
|
+
material_tags: typing.Optional[typing.Iterable[str]] = None,
|
|
321
399
|
):
|
|
322
400
|
"""Loads the parts from stp file into the model.
|
|
323
401
|
|
|
324
402
|
Args:
|
|
325
403
|
filename: the filename used to save the html graph.
|
|
326
|
-
material_tags: the names of the DAGMC
|
|
327
|
-
These will need to be in the
|
|
328
|
-
|
|
329
|
-
|
|
404
|
+
material_tags (typing.Iterable[str]): the names of the DAGMC
|
|
405
|
+
material tags to assign. These will need to be in the
|
|
406
|
+
same order as the volumes in the geometry added (STP
|
|
407
|
+
file and CadQuery objects) and match the material tags
|
|
408
|
+
used in the neutronics code (e.g. OpenMC).
|
|
330
409
|
scale_factor: a scaling factor to apply to the geometry that can be
|
|
331
410
|
used to increase the size or decrease the size of the geometry.
|
|
332
411
|
Useful when converting the geometry to cm for use in neutronics
|
|
@@ -338,27 +417,38 @@ class CadToDagmc:
|
|
|
338
417
|
scaled_part = part
|
|
339
418
|
else:
|
|
340
419
|
scaled_part = part.scale(scale_factor)
|
|
341
|
-
self.add_cadquery_object(
|
|
420
|
+
self.add_cadquery_object(cadquery_object=scaled_part, material_tags=material_tags)
|
|
342
421
|
|
|
343
422
|
def add_cadquery_object(
|
|
344
423
|
self,
|
|
345
|
-
|
|
424
|
+
cadquery_object: typing.Union[
|
|
346
425
|
cq.assembly.Assembly, cq.occ_impl.shapes.Compound, cq.occ_impl.shapes.Solid
|
|
347
426
|
],
|
|
427
|
+
material_tags: typing.Optional[typing.Iterable[str]] = None,
|
|
348
428
|
):
|
|
349
429
|
"""Loads the parts from CadQuery object into the model.
|
|
350
430
|
|
|
351
431
|
Args:
|
|
352
|
-
|
|
432
|
+
cadquery_object: the cadquery object to convert, can be a CadQuery assembly
|
|
433
|
+
cadquery workplane or a cadquery solid
|
|
434
|
+
material_tags (Optional typing.Iterable[str]): the names of the
|
|
435
|
+
DAGMC material tags to assign. These will need to be in the
|
|
436
|
+
same order as the volumes in the geometry added (STP file and
|
|
437
|
+
CadQuery objects) and match the material tags used in the
|
|
438
|
+
neutronics code (e.g. OpenMC).
|
|
353
439
|
"""
|
|
354
440
|
|
|
355
|
-
if isinstance(
|
|
356
|
-
|
|
441
|
+
if isinstance(cadquery_object, cq.assembly.Assembly):
|
|
442
|
+
cadquery_object = cadquery_object.toCompound()
|
|
357
443
|
|
|
358
|
-
if isinstance(
|
|
359
|
-
iterable_solids =
|
|
444
|
+
if isinstance(cadquery_object, (cq.occ_impl.shapes.Compound, cq.occ_impl.shapes.Solid)):
|
|
445
|
+
iterable_solids = cadquery_object.Solids()
|
|
360
446
|
else:
|
|
361
|
-
iterable_solids =
|
|
447
|
+
iterable_solids = cadquery_object.val().Solids()
|
|
448
|
+
|
|
449
|
+
_check_material_tags(material_tags, iterable_solids)
|
|
450
|
+
if material_tags:
|
|
451
|
+
self.material_tags = self.material_tags + material_tags
|
|
362
452
|
self.parts = self.parts + iterable_solids
|
|
363
453
|
|
|
364
454
|
def export_unstructured_mesh_file(
|
|
@@ -375,8 +465,8 @@ class CadToDagmc:
|
|
|
375
465
|
|
|
376
466
|
imprinted_assembly, _ = cq.occ_impl.assembly.imprint(assembly)
|
|
377
467
|
|
|
378
|
-
gmsh,
|
|
379
|
-
|
|
468
|
+
gmsh, _ = _mesh_brep(
|
|
469
|
+
occ_shape=imprinted_assembly.wrapped._address(),
|
|
380
470
|
min_mesh_size=min_mesh_size,
|
|
381
471
|
max_mesh_size=max_mesh_size,
|
|
382
472
|
mesh_algorithm=mesh_algorithm,
|
|
@@ -392,6 +482,8 @@ class CadToDagmc:
|
|
|
392
482
|
|
|
393
483
|
gmsh.finalize()
|
|
394
484
|
|
|
485
|
+
return gmsh
|
|
486
|
+
|
|
395
487
|
def export_gmsh_mesh_file(
|
|
396
488
|
self,
|
|
397
489
|
filename: str = "mesh.msh",
|
|
@@ -418,8 +510,8 @@ class CadToDagmc:
|
|
|
418
510
|
|
|
419
511
|
imprinted_assembly, _ = cq.occ_impl.assembly.imprint(assembly)
|
|
420
512
|
|
|
421
|
-
gmsh,
|
|
422
|
-
|
|
513
|
+
gmsh, _ = _mesh_brep(
|
|
514
|
+
occ_shape=imprinted_assembly.wrapped._address(),
|
|
423
515
|
min_mesh_size=min_mesh_size,
|
|
424
516
|
max_mesh_size=max_mesh_size,
|
|
425
517
|
mesh_algorithm=mesh_algorithm,
|
|
@@ -428,32 +520,34 @@ class CadToDagmc:
|
|
|
428
520
|
|
|
429
521
|
gmsh.write(filename)
|
|
430
522
|
|
|
523
|
+
print(f"written GMSH mesh file {filename}")
|
|
524
|
+
|
|
431
525
|
gmsh.finalize()
|
|
432
526
|
|
|
433
527
|
def export_dagmc_h5m_file(
|
|
434
528
|
self,
|
|
435
|
-
material_tags: typing.Iterable[str],
|
|
436
529
|
filename: str = "dagmc.h5m",
|
|
437
530
|
min_mesh_size: float = 1,
|
|
438
531
|
max_mesh_size: float = 5,
|
|
439
532
|
mesh_algorithm: int = 1,
|
|
440
533
|
implicit_complement_material_tag: typing.Optional[str] = None,
|
|
441
|
-
):
|
|
534
|
+
) -> str:
|
|
442
535
|
"""Saves a DAGMC h5m file of the geometry
|
|
443
536
|
|
|
444
537
|
Args:
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
538
|
+
|
|
539
|
+
filename (str, optional): the filename to use for the saved DAGMC file. Defaults to "dagmc.h5m".
|
|
540
|
+
min_mesh_size (float, optional): the minimum size of mesh elements to use. Defaults to 1.
|
|
541
|
+
max_mesh_size (float, optional): the maximum size of mesh elements to use. Defaults to 5.
|
|
542
|
+
mesh_algorithm (int, optional): the GMSH mesh algorithm to use.. Defaults to 1.
|
|
543
|
+
implicit_complement_material_tag (typing.Optional[str], optional):
|
|
544
|
+
the name of the material tag to use for the implicit complement
|
|
545
|
+
(void space). Defaults to None which is a vacuum. Defaults to None.
|
|
546
|
+
|
|
547
|
+
Returns:
|
|
548
|
+
str: the DAGMC filename saved
|
|
456
549
|
"""
|
|
550
|
+
|
|
457
551
|
assembly = cq.Assembly()
|
|
458
552
|
for part in self.parts:
|
|
459
553
|
assembly.add(part)
|
|
@@ -466,30 +560,28 @@ class CadToDagmc:
|
|
|
466
560
|
# both id lists should be the same length as each other and the same
|
|
467
561
|
# length as the self.material_tags
|
|
468
562
|
|
|
469
|
-
if len(original_ids) != len(material_tags):
|
|
470
|
-
msg = f"Number of volumes {len(original_ids)} is not equal to number of material tags {len(material_tags)}"
|
|
563
|
+
if len(original_ids) != len(self.material_tags):
|
|
564
|
+
msg = f"Number of volumes {len(original_ids)} is not equal to number of material tags {len(self.material_tags)}"
|
|
471
565
|
raise ValueError(msg)
|
|
472
566
|
|
|
473
567
|
material_tags_in_brep_order = order_material_ids_by_brep_order(
|
|
474
|
-
original_ids, scrambled_ids, material_tags
|
|
568
|
+
original_ids, scrambled_ids, self.material_tags
|
|
475
569
|
)
|
|
476
570
|
|
|
571
|
+
_check_material_tags(material_tags_in_brep_order, self.parts)
|
|
572
|
+
|
|
477
573
|
gmsh, volumes = _mesh_brep(
|
|
478
|
-
|
|
574
|
+
occ_shape=imprinted_assembly.wrapped._address(), # in memory address
|
|
479
575
|
min_mesh_size=min_mesh_size,
|
|
480
576
|
max_mesh_size=max_mesh_size,
|
|
481
577
|
mesh_algorithm=mesh_algorithm,
|
|
482
578
|
)
|
|
483
579
|
|
|
484
|
-
|
|
485
|
-
msg = f"material_tags should be a list of strings, not a single string."
|
|
486
|
-
raise ValueError(msg)
|
|
487
|
-
|
|
488
|
-
if len(volumes) != len(material_tags_in_brep_order):
|
|
489
|
-
msg = f"{len(volumes)} volumes found in Brep file is not equal to the number of material_tags {len(material_tags_in_brep_order)} provided."
|
|
490
|
-
raise ValueError(msg)
|
|
580
|
+
dims_and_vol_ids = volumes
|
|
491
581
|
|
|
492
|
-
vertices, triangles_by_solid_by_face =
|
|
582
|
+
vertices, triangles_by_solid_by_face = mesh_to_vertices_and_triangles(
|
|
583
|
+
dims_and_vol_ids=dims_and_vol_ids
|
|
584
|
+
)
|
|
493
585
|
|
|
494
586
|
gmsh.finalize()
|
|
495
587
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cad_to_dagmc
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
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
|
|
@@ -51,10 +51,59 @@ Also checkout these other software projects that also create DAGMC geometry [CAD
|
|
|
51
51
|
|
|
52
52
|
# Installation options
|
|
53
53
|
|
|
54
|
+
- Install using Mamba
|
|
55
|
+
- Install using Conda
|
|
54
56
|
- Install using Mamba and pip
|
|
55
57
|
- Install using Conda and pip
|
|
56
58
|
- Install using pip and source compilations
|
|
57
59
|
|
|
60
|
+
## Install using Mamba
|
|
61
|
+
|
|
62
|
+
In principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:
|
|
63
|
+
- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)
|
|
64
|
+
- [Anaconda](https://www.anaconda.com/download)
|
|
65
|
+
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)
|
|
66
|
+
|
|
67
|
+
This example assumes you have installed the Miniforge option or separately have installed Mamba with ```conda install -c conda-forge mamba -y```
|
|
68
|
+
|
|
69
|
+
Create a new environment, I've chosen Python 3.10 here but newer versions are
|
|
70
|
+
also supported.
|
|
71
|
+
```bash
|
|
72
|
+
mamba create --name new_env python=3.10 -y
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Activate the environment
|
|
76
|
+
```bash
|
|
77
|
+
mamba activate new_env
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Then you can install the cad_to_dagmc package
|
|
81
|
+
```bash
|
|
82
|
+
mamba install -y -c conda-forge cad_to_dagmc
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Install using Conda
|
|
86
|
+
|
|
87
|
+
In principle, installing any Conda/Mamba distribution will work. A few Conda/Mamba options are:
|
|
88
|
+
- [Miniforge](https://github.com/conda-forge/miniforge) (recommended as it includes mamba)
|
|
89
|
+
- [Anaconda](https://www.anaconda.com/download)
|
|
90
|
+
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)
|
|
91
|
+
|
|
92
|
+
Create a new environment, I've chosen Python 3.10 here but newer versions are
|
|
93
|
+
also supported.
|
|
94
|
+
```bash
|
|
95
|
+
conda create --name new_env python=3.10 -y
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Activate the environment
|
|
99
|
+
```bash
|
|
100
|
+
conda activate new_env
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Then you can install the cad_to_dagmc package
|
|
104
|
+
```bash
|
|
105
|
+
conda install -y -c conda-forge cad_to_dagmc
|
|
106
|
+
```
|
|
58
107
|
|
|
59
108
|
## Install using Mamba and pip
|
|
60
109
|
|
|
@@ -65,7 +114,7 @@ In principle, installing any Conda/Mamba distribution will work. A few Conda/Mam
|
|
|
65
114
|
|
|
66
115
|
This example assumes you have installed the Miniforge option or separately have installed Mamba with ```conda install -c conda-forge mamba -y```
|
|
67
116
|
|
|
68
|
-
Create a new
|
|
117
|
+
Create a new environment, I've chosen Python 3.10 here but newer versions are
|
|
69
118
|
also supported.
|
|
70
119
|
```bash
|
|
71
120
|
mamba create --name new_env python=3.10 -y
|
|
@@ -81,7 +130,7 @@ Install the dependencies
|
|
|
81
130
|
mamba install -y -c conda-forge "moab>=5.3.0" gmsh python-gmsh
|
|
82
131
|
```
|
|
83
132
|
|
|
84
|
-
Then you can install the cad_to_dagmc package
|
|
133
|
+
Then you can install the cad_to_dagmc package
|
|
85
134
|
```bash
|
|
86
135
|
pip install cad_to_dagmc
|
|
87
136
|
```
|
|
@@ -96,7 +145,7 @@ In principle, installing any Conda/Mamba distribution will work. A few Conda/Mam
|
|
|
96
145
|
|
|
97
146
|
This example uses Conda to install some dependencies that are not available via PyPi.
|
|
98
147
|
|
|
99
|
-
Create a new
|
|
148
|
+
Create a new environment
|
|
100
149
|
```bash
|
|
101
150
|
conda create --name new_env python=3.10 -y
|
|
102
151
|
```
|
|
@@ -111,7 +160,7 @@ Install the dependencies
|
|
|
111
160
|
conda install -y -c conda-forge "moab>=5.3.0" gmsh python-gmsh
|
|
112
161
|
```
|
|
113
162
|
|
|
114
|
-
Then you can install the cad_to_dagmc package
|
|
163
|
+
Then you can install the cad_to_dagmc package
|
|
115
164
|
```bash
|
|
116
165
|
pip install cad_to_dagmc
|
|
117
166
|
```
|
|
@@ -130,7 +179,7 @@ Then you can install the cad_to_dagmc package with ```pip```
|
|
|
130
179
|
pip install cad_to_dagmc
|
|
131
180
|
```
|
|
132
181
|
|
|
133
|
-
## Install with
|
|
182
|
+
## Install with OpenMC or other particle transport codes
|
|
134
183
|
|
|
135
184
|
You may also want to install OpenMC with DAGMC to make use of the h5m geometry files produced in simulations. However you could also use other supported particle transport codes such as MCNP, FLUKA and others [link to DAGMC documentation](https://svalinn.github.io/DAGMC/).
|
|
136
185
|
|
|
@@ -144,7 +193,6 @@ It might not be possible to install OpenMC and cad-to-dagmc in the same conda/ma
|
|
|
144
193
|
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.
|
|
145
194
|
|
|
146
195
|
|
|
147
|
-
|
|
148
196
|
# Known incompatibilities
|
|
149
197
|
|
|
150
198
|
The package requires newer versions of Linux. For example the package does not work on Ubuntu 18.04 or older.
|
|
@@ -153,20 +201,6 @@ The package requires newer versions of pip. It is recommended to ensure that you
|
|
|
153
201
|
|
|
154
202
|
Installing one of the package dependancies (gmsh) with pip appears to result in occational errors when passing cad objects between cadquery / ocp and gmsh. The conda install gmsh appears to work fine.
|
|
155
203
|
|
|
156
|
-
# Usage - with OpenMC
|
|
157
|
-
|
|
158
|
-
You may also want to install OpenMC with DAGMC to make use of the h5m geometry files produced in simulations. However you could also use other supported particle transport codes such as MCNP, FLUKA and others supported by [DAGMC](https://svalinn.github.io/DAGMC/).
|
|
159
|
-
|
|
160
|
-
You can run ```mamba install -c conda-forge openmc``` however this may choose to install OpenMC without DAGMC included.
|
|
161
|
-
|
|
162
|
-
You can be more specific with conda/mamba commands to make sure the latest version of OpenMC which contains DAGMC is chosen by conda / mamba
|
|
163
|
-
```bash
|
|
164
|
-
mamba install -c conda-forge -y "openmc=0.14.0=dagmc*nompi*"
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
You could also [install OpenMC from source](https://docs.openmc.org/en/stable/quickinstall.html) which might be prefered as it can be tricky for the conda enviroment to get resolved.
|
|
168
|
-
|
|
169
|
-
|
|
170
204
|
|
|
171
205
|
# Usage - creation of DAGMC h5m files
|
|
172
206
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
_version.py,sha256=akvr8ObxvMF-aaLBzW41juT4_KL3BjQUrjbwkIuQXMk,411
|
|
2
|
+
cad_to_dagmc/__init__.py,sha256=fskHUTyCunSpnpJUvBfAYjx4uwDKXHTTiMP6GqnFRf0,494
|
|
3
|
+
cad_to_dagmc/core.py,sha256=WJXKGK9yOtary66qPRB7cmdLlSdhSTkv1b4TxHtIvxw,21495
|
|
4
|
+
cad_to_dagmc-0.7.0.dist-info/LICENSE,sha256=B8kznH_777JVNZ3HOKDc4Tj24F7wJ68ledaNYeL9sCw,1070
|
|
5
|
+
cad_to_dagmc-0.7.0.dist-info/METADATA,sha256=40zC0CAVvVveGQ7wRpLvTE0gEhCtt5a-3ZvJQYCZc80,8770
|
|
6
|
+
cad_to_dagmc-0.7.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
7
|
+
cad_to_dagmc-0.7.0.dist-info/top_level.txt,sha256=zTi8C64SEBsE5WOtPovnxhOzt-E6Oc5nC3RW6M_5aEA,22
|
|
8
|
+
cad_to_dagmc-0.7.0.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
_version.py,sha256=PMhMumGW6FY6KtkQm1bSNdEAeyrHlBqpSQ7WpjsTyws,411
|
|
2
|
-
cad_to_dagmc/__init__.py,sha256=fskHUTyCunSpnpJUvBfAYjx4uwDKXHTTiMP6GqnFRf0,494
|
|
3
|
-
cad_to_dagmc/core.py,sha256=eMwKgKOjje3gBZEqjNzy9O6NF8a02WxD-VhXB5AJg58,18108
|
|
4
|
-
cad_to_dagmc-0.6.2.dist-info/LICENSE,sha256=B8kznH_777JVNZ3HOKDc4Tj24F7wJ68ledaNYeL9sCw,1070
|
|
5
|
-
cad_to_dagmc-0.6.2.dist-info/METADATA,sha256=vt8mq3_FjyTBzNfGDDpH5Kd8PVyqICf1AQUphB-qAic,8147
|
|
6
|
-
cad_to_dagmc-0.6.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
7
|
-
cad_to_dagmc-0.6.2.dist-info/top_level.txt,sha256=zTi8C64SEBsE5WOtPovnxhOzt-E6Oc5nC3RW6M_5aEA,22
|
|
8
|
-
cad_to_dagmc-0.6.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|