Skip to content

Commit 71e4d06

Browse files
authored
Merge pull request #146 from fusion-energy/default-to-gmsh-for-now
changed meshing_backend_back
2 parents 7f33564 + 411816a commit 71e4d06

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/cad_to_dagmc/core.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -855,15 +855,16 @@ def export_dagmc_h5m_file(
855855
umesh_filename: the filename to use for the optional unstructured
856856
mesh file. Only used if unstructured_volumes is not empty.
857857
meshing_backend: determines whether gmsh or cadquery's direct mesh method
858-
is used for meshing.
858+
is used for meshing. Options are 'gmsh' or 'cadquery'. Defaults
859+
to 'gmsh'.
859860
860861
Returns:
861862
str: the filenames(s) for the files created.
862863
"""
863864

864865
# Check to make sure an invalid combination of mesher backend and surface vs volume mesh has not been chosen
865866
if unstructured_volumes != None and meshing_backend == "cadquery":
866-
raise(ValueError, "CadQuery direct meshing backend cannot be used for volume meshing.")
867+
raise (ValueError, "CadQuery direct meshing backend cannot be used for volume meshing.")
867868

868869
assembly = cq.Assembly()
869870
for part in self.parts:
@@ -902,7 +903,7 @@ def export_dagmc_h5m_file(
902903
vertices = cq_mesh["vertices"]
903904
triangles_by_solid_by_face = cq_mesh["solid_face_triangle_vertex_map"]
904905
# Use gmsh
905-
else:
906+
elif meshing_backend == "gmsh":
906907
# If assembly is not to be imprinted, pass through the assembly as-is
907908
if imprint:
908909
imprinted_assembly, imprinted_solids_with_org_id = cq.occ_impl.assembly.imprint(
@@ -942,6 +943,11 @@ def export_dagmc_h5m_file(
942943
dims_and_vol_ids=volumes
943944
)
944945

946+
else:
947+
raise ValueError(
948+
f'meshing_backend {meshing_backend} not supported. Available options are "cadquery" or "gmsh"'
949+
)
950+
945951
dagmc_filename = vertices_to_h5m(
946952
vertices=vertices,
947953
triangles_by_solid_by_face=triangles_by_solid_by_face,

0 commit comments

Comments
 (0)