Skip to content

Commit

Permalink
FEM: Update meshtools.py
Browse files Browse the repository at this point in the history
  • Loading branch information
FEA-eng authored Dec 6, 2024
1 parent 870e260 commit 32e83fd
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions src/Mod/Fem/femmesh/meshtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1620,27 +1620,23 @@ def get_tie_obj_faces(femmesh, femelement_table, femnodes_ele_table, femobj):
FreeCAD.Console.PrintLog(f"Slave: {slave_ref[0].Name}, {slave_ref}\n")
FreeCAD.Console.PrintLog(f"Master: {master_ref[0].Name}, {master_ref}\n")

if is_solid_femmesh(femmesh):
# get the nodes, sorted and duplicates removed
slaveface_nds = sorted(list(set(get_femnodes_by_refshape(femmesh, slave_ref))))
masterface_nds = sorted(list(set(get_femnodes_by_refshape(femmesh, master_ref))))
# FreeCAD.Console.PrintLog("slaveface_nds: {}\n".format(slaveface_nds))
# FreeCAD.Console.PrintLog("masterface_nds: {}\n".format(slaveface_nds))

# fill the bit_pattern_dict and search for the faces
slave_bit_pattern_dict = get_bit_pattern_dict(
femelement_table, femnodes_ele_table, slaveface_nds
)
master_bit_pattern_dict = get_bit_pattern_dict(
femelement_table, femnodes_ele_table, masterface_nds
)

# get the faces ids
slave_faces = get_ccxelement_faces_from_binary_search(slave_bit_pattern_dict)
master_faces = get_ccxelement_faces_from_binary_search(master_bit_pattern_dict)
# get the nodes, sorted and duplicates removed
slaveface_nds = sorted(list(set(get_femnodes_by_refshape(femmesh, slave_ref))))
masterface_nds = sorted(list(set(get_femnodes_by_refshape(femmesh, master_ref))))
# FreeCAD.Console.PrintLog("slaveface_nds: {}\n".format(slaveface_nds))
# FreeCAD.Console.PrintLog("masterface_nds: {}\n".format(slaveface_nds))

# fill the bit_pattern_dict and search for the faces
slave_bit_pattern_dict = get_bit_pattern_dict(
femelement_table, femnodes_ele_table, slaveface_nds
)
master_bit_pattern_dict = get_bit_pattern_dict(
femelement_table, femnodes_ele_table, masterface_nds
)

elif is_face_femmesh(femmesh):
FreeCAD.Console.PrintError("Shell mesh is not allowed for constraint tie.\n")
# get the faces ids
slave_faces = get_ccxelement_faces_from_binary_search(slave_bit_pattern_dict)
master_faces = get_ccxelement_faces_from_binary_search(master_bit_pattern_dict)

FreeCAD.Console.PrintLog(f"slave_faces: {slave_faces}\n")
FreeCAD.Console.PrintLog(f"master_faces: {master_faces}\n")
Expand Down

0 comments on commit 32e83fd

Please sign in to comment.