本文整理汇总了Python中FemMeshTools.get_three_non_colinear_nodes方法的典型用法代码示例。如果您正苦于以下问题:Python FemMeshTools.get_three_non_colinear_nodes方法的具体用法?Python FemMeshTools.get_three_non_colinear_nodes怎么用?Python FemMeshTools.get_three_non_colinear_nodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FemMeshTools
的用法示例。
在下文中一共展示了FemMeshTools.get_three_non_colinear_nodes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write_node_sets_constraints_planerotation
# 需要导入模块: import FemMeshTools [as 别名]
# 或者: from FemMeshTools import get_three_non_colinear_nodes [as 别名]
def write_node_sets_constraints_planerotation(self, f):
# get nodes
self.get_constraints_planerotation_nodes()
# write nodes to file
if not self.femnodes_mesh:
self.femnodes_mesh = self.femmesh.Nodes
f.write('\n***********************************************************\n')
f.write('** Node set for plane rotation constraint\n')
f.write('** written by {} function\n'.format(sys._getframe().f_code.co_name))
# info about self.constraint_conflict_nodes:
# is used to check if MPC and constraint fixed and constraint displacement share same nodes,
# because MPC's and constriants fixed an constraints displacement can't share same nodes.
# thus call write_node_sets_constraints_planerotation has to be after constraint fixed and constraint displacement
for femobj in self.planerotation_objects: # femobj --> dict, FreeCAD document object is femobj['Object']
l_nodes = femobj['Nodes']
fric_obj = femobj['Object']
f.write('*NSET,NSET=' + fric_obj.Name + '\n')
# Code to extract nodes and coordinates on the PlaneRotation support face
nodes_coords = []
for node in l_nodes:
nodes_coords.append((node, self.femnodes_mesh[node].x, self.femnodes_mesh[node].y, self.femnodes_mesh[node].z))
node_planerotation = FemMeshTools.get_three_non_colinear_nodes(nodes_coords)
for i in range(len(l_nodes)):
if l_nodes[i] not in node_planerotation:
node_planerotation.append(l_nodes[i])
MPC_nodes = []
for i in range(len(node_planerotation)):
cnt = 0
for j in range(len(self.constraint_conflict_nodes)):
if node_planerotation[i] == self.constraint_conflict_nodes[j]:
cnt = cnt + 1
if cnt == 0:
MPC = node_planerotation[i]
MPC_nodes.append(MPC)
for i in range(len(MPC_nodes)):
f.write(str(MPC_nodes[i]) + ',\n')