本文整理汇总了Python中FemMeshTools.is_solid_femmesh方法的典型用法代码示例。如果您正苦于以下问题:Python FemMeshTools.is_solid_femmesh方法的具体用法?Python FemMeshTools.is_solid_femmesh怎么用?Python FemMeshTools.is_solid_femmesh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FemMeshTools
的用法示例。
在下文中一共展示了FemMeshTools.is_solid_femmesh方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write_z88_elements_properties
# 需要导入模块: import FemMeshTools [as 别名]
# 或者: from FemMeshTools import is_solid_femmesh [as 别名]
def write_z88_elements_properties(self):
element_properties_file_path = self.file_name + 'elp.txt'
elements_data = []
if FemMeshTools.is_edge_femmesh(self.femmesh):
if len(self.beamsection_objects) == 1:
beam_obj = self.beamsection_objects[0]['Object']
width = beam_obj.Width.getValueAs('mm')
height = beam_obj.Height.getValueAs('mm')
area = str(width * height)
elements_data.append('1 ' + str(self.element_count) + ' ' + area + ' 0 0 0 0 0 0 ')
print("Be aware, only trusses are supported for edge meshes!")
else:
print("Multiple beamsections for Z88 not yet supported!")
elif FemMeshTools.is_face_femmesh(self.femmesh):
if len(self.shellthickness_objects) == 1:
thick_obj = self.shellthickness_objects[0]['Object']
thickness = str(thick_obj.Thickness.getValueAs('mm'))
elements_data.append('1 ' + str(self.element_count) + ' ' + thickness + ' 0 0 0 0 0 0 ')
else:
print("Multiple thicknesses for Z88 not yet supported!")
elif FemMeshTools.is_solid_femmesh(self.femmesh):
elements_data.append('1 ' + str(self.element_count) + ' 0 0 0 0 0 0 0')
else:
print("Error!")
f = open(element_properties_file_path, 'w')
f.write(str(len(elements_data)) + '\n')
for e in elements_data:
f.write(e)
f.write('\n')
f.close()
示例2: get_z88_element_type
# 需要导入模块: import FemMeshTools [as 别名]
# 或者: from FemMeshTools import is_solid_femmesh [as 别名]
def get_z88_element_type(femmesh, femelement_table=None):
import FemMeshTools
if not femmesh:
print("Error: No femmesh!")
if not femelement_table:
print("We need to get the femelement_table first!")
femelement_table = FemMeshTools.get_femelement_table(femmesh)
# in some cases lowest key in femelement_table is not [1]
for elem in sorted(femelement_table):
elem_length = len(femelement_table[elem])
print(elem_length)
break # break after the first elem
if FemMeshTools.is_solid_femmesh(femmesh):
if femmesh.TetraCount == femmesh.VolumeCount:
if elem_length == 4:
return 17
elif elem_length == 10:
return 16
else:
print('Tetra with neiter 4 nor 10 nodes')
elif femmesh.HexaCount == femmesh.VolumeCount:
if elem_length == 8:
return 1
elif elem_length == 20:
return 10
else:
print('Hexa with neither 8 nor 20 nodes')
return 0
else:
print('no tetra, no hexa or Mixed Volume Elements')
elif FemMeshTools.is_face_femmesh(femmesh):
if femmesh.TriangleCount == femmesh.FaceCount:
if elem_length == 3:
print('tria3mesh, not supported by z88')
return 0
elif elem_length == 6:
return 24
else:
print('Tria with neither 3 nor 6 nodes')
return 0
elif femmesh.QuadrangleCount == femmesh.FaceCount:
if elem_length == 4:
print('quad4mesh, not supported by z88')
return 0
elif elem_length == 8:
return 23
else:
print('Quad with neiter 4 nor 8 nodes')
return 0
else:
print('no tria, no quad')
return 0
elif FemMeshTools.is_edge_femmesh(femmesh):
print('Edge femmesh will be exported as 3D truss element nr 4')
return 4
else:
print('Neither, edge, face or solid femmesh')
return 0
return 0
示例3: get_constraints_force_nodeloads
# 需要导入模块: import FemMeshTools [as 别名]
# 或者: from FemMeshTools import is_solid_femmesh [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)