Example #1
0
 def get_material_elements(self):
     # it only works if either Volumes or Shellthicknesses or Beamsections are in the material objects
     # it means it does not work for mixed meshes and multiple materials, this is checked in check_prerequisites
     print("Materials")
     if self.femmesh.Volumes:
         # we only could do this for volumes, if a mesh contains volumes we're going to use them in the analysis
         # but a mesh could contain the element faces of the volumes as faces and the edges of the faces as edges,
         # there we have to check of some geometric objects
         all_found = False
         if self.femmesh.GroupCount:
             all_found = FemMeshTools.get_femelement_sets_from_group_data(self.femmesh, self.material_objects)
             print(all_found)
         if all_found is False:
             if not self.femelement_table:
                 self.femelement_table = FemMeshTools.get_femelement_table(self.femmesh)
             # we're going to use the binary search for get_femelements_by_femnodes()
             # thus we need the parameter values self.femnodes_ele_table
             if not self.femnodes_mesh:
                 self.femnodes_mesh = self.femmesh.Nodes
             if not self.femnodes_ele_table:
                 self.femnodes_ele_table = FemMeshTools.get_femnodes_ele_table(self.femnodes_mesh, self.femelement_table)
             FemMeshTools.get_femelement_sets(self.femmesh, self.femelement_table, self.material_objects, self.femnodes_ele_table)
     if self.shellthickness_objects:
         if not self.femelement_table:
             self.femelement_table = FemMeshTools.get_femelement_table(self.femmesh)
         FemMeshTools.get_femelement_sets(self.femmesh, self.femelement_table, self.material_objects)
     if self.beamsection_objects or self.fluidsection_objects:
         if not self.femelement_table:
             self.femelement_table = FemMeshTools.get_femelement_table(self.femmesh)
         FemMeshTools.get_femelement_sets(self.femmesh, self.femelement_table, self.material_objects)
Example #2
0
 def get_solid_element_sets(self, femobjs):
     # get element ids and write them into the femobj
     all_found = False
     if self.femmesh.GroupCount:
         all_found = meshtools.get_femelement_sets_from_group_data(
             self.femmesh, femobjs)
         FreeCAD.Console.PrintMessage(all_found)
         FreeCAD.Console.PrintMessage("\n")
     if all_found is False:
         if not self.femelement_table:
             self.femelement_table = meshtools.get_femelement_table(
                 self.femmesh)
         # we're going to use the binary search for get_femelements_by_femnodes()
         # thus we need the parameter values self.femnodes_ele_table
         if not self.femnodes_mesh:
             self.femnodes_mesh = self.femmesh.Nodes
         if not self.femnodes_ele_table:
             self.femnodes_ele_table = meshtools.get_femnodes_ele_table(
                 self.femnodes_mesh, self.femelement_table)
         control = meshtools.get_femelement_sets(self.femmesh,
                                                 self.femelement_table,
                                                 femobjs,
                                                 self.femnodes_ele_table)
         # we only need to set it, if it is still True
         if (self.femelement_count_test is True) and (control is False):
             self.femelement_count_test = False
Example #3
0
 def get_material_elements(self):
     # it only works if either Volumes or Shellthicknesses or Beamsections are in the material objects
     # it means it does not work for mixed meshes and multiple materials, this is checked in check_prerequisites
     # the femelement_table is only calculated for the highest dimension in get_femelement_table
     FreeCAD.Console.PrintMessage('Materials\n')
     if self.femmesh.Volumes:
         # we only could do this for volumes, if a mesh contains volumes we're going to use them in the analysis
         # but a mesh could contain the element faces of the volumes as faces and the edges of the faces as edges,
         # there we have to check of some geometric objects
         all_found = False
         if self.femmesh.GroupCount:
             all_found = FemMeshTools.get_femelement_sets_from_group_data(self.femmesh, self.material_objects)
             FreeCAD.Console.PrintMessage(all_found)
             FreeCAD.Console.PrintMessage('\n')
         if all_found is False:
             if not self.femelement_table:
                 self.femelement_table = FemMeshTools.get_femelement_table(self.femmesh)
             # we're going to use the binary search for get_femelements_by_femnodes()
             # thus we need the parameter values self.femnodes_ele_table
             if not self.femnodes_mesh:
                 self.femnodes_mesh = self.femmesh.Nodes
             if not self.femnodes_ele_table:
                 self.femnodes_ele_table = FemMeshTools.get_femnodes_ele_table(self.femnodes_mesh, self.femelement_table)
             control = FemMeshTools.get_femelement_sets(self.femmesh, self.femelement_table, self.material_objects, self.femnodes_ele_table)
             if (self.femelement_count_test is True) and (control is False):  # we only need to set it, if it is still True
                 self.femelement_count_test = False
     if self.shellthickness_objects:
         if not self.femelement_faces_table:
             self.femelement_faces_table = FemMeshTools.get_femelement_faces_table(self.femmesh)
         FemMeshTools.get_femelement_sets(self.femmesh, self.femelement_faces_table, self.material_objects)
     if self.beamsection_objects or self.fluidsection_objects:
         if not self.femelement_edges_table:
             self.femelement_edges_table = FemMeshTools.get_femelement_edges_table(self.femmesh)
         FemMeshTools.get_femelement_sets(self.femmesh, self.femelement_edges_table, self.material_objects)
Example #4
0
 def get_material_elements(self):
     # it only works if either Volumes or Shellthicknesses or Beamsections are in the material objects
     # it means it does not work for mixed meshes and multiple materials, this is checked in check_prerequisites
     # the femelement_table is only calculated for the highest dimension in get_femelement_table
     FreeCAD.Console.PrintMessage('Materials\n')
     if self.femmesh.Volumes:
         # we only could do this for volumes, if a mesh contains volumes we're going to use them in the analysis
         # but a mesh could contain the element faces of the volumes as faces and the edges of the faces as edges,
         # there we have to check of some geometric objects
         all_found = False
         if self.femmesh.GroupCount:
             all_found = FemMeshTools.get_femelement_sets_from_group_data(self.femmesh, self.material_objects)
             FreeCAD.Console.PrintMessage(all_found)
             FreeCAD.Console.PrintMessage('\n')
         if all_found is False:
             if not self.femelement_table:
                 self.femelement_table = FemMeshTools.get_femelement_table(self.femmesh)
             # we're going to use the binary search for get_femelements_by_femnodes()
             # thus we need the parameter values self.femnodes_ele_table
             if not self.femnodes_mesh:
                 self.femnodes_mesh = self.femmesh.Nodes
             if not self.femnodes_ele_table:
                 self.femnodes_ele_table = FemMeshTools.get_femnodes_ele_table(self.femnodes_mesh, self.femelement_table)
             control = FemMeshTools.get_femelement_sets(self.femmesh, self.femelement_table, self.material_objects, self.femnodes_ele_table)
             if (self.femelement_count_test is True) and (control is False):  # we only need to set it, if it is still True
                 self.femelement_count_test = False
     if self.shellthickness_objects:
         if not self.femelement_faces_table:
             self.femelement_faces_table = FemMeshTools.get_femelement_faces_table(self.femmesh)
         FemMeshTools.get_femelement_sets(self.femmesh, self.femelement_faces_table, self.material_objects)
     if self.beamsection_objects or self.fluidsection_objects:
         if not self.femelement_edges_table:
             self.femelement_edges_table = FemMeshTools.get_femelement_edges_table(self.femmesh)
         FemMeshTools.get_femelement_sets(self.femmesh, self.femelement_edges_table, self.material_objects)