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


Python FemMeshTools.has_no_face_data方法代码示例

本文整理汇总了Python中FemMeshTools.has_no_face_data方法的典型用法代码示例。如果您正苦于以下问题:Python FemMeshTools.has_no_face_data方法的具体用法?Python FemMeshTools.has_no_face_data怎么用?Python FemMeshTools.has_no_face_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FemMeshTools的用法示例。


在下文中一共展示了FemMeshTools.has_no_face_data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_constraints_force_nodeloads

# 需要导入模块: import FemMeshTools [as 别名]
# 或者: from FemMeshTools import has_no_face_data [as 别名]
 def get_constraints_force_nodeloads(self):
     # check shape type of reference shape
     for femobj in self.force_objects:  # femobj --> dict, FreeCAD document object is femobj['Object']
         frc_obj = femobj['Object']
         # in GUI defined frc_obj all ref_shape have the same shape type
         # TODO in FemTools: check if all RefShapes really have the same type an write type to dictionary
         femobj['RefShapeType'] = ''
         if frc_obj.References:
             first_ref_obj = frc_obj.References[0]
             first_ref_shape = first_ref_obj[0].Shape.getElement(first_ref_obj[1][0])
             femobj['RefShapeType'] = first_ref_shape.ShapeType
         else:
             # frc_obj.References could be empty ! # TODO in FemTools: check
             FreeCAD.Console.PrintError('At least one Force Object has empty References!\n')
         if femobj['RefShapeType'] == 'Vertex':
             # print("load on vertices --> we do not need the femelement_table and femnodes_mesh for node load calculation")
             pass
         elif femobj['RefShapeType'] == 'Face' and FemMeshTools.is_solid_femmesh(self.femmesh) and not FemMeshTools.has_no_face_data(self.femmesh):
             # print("solid_mesh with face data --> we do not need the femelement_table but we need the femnodes_mesh for node load calculation")
             if not self.femnodes_mesh:
                 self.femnodes_mesh = self.femmesh.Nodes
         else:
             # print("mesh without needed data --> we need the femelement_table and femnodes_mesh for node load calculation")
             if not self.femnodes_mesh:
                 self.femnodes_mesh = self.femmesh.Nodes
             if not self.femelement_table:
                 self.femelement_table = FemMeshTools.get_femelement_table(self.femmesh)
     # get node loads
     for femobj in self.force_objects:  # femobj --> dict, FreeCAD document object is femobj['Object']
         frc_obj = femobj['Object']
         if frc_obj.Force == 0:
             print('  Warning --> Force = 0')
         if femobj['RefShapeType'] == 'Vertex':  # point load on vertieces
             femobj['NodeLoadTable'] = FemMeshTools.get_force_obj_vertex_nodeload_table(self.femmesh, frc_obj)
         elif femobj['RefShapeType'] == 'Edge':  # line load on edges
             femobj['NodeLoadTable'] = FemMeshTools.get_force_obj_edge_nodeload_table(self.femmesh, self.femelement_table, self.femnodes_mesh, frc_obj)
         elif femobj['RefShapeType'] == 'Face':  # area load on faces
             femobj['NodeLoadTable'] = FemMeshTools.get_force_obj_face_nodeload_table(self.femmesh, self.femelement_table, self.femnodes_mesh, frc_obj)
开发者ID:PocketMonster5,项目名称:FreeCAD,代码行数:40,代码来源:FemInputWriter.py


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