当前位置: 首页>>代码示例>>Python>>正文


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怎么用?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')
开发者ID:caceres,项目名称:FreeCAD,代码行数:38,代码来源:FemInputWriterCcx.py


注:本文中的FemMeshTools.get_three_non_colinear_nodes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。