FEM: utils, add a method to get the Part to mesh

This commit is contained in:
Bernd Hahnebach
2019-06-26 23:55:38 +02:00
parent 7fe5b00860
commit a8413f10fd

View File

@@ -152,6 +152,23 @@ def get_pref_working_dir(solver_obj):
# other
def get_part_to_mesh(mesh_obj):
'''
gmsh mesh object: the Attribute is Part
netgen mesh object: the Attribute is Shape
other mesh objects: do not have a Attribute which holds the part to mesh
'''
if is_derived_from(mesh_obj, "Fem::FemMeshGmsh"):
return mesh_obj.Part
elif is_derived_from(mesh_obj, "Fem::FemMeshShapeNetgenObject"):
return mesh_obj.Shape
else:
return None
# TODO: the Attributes should be named with the same name
# should it be Shape or Part?
# IMHO Part since the Attributes references the document object and not a Shape
def getBoundBoxOfAllDocumentShapes(doc):
overalboundbox = None
for o in doc.Objects: