FEM: solver tasks, delete duplicate methods
This commit is contained in:
committed by
Yorik van Havre
parent
99a7bad13d
commit
c2e5df0e16
@@ -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 ''
|
||||
|
||||
## @}
|
||||
|
||||
@@ -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 ''
|
||||
|
||||
## @}
|
||||
|
||||
Reference in New Issue
Block a user