From c2e5df0e1646db0079b8ef1b2cba97715d51892f Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Fri, 7 Dec 2018 10:36:33 +0100 Subject: [PATCH] FEM: solver tasks, delete duplicate methods --- src/Mod/Fem/femsolver/calculix/tasks.py | 21 +-------------------- src/Mod/Fem/femsolver/z88/tasks.py | 21 +-------------------- 2 files changed, 2 insertions(+), 40 deletions(-) diff --git a/src/Mod/Fem/femsolver/calculix/tasks.py b/src/Mod/Fem/femsolver/calculix/tasks.py index e0b7f6393b..860f4a7b10 100644 --- a/src/Mod/Fem/femsolver/calculix/tasks.py +++ b/src/Mod/Fem/femsolver/calculix/tasks.py @@ -201,7 +201,7 @@ class _Container(object): elif m.isDerivedFrom("Fem::ConstraintForce"): force_constraint_dict = {} force_constraint_dict['Object'] = m - force_constraint_dict['RefShapeType'] = self.get_refshape_type(m) + force_constraint_dict['RefShapeType'] = FemUtils.get_refshape_type(m) self.force_constraints.append(force_constraint_dict) elif m.isDerivedFrom("Fem::ConstraintPressure"): PressureObjectDict = {} @@ -253,23 +253,4 @@ class _Container(object): shell_thickness_dict['Object'] = m self.shell_thicknesses.append(shell_thickness_dict) - def get_refshape_type(self, fem_doc_object): - # returns the reference shape type - # for force object: - # in GUI defined frc_obj all frc_obj have at least one ref_shape and ref_shape have all the same shape type - # for material object: - # in GUI defined material_obj could have no RefShape and RefShapes could be different type - # we're going to need the RefShapes to be the same type inside one fem_doc_object - # TODO here: check if all RefShapes inside the object really have the same type - import femmesh.meshtools as FemMeshTools - if hasattr(fem_doc_object, 'References') and fem_doc_object.References: - first_ref_obj = fem_doc_object.References[0] - first_ref_shape = FemMeshTools.get_element(first_ref_obj[0], first_ref_obj[1][0]) - st = first_ref_shape.ShapeType - print(fem_doc_object.Name + ' has ' + st + ' reference shapes.') - return st - else: - print(fem_doc_object.Name + ' has empty References.') - return '' - ## @} diff --git a/src/Mod/Fem/femsolver/z88/tasks.py b/src/Mod/Fem/femsolver/z88/tasks.py index 91859ac473..769464293c 100644 --- a/src/Mod/Fem/femsolver/z88/tasks.py +++ b/src/Mod/Fem/femsolver/z88/tasks.py @@ -199,7 +199,7 @@ class _Container(object): elif m.isDerivedFrom("Fem::ConstraintForce"): force_constraint_dict = {} force_constraint_dict['Object'] = m - force_constraint_dict['RefShapeType'] = self.get_refshape_type(m) + force_constraint_dict['RefShapeType'] = FemUtils.get_refshape_type(m) self.force_constraints.append(force_constraint_dict) elif m.isDerivedFrom("Fem::ConstraintPressure"): PressureObjectDict = {} @@ -251,23 +251,4 @@ class _Container(object): shell_thickness_dict['Object'] = m self.shell_thicknesses.append(shell_thickness_dict) - def get_refshape_type(self, fem_doc_object): - # returns the reference shape type - # for force object: - # in GUI defined frc_obj all frc_obj have at least one ref_shape and ref_shape have all the same shape type - # for material object: - # in GUI defined material_obj could have no RefShape and RefShapes could be different type - # we're going to need the RefShapes to be the same type inside one fem_doc_object - # TODO: check if all RefShapes inside the object really have the same type - import femmesh.meshtools as FemMeshTools - if hasattr(fem_doc_object, 'References') and fem_doc_object.References: - first_ref_obj = fem_doc_object.References[0] - first_ref_shape = FemMeshTools.get_element(first_ref_obj[0], first_ref_obj[1][0]) - st = first_ref_shape.ShapeType - print(fem_doc_object.Name + ' has ' + st + ' reference shapes.') - return st - else: - print(fem_doc_object.Name + ' has empty References.') - return '' - ## @}