Exemplo n.º 1
0
 def checkMaterial(self):
     matObjs = FemUtils.get_member(self.analysis,
                                   "App::MaterialObjectPython")
     if len(matObjs) == 0:
         self.report.error("No material object found. "
                           "At least one material is required.")
         self.fail()
         return False
     return True
Exemplo n.º 2
0
Arquivo: run.py Projeto: KimK/FreeCAD
 def checkMaterial(self):
     matObjs = FemUtils.get_member(
         self.analysis, "App::MaterialObjectPython")
     if len(matObjs) == 0:
         self.report.error(
             "No material object found. "
             "At least one material is required.")
         self.fail()
         return False
     return True
Exemplo n.º 3
0
 def checkMesh(self):
     meshes = FemUtils.get_member(self.analysis, "Fem::FemMeshObject")
     if len(meshes) == 0:
         self.report.error("Missing a mesh object.")
         self.fail()
         return False
     elif len(meshes) > 1:
         self.report.error("Too many meshes. "
                           "More than one mesh is not supported.")
         self.fail()
         return False
     return True
Exemplo n.º 4
0
Arquivo: run.py Projeto: KimK/FreeCAD
 def checkMesh(self):
     meshes = FemUtils.get_member(
         self.analysis, "Fem::FemMeshObject")
     if len(meshes) == 0:
         self.report.error("Missing a mesh object.")
         self.fail()
         return False
     elif len(meshes) > 1:
         self.report.error(
             "Too many meshes. "
             "More than one mesh is not supported.")
         self.fail()
         return False
     return True
Exemplo n.º 5
0
 def load_results_ccxdat(self):
     dat_result_file = os.path.join(
         self.directory, _inputFileName + '.dat')
     if os.path.isfile(dat_result_file):
         mode_frequencies = importCcxDatResults.import_dat(
             dat_result_file, self.analysis)
     else:
         raise Exception(
             'FEM: No .dat results found at {}!'.format(dat_result_file))
     if mode_frequencies:
         for m in femutils.get_member(self.analysis, "Fem::FemResultObject"):
             if m.Eigenmode > 0:
                 for mf in mode_frequencies:
                     if m.Eigenmode == mf['eigenmode']:
                         m.EigenmodeFrequency = mf['frequency']
Exemplo n.º 6
0
 def load_results_ccxdat(self):
     dat_result_file = os.path.join(self.directory, _inputFileName + '.dat')
     if os.path.isfile(dat_result_file):
         mode_frequencies = importCcxDatResults.import_dat(
             dat_result_file, self.analysis)
     else:
         raise Exception(
             'FEM: No .dat results found at {}!'.format(dat_result_file))
     if mode_frequencies:
         for m in FemUtils.get_member(self.analysis,
                                      "Fem::FemResultObject"):
             if m.Eigenmode > 0:
                 for mf in mode_frequencies:
                     if m.Eigenmode == mf['eigenmode']:
                         m.EigenmodeFrequency = mf['frequency']
Exemplo n.º 7
0
 def purge_results(self):
     for m in femutils.get_member(self.analysis, "Fem::FemResultObject"):
         if femutils.is_of_type(m.Mesh, "Fem::FemMeshResult"):
             self.analysis.Document.removeObject(m.Mesh.Name)
         self.analysis.Document.removeObject(m.Name)
     FreeCAD.ActiveDocument.recompute()
Exemplo n.º 8
0
 def checkHandled(self, w):
     handled = w.getHandledConstraints()
     allConstraints = FemUtils.get_member(self.analysis, "Fem::Constraint")
     for obj in set(allConstraints) - handled:
         self.report.warning("Ignored constraint %s." % obj.Label)
Exemplo n.º 9
0
 def _getMember(self, t):
     return femutils.get_member(self.analysis, t)
Exemplo n.º 10
0
 def purge_results(self):
     for m in FemUtils.get_member(self.analysis, "Fem::FemResultObject"):
         if FemUtils.is_of_type(m.Mesh, "Fem::FemMeshResult"):
             self.analysis.Document.removeObject(m.Mesh.Name)
         self.analysis.Document.removeObject(m.Name)
     App.ActiveDocument.recompute()
Exemplo n.º 11
0
 def _getMember(self, t):
     return FemUtils.get_member(self.analysis, t)
Exemplo n.º 12
0
 def _getMember(self, t):
     return femutils.get_member(self.analysis, t)
Exemplo n.º 13
0
 def checkHandled(self, w):
     handled = w.getHandledConstraints()
     allConstraints = femutils.get_member(self.analysis, "Fem::Constraint")
     for obj in set(allConstraints) - handled:
         self.report.warning("Ignored constraint %s." % obj.Label)