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