FEM: get pressure faces ids, some better comments and very small code improvement

This commit is contained in:
Bernd Hahnebach
2020-02-03 23:10:03 +01:00
parent 82c89e176a
commit efe534bfca
3 changed files with 14 additions and 5 deletions

View File

@@ -1157,6 +1157,9 @@ class FemInputWriterCcx(writerbase.FemInputWriter):
rev = -1 if prs_obj.Reversed else 1
f.write("*DLOAD\n")
for ref_shape in femobj["PressureFaces"]:
# the loop is needed for compatibility reason
# in depretiated method get_pressure_obj_faces_depreciated
# the face ids where per ref_shape
f.write("** " + ref_shape[0] + "\n")
for face, fno in ref_shape[1]:
if fno > 0: # solid mesh face

View File

@@ -310,7 +310,12 @@ class FemInputWriter():
self.femelement_table,
self.femnodes_ele_table, femobj
)
femobj["PressureFaces"] = [(femobj["Object"].Name + ": face load", pressure_faces)]
# the data model is for compatibility reason with depreciated version
# get_pressure_obj_faces_depreciated returns the face ids in a tuple per ref_shape
# some_string was the reference_shape_element_string in depreciated method
# [(some_string, [ele_id, ele_face_id], [ele_id, ele_face_id], ...])]
some_string = "{}: face load".format(femobj["Object"].Name)
femobj["PressureFaces"] = [(some_string, pressure_faces)]
FreeCAD.Console.PrintLog("{}\n".format(femobj["PressureFaces"]))
def get_element_geometry2D_elements(self):