Fem: Add support for 2D geometries to Tie constraint - fixes #13280
This commit is contained in:
@@ -474,16 +474,15 @@ class MeshSetsGetter:
|
||||
|
||||
for femobj in self.member.cons_tie:
|
||||
# femobj --> dict, FreeCAD document object is femobj["Object"]
|
||||
print_obj_info(femobj["Object"])
|
||||
slave_faces, master_faces = meshtools.get_tie_obj_faces(
|
||||
self.femmesh, self.femelement_table, self.femnodes_ele_table, femobj
|
||||
)
|
||||
# [ele_id, ele_face_id], [ele_id, ele_face_id], ...]
|
||||
# whereas the ele_face_id might be ccx specific
|
||||
femobj["TieSlaveFaces"] = slave_faces
|
||||
femobj["TieMasterFaces"] = master_faces
|
||||
# FreeCAD.Console.PrintLog("{}\n".format(femobj["ContactSlaveFaces"]))
|
||||
# FreeCAD.Console.PrintLog("{}\n".format(femobj["ContactMasterFaces"]))
|
||||
obj = femobj["Object"]
|
||||
print_obj_info(obj)
|
||||
result = []
|
||||
ref_data = meshtools.pair_obj_reference(obj.References)
|
||||
for ref_pair in ref_data:
|
||||
result.append(meshtools.get_ccx_elements(self, ref_pair))
|
||||
|
||||
femobj["TieSlaveFaces"] = result[:-1]
|
||||
femobj["TieMasterFaces"] = result[-1:]
|
||||
|
||||
def get_constraints_sectionprint_faces(self):
|
||||
if not self.member.cons_sectionprint:
|
||||
|
||||
@@ -60,12 +60,23 @@ def get_after_write_constraint():
|
||||
def write_meshdata_constraint(f, femobj, tie_obj, ccxwriter):
|
||||
# slave DEP
|
||||
f.write(f"*SURFACE, NAME=TIE_DEP{tie_obj.Name}\n")
|
||||
for i in femobj["TieSlaveFaces"]:
|
||||
f.write(f"{i[0]},S{i[1]}\n")
|
||||
for refs, surf, is_sub_el in femobj["TieSlaveFaces"]:
|
||||
if is_sub_el:
|
||||
for elem, fno in surf:
|
||||
f.write(f"{elem},S{fno}\n")
|
||||
else:
|
||||
for elem in surf:
|
||||
f.write(f"{elem},S2\n")
|
||||
|
||||
# master IND
|
||||
f.write(f"*SURFACE, NAME=TIE_IND{tie_obj.Name}\n")
|
||||
for i in femobj["TieMasterFaces"]:
|
||||
f.write(f"{i[0]},S{i[1]}\n")
|
||||
for refs, surf, is_sub_el in femobj["TieMasterFaces"]:
|
||||
if is_sub_el:
|
||||
for elem, fno in surf:
|
||||
f.write(f"{elem},S{fno}\n")
|
||||
else:
|
||||
for elem in surf:
|
||||
f.write(f"{elem},S2\n")
|
||||
|
||||
|
||||
def write_constraint(f, femobj, tie_obj, ccxwriter):
|
||||
|
||||
@@ -63,7 +63,7 @@ class _TaskPanel(base_femtaskpanel._BaseTaskPanel):
|
||||
|
||||
# geometry selection widget
|
||||
self.selectionWidget = selection_widgets.GeometryElementsSelection(
|
||||
obj.References, ["Face"], False, False
|
||||
obj.References, ["Edge", "Face"], False, False
|
||||
)
|
||||
|
||||
# form made from param and selection widget
|
||||
|
||||
Reference in New Issue
Block a user