Skip to content

Commit 658618e

Browse files
committed
Created get_imprinted_assembly method
1 parent 0bb0f1a commit 658618e

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

assembly_mesh_plugin/plugin.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,12 @@ def assembly_to_gmsh(self, mesh_path="tagged_mesh.msh"):
182182
gmsh.finalize()
183183

184184

185-
def assembly_to_imprinted_gmsh(self, mesh_path="tagged_mesh.msh"):
185+
def get_imprinted_gmsh(self):
186186
"""
187-
Exports an imprinted assembly to capture conformal meshes.
187+
Allows the user to get a gmsh object from the assembly, with the assembly being imprinted.
188188
"""
189189

190+
# Initialize gmsh and create a new model
190191
gmsh.initialize()
191192
gmsh.option.setNumber("General.Terminal", 0)
192193
gmsh.model.add("assembly")
@@ -297,6 +298,17 @@ def assembly_to_imprinted_gmsh(self, mesh_path="tagged_mesh.msh"):
297298

298299
gmsh.model.occ.synchronize()
299300

301+
return gmsh
302+
303+
304+
def assembly_to_imprinted_gmsh(self, mesh_path="tagged_mesh.msh"):
305+
"""
306+
Exports an imprinted assembly to capture conformal meshes.
307+
"""
308+
309+
# Turn this assembly into a imprinted gmsh object
310+
gmsh = get_imprinted_gmsh(self)
311+
300312
gmsh.model.mesh.field.setAsBackgroundMesh(2)
301313

302314
gmsh.model.mesh.generate(3)

0 commit comments

Comments
 (0)