Esempio n. 1
0
 def checkMaterial(self):
     matObjs = FemUtils.getMember(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
Esempio n. 2
0
 def checkMesh(self):
     meshes = FemUtils.getMember(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
Esempio n. 3
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.getMember(self.analysis, "Fem::FemResultObject"):
             if m.Eigenmode > 0:
                 for mf in mode_frequencies:
                     if m.Eigenmode == mf['eigenmode']:
                         m.EigenmodeFrequency = mf['frequency']
Esempio n. 4
0
 def purge_results(self):
     for m in FemUtils.getMember(self.analysis, "Fem::FemResultObject"):
         if FemUtils.isOfType(m.Mesh, "FemMeshResult"):
             self.analysis.Document.removeObject(m.Mesh.Name)
         self.analysis.Document.removeObject(m.Name)
     App.ActiveDocument.recompute()
Esempio n. 5
0
 def _getMember(self, t):
     return FemUtils.getMember(self.analysis, t)
Esempio n. 6
0
 def checkHandled(self, w):
     handled = w.getHandledConstraints()
     allConstraints = FemUtils.getMember(self.analysis, "Fem::Constraint")
     for obj in set(allConstraints) - handled:
         self.report.warning("Ignored constraint %s." % obj.Label)