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
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
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']
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()
def _getMember(self, t): return FemUtils.getMember(self.analysis, t)
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)