示例#1
0
 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']
         print("Constraint force: " + femobj['Object'].Name)
         frc_obj = femobj['Object']
         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)
示例#2
0
 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']
         FreeCAD.Console.PrintMessage("Constraint force: " + femobj['Object'].Name + '\n')
         frc_obj = femobj['Object']
         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:
             FreeCAD.Console.PrintMessage('  Warning --> Force = 0\n')
         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)
示例#3
0
 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']
         FreeCAD.Console.PrintMessage("Constraint force:" + ' ' + femobj['Object'].Name + '\n')
         frc_obj = femobj['Object']
         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
     FreeCAD.Console.PrintMessage("  Finite element mesh nodes will be retrieved by searching the appropriate nodes in the finite element mesh.\n")
     FreeCAD.Console.PrintMessage("  The appropriate finite element mesh node load values will be calculated according to the finite element definition.\n")
     for femobj in self.force_objects:  # femobj --> dict, FreeCAD document object is femobj['Object']
         frc_obj = femobj['Object']
         if frc_obj.Force == 0:
             FreeCAD.Console.PrintMessage('  Warning --> Force = 0\n')
         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)
示例#4
0
 def get_constraints_force_nodeloads(self):
     if not self.member.cons_force:
         return
     # check shape type of reference shape
     for femobj in self.member.cons_force:
         # femobj --> dict, FreeCAD document object is femobj["Object"]
         print_obj_info(femobj["Object"], log=True)
         if femobj["RefShapeType"] == "Vertex":
             FreeCAD.Console.PrintLog(
                 "    load on vertices --> The femelement_table "
                 "and femnodes_mesh are not needed for node load calculation.\n"
             )
         elif femobj["RefShapeType"] == "Face" \
                 and meshtools.is_solid_femmesh(self.femmesh) \
                 and not meshtools.has_no_face_data(self.femmesh):
             FreeCAD.Console.PrintLog(
                 "    solid_mesh with face data --> The femelement_table is not "
                 "needed but the femnodes_mesh is needed for node load calculation.\n"
             )
             if not self.femnodes_mesh:
                 self.femnodes_mesh = self.femmesh.Nodes
         else:
             FreeCAD.Console.PrintLog(
                 "    mesh without needed data --> The femelement_table "
                 "and femnodes_mesh are not needed for node load calculation.\n"
             )
             if not self.femnodes_mesh:
                 self.femnodes_mesh = self.femmesh.Nodes
             if not self.femelement_table:
                 self.femelement_table = meshtools.get_femelement_table(
                     self.femmesh)
     # get node loads
     FreeCAD.Console.PrintLog(
         "    Finite element mesh nodes will be retrieved by searching "
         "the appropriate nodes in the finite element mesh.\n")
     FreeCAD.Console.PrintLog(
         "    The appropriate finite element mesh node load values will "
         "be calculated according to the finite element definition.\n")
     for femobj in self.member.cons_force:
         # femobj --> dict, FreeCAD document object is femobj["Object"]
         frc_obj = femobj["Object"]
         print_obj_info(frc_obj)
         if frc_obj.Force == 0:
             FreeCAD.Console.PrintMessage("  Warning --> Force = 0\n")
         if femobj["RefShapeType"] == "Vertex":  # point load on vertices
             femobj[
                 "NodeLoadTable"] = meshtools.get_force_obj_vertex_nodeload_table(
                     self.femmesh, frc_obj)
         elif femobj["RefShapeType"] == "Edge":  # line load on edges
             femobj[
                 "NodeLoadTable"] = meshtools.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"] = meshtools.get_force_obj_face_nodeload_table(
                     self.femmesh, self.femelement_table,
                     self.femnodes_mesh, frc_obj)